Skip to content

Update for repo rename #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Describe the use case and detail of the change. If this PR addresses an issue on

Before creating a PR, run through this checklist and mark each as complete.

- [ ] I have read the [`CONTRIBUTING`](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/CONTRIBUTING.md) document
- [ ] I have read the [`CONTRIBUTING`](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/CONTRIBUTING.md) document
- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
- [ ] If applicable, I have checked that any relevant tests pass after adding my changes
- [ ] I have updated any relevant documentation ([`README.md`](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/README.md) and [`CHANGELOG.md`](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/CHANGELOG.md))
- [ ] I have updated any relevant documentation ([`README.md`](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/README.md) and [`CHANGELOG.md`](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/CHANGELOG.md))
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ The following is a set of guidelines for contributing to the nginx_k8s_loadbalan

[Code Guidelines](#code-guidelines)

[Code of Conduct](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/CODE_OF_CONDUCT.md)
[Code of Conduct](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/CODE_OF_CONDUCT.md)

## Getting Started

Follow our [Installation Guide](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/README.md#Installation) to get the nginx_k8s_loadbalancer up and running.
Follow our [Installation Guide](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/README.md#Installation) to get the nginx_k8s_loadbalancer up and running.

<!-- ### Project Structure (OPTIONAL) -->

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ RUN go mod download

COPY . .

RUN go build -o nginx-k8s-loadbalancer ./cmd/nginx-k8s-loadbalancer/main.go
RUN go build -o nginx-loadbalancer-kubernetes ./cmd/nginx-loadbalancer-kubernetes/main.go

FROM alpine:3.16

WORKDIR /opt/nginx-k8s-loadbalancer
WORKDIR /opt/nginx-loadbalancer-kubernetes

RUN adduser -u 11115 -D -H nlk

USER nlk

COPY --from=builder /app/nginx-k8s-loadbalancer .
COPY --from=builder /app/nginx-loadbalancer-kubernetes .

ENTRYPOINT ["/opt/nginx-k8s-loadbalancer/nginx-k8s-loadbalancer"]
ENTRYPOINT ["/opt/nginx-loadbalancer-kubernetes/nginx-loadbalancer-kubernetes"]
90 changes: 45 additions & 45 deletions README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/*
Package main includes the entrypoint for the nginx-k8s-loadbalancer.
Package main includes the entrypoint for the nginx-loadbalancer-kubernetes.
*/

package main
6 changes: 3 additions & 3 deletions deployments/deployment/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spec:
app: nlk
spec:
containers:
- name: nginx-k8s-loadbalancer
image: ghcr.io/nginxinc/nginx-k8s-loadbalancer:latest
- name: nginx-loadbalancer-kubernetes
image: ghcr.io/nginxinc/nginx-loadbalancer-kubernetes:latest
imagePullPolicy: Always
ports:
- name: http
Expand All @@ -35,4 +35,4 @@ spec:
port: 51031
initialDelaySeconds: 5
periodSeconds: 2
serviceAccountName: nginx-k8s-loadbalancer
serviceAccountName: nginx-loadbalancer-kubernetes
6 changes: 3 additions & 3 deletions deployments/rbac/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "nginx-k8s-loadbalancer:ingress-resource-get-watch-list"
name: "nginx-loadbalancer-kubernetes:resource-get-watch-list"
namespace: nlk
subjects:
- kind: ServiceAccount
name: nginx-k8s-loadbalancer
name: nginx-loadbalancer-kubernetes
namespace: nlk
roleRef:
kind: ClusterRole
name: ingress-resource-get-watch-list
name: resource-get-watch-list
apiGroup: rbac.authorization.k8s.io
4 changes: 2 additions & 2 deletions deployments/rbac/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: nginx-k8s-loadbalancer-secret
name: nginx-loadbalancer-kubernetes-secret
namespace: nlk
annotations:
kubernetes.io/service-account.name: nginx-k8s-loadbalancer
kubernetes.io/service-account.name: nginx-loadbalancer-kubernetes
type: kubernetes.io/service-account-token
2 changes: 1 addition & 1 deletion deployments/rbac/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-k8s-loadbalancer
name: nginx-loadbalancer-kubernetes
namespace: nlk
6 changes: 3 additions & 3 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

The nginx-k8s-loadbalancer runs in a Kubernetes Cluster and responds to changes in resources of interest, updating designated NGINX Plus hosts with the appropriate configuration.
The nginx-loadbalancer-kubernetes runs in a Kubernetes Cluster and responds to changes in resources of interest, updating designated NGINX Plus hosts with the appropriate configuration.

## Basic Architecture

Expand Down Expand Up @@ -44,8 +44,8 @@ adding each `core.ServerUpdateEvent` to the "nlk-synchronizer" queue.
### Translator

The Translator is responsible for converting the `core.Event` event into an `nginxClient.UpstreamServer` event.
This involves filtering out the `core.Event` instances that are not of interest to the controller by accepting only Port names starting with the NklPrefix value (currently _nlk-_).
The event is then fanned-out based on the defined Ports, one event per defined Port. Each port is then augmented with the Ingress name (the name configured in the Port definition with the NklPrefix value removed),
This involves filtering out the `core.Event` instances that are not of interest to the controller by accepting only Port names starting with the NlkPrefix value (currently _nlk-_).
The event is then fanned-out based on the defined Ports, one event per defined Port. Each port is then augmented with the Ingress name (the name configured in the Port definition with the NlkPrefix value removed),
and the list of the Node's IP addresses.

The Translator passes the list of events to the Synchronizer by calling the `AddEvents` method.
Expand Down
32 changes: 16 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# nginx-k8s-loadbalancer
# nginx-loadbalancer-kubernetes

<br/>

# Welcome to the Nginx Kubernetes Load Balancer Solution!

<br/>

![Nginx K8s LB](media/nkl-logo.png) | ![Nginx K8s LB](media/nginx-2020.png)
![Nginx K8s LB](media/nlk-logo.png) | ![Nginx K8s LB](media/nginx-2020.png)
--- | ---

<br/>
Expand All @@ -23,12 +23,12 @@ This repo contains source code and documents for a new `Kubernetes Controller fr

# Overview

- `NKL - Nginx Kubernetes Loadbalancer` is a new K8s Controller from Nginx, that monitors specified K8s Services, and then sends API calls to an external Nginx Plus server to manage Nginx Upstream servers dynamically.
- `NLK - NGINX Loadbalancer for Kubernetes` is a new K8s Controller from Nginx, that monitors specified K8s Services, and then sends API calls to an external Nginx Plus server to manage Nginx Upstream servers dynamically.
- This will `synchronize` the K8s Service Endpoint list, with the Nginx LB Server's upstream list.
- The primary use case and Solution provided is for tracking the K8s` NodePort` IP:Port definitions for the Nginx Ingress Controller's `nginx-ingress Service`.
- NKL is a native Kubernetes Controller, running, configured and managed with standard K8s commands.
- NKL paired with the Nginx Plus Server located external to the K8s cluster, this new controller LB function will provide a `TCP Load Balancer Service` for On Premises K8s clusters, which do not have access to a Cloud providers "Service Type LoadBalancer".
- NKL paired with the Nginx Plus Server located external to the Cluster, using Nginx's advanced HTTP features, provide an `HTTP Load Balancer Service` for Enterprise traffic management solutions, such as:
- NLK is a native Kubernetes Controller, running, configured and managed with standard K8s commands.
- NLK paired with the Nginx Plus Server located external to the K8s cluster, this new controller LB function will provide a `TCP Load Balancer Service` for On Premises K8s clusters, which do not have access to a Cloud providers "Service Type LoadBalancer".
- NLK paired with the Nginx Plus Server located external to the Cluster, using Nginx's advanced HTTP features, provide an `HTTP Load Balancer Service` for Enterprise traffic management solutions, such as:
- MultiCluster Active/Active Load Balancing
- Horizontal Cluster Scaling
- HTTP Split Clients - for A/B, Blue/Green, and Canary test and production traffic steering. Allows Cluster operations/maintainence like upgrades, patching, expansion and troubleshooting with no downtime or reloads
Expand All @@ -39,37 +39,37 @@ This repo contains source code and documents for a new `Kubernetes Controller fr

<br/>

## NKL Controller Software Design Overview - How it works
## NLK Controller Software Design Overview - How it works

[NKL Controller DESIGN and Architecture](DESIGN.md)
[NLK Controller DESIGN and Architecture](DESIGN.md)

<br/>

## Reference Diagram for NKL TCP Load Balancer Service
## Reference Diagram for NLK TCP Load Balancer Service

<br/>

![NKL Stream Diagram](media/nkl-blog-diagram-v1.png)
![NLK Stream Diagram](media/nlk-blog-diagram-v1.png)

<br/>

## Sample Screenshots of Solution at Runtime

<br/>

![NGINX LB ConfigMap](media/nkl-configmap.png)
![NGINX LB ConfigMap](media/nlk-configmap.png)
### ConfigMap with 2 Nginx LB Servers defined for HA

<br/>

![NGINX LB Create Nodeport](media/nkl-stream-create-nodeport.png)
### Nginx LB Server Dashboard, NodePort, and NKL Controller Logging
![NGINX LB Create Nodeport](media/nlk-stream-create-nodeport.png)
### Nginx LB Server Dashboard, NodePort, and NLK Controller Logging

### Legend:
- Red - kubectl nodeport commands
- Blue - nodeport and upstreams for http traffic
- Indigo - nodeport and upstreams for https traffic
- Green - NKL log for api calls to LB Server #1
- Green - NLK log for api calls to LB Server #1
- Orange - Nginx LB Server upstream dashboard details
- Kubernetes Worker Nodes are 10.1.1.8 and 10.1.1.10

Expand All @@ -95,7 +95,7 @@ Please see the /docs folder and Installation Guides for detailed documentation.

## Development

Read the [`CONTRIBUTING.md`](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/CONTRIBUTING.md) file.
Read the [`CONTRIBUTING.md`](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/CONTRIBUTING.md) file.

<br/>

Expand All @@ -107,6 +107,6 @@ Read the [`CONTRIBUTING.md`](https://github.com/nginxinc/nginx-k8s-loadbalancer/

## License

[Apache License, Version 2.0](https://github.com/nginxinc/nginx-k8s-loadbalancer/blob/main/LICENSE)
[Apache License, Version 2.0](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/blob/main/LICENSE)

&copy; [F5 Networks, Inc.](https://www.f5.com/) 2023
4 changes: 2 additions & 2 deletions docs/http/http-installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ This can be any standard Linux OS system, based on the Linux Distro and Technica
For easy installation/configuration, Git Clone this repository onto the Loadbalancing Server, it contains all the example files that are used here.

```bash
https://github.com/nginxinc/nginx-k8s-loadbalancer.git
https://github.com/nginxinc/nginx-loadbalancer-kubernetes.git
```

Nginx Config Files
Expand Down Expand Up @@ -684,7 +684,7 @@ Use the `loadbalancer-cluster1.yaml` or `nodeport-cluster1.yaml` manifest file t
From the Git Repo, reference the provided Kubernetes Config Files

``` bash
nginx-k8s-loadbalancer/
nginx-loadbalancer-kubernetes/
└── docs/
└── http/
├── grafana-dashboard.json............ NGINX Plus Grafana dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/http/loadbalancer-cluster1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ spec:
- port: 443
targetPort: 443
protocol: TCP
name: nkl-cluster1-https # Must match Nginx upstream name
name: nlk-cluster1-https # Must match Nginx upstream name
selector:
app: nginx-ingress
2 changes: 1 addition & 1 deletion docs/http/loadbalancer-cluster2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ spec:
- port: 443
targetPort: 443
protocol: TCP
name: nkl-cluster2-https # Must match Nginx upstream name
name: nlk-cluster2-https # Must match Nginx upstream name
selector:
app: nginx-ingress
4 changes: 2 additions & 2 deletions docs/tcp/tcp-installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ https://www.nginx.com/free-trial-request/
For easy installation/configuration, Git Clone this repository onto the Loadbalancing Server, it contains all the example files that are used here.

```bash
https://github.com/nginxinc/nginx-k8s-loadbalancer.git
https://github.com/nginxinc/nginx-loadbalancer-kubernetes.git
```

<br/>
Expand All @@ -191,7 +191,7 @@ etc/
```

``` bash
nginx-k8s-loadbalancer/
nginx-loadbalancer-kubernetes/
└── docs/
└── tcp/
├── loadbalancer-nlk.yaml........ LoadBalancer manifest
Expand Down
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ module github.com/nginxinc/kubernetes-nginx-ingress

go 1.19

require github.com/sirupsen/logrus v1.9.0
require (
github.com/nginxinc/nginx-plus-go-client v0.10.0
github.com/sirupsen/logrus v1.9.0
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/client-go v0.26.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -26,7 +32,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nginxinc/nginx-plus-go-client v0.10.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.5.0 // indirect
Expand All @@ -38,9 +43,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.0 // indirect
k8s.io/apimachinery v0.26.0 // indirect
k8s.io/client-go v0.26.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect
Expand Down
Loading