diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b8a5076..fad5aa1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -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)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccb5d16..14c3721 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/Dockerfile b/Dockerfile index 58201b5..9aa6b8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 0000772..10fe59b 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,35 @@ -[![CI](https://github.com/nginxinc/nginx-k8s-loadbalancer/actions/workflows/build-test.yml/badge.svg)](https://github.com/nginxinc/nginx-k8s-loadbalancers/actions/workflows/build-test.yml) -[![Go Report Card](https://goreportcard.com/badge/github.com/nginxinc/nginx-k8s-loadbalancer)](https://goreportcard.com/report/github.com/nginxinc/nginx-k8s-loadbalancer) +[![CI](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/actions/workflows/build-test.yml/badge.svg)](https://github.com/nginxinc/nginx-loadbalancer-kubernetess/actions/workflows/build-test.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/nginxinc/nginx-loadbalancer-kubernetes)](https://goreportcard.com/report/github.com/nginxinc/nginx-loadbalancer-kubernetes) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nginxinc/nginx-k8s-loadbalancer?logo=github&sort=semver)](https://github.com/nginxinc/nginx-k8s-loadbalancer/releases/latest) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/nginxinc/nginx-k8s-loadbalancer?logo=go) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-k8s-loadbalancer/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-k8s-loadbalancer) -[![CodeQL](https://github.com/nginxinc/nginx-k8s-loadbalancer/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/nginxinc/nginx-k8s-loadbalancer/actions/codeql.yml) -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fnginxinc%2Fnginx-k8s-loadbalancer.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fnginxinc%2Fnginx-k8s-loadbalancer?ref=badge_shield) -[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](https://github.com/nginxinc/nginx-k8s-loadbalancer/discussions) +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nginxinc/nginx-loadbalancer-kubernetes?logo=github&sort=semver)](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/releases/latest) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/nginxinc/nginx-loadbalancer-kubernetes?logo=go) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-loadbalancer-kubernetes/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-loadbalancer-kubernetes) +[![CodeQL](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/actions/codeql.yml) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fnginxinc%2Fnginx-loadbalancer-kubernetes.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fnginxinc%2Fnginx-loadbalancer-kubernetes?ref=badge_shield) +[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](https://github.com/nginxinc/nginx-loadbalancer-kubernetes/discussions) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
- -

nginx-k8s-loadbalancer

+ +

nginx-loadbalancer-kubernetes

-The NGINX K8s Loadbalancer, or _NKL_, is a Kubernetes controller that provides TCP load balancing external to a Kubernetes cluster running on-premise. +The NGINX Loadbalancer for Kubernetes, or _NLK_, is a Kubernetes controller that provides TCP load balancing external to a Kubernetes cluster running on-premise. ## Requirements -[//]: # (### Who needs NKL?) +[//]: # (### Who needs NLK?) [//]: # () -[//]: # (- [ ] If you find yourself living in a world where Kubernetes is running on-premise instead of a cloud provider, you might need NKL.) +[//]: # (- [ ] If you find yourself living in a world where Kubernetes is running on-premise instead of a cloud provider, you might need NLK.) -[//]: # (- [ ] If you want exceptional, best-in-class load-balancing for your Kubernetes clusters by using NGINX Plus, you might need NKL.) +[//]: # (- [ ] If you want exceptional, best-in-class load-balancing for your Kubernetes clusters by using NGINX Plus, you might need NLK.) -[//]: # (- [ ] If you want the ability to manage your load-balancing configuration with the same tools you use to manage your Kubernetes cluster, you might need NKL.) +[//]: # (- [ ] If you want the ability to manage your load-balancing configuration with the same tools you use to manage your Kubernetes cluster, you might need NLK.) ### What you will need @@ -38,20 +38,20 @@ The NGINX K8s Loadbalancer, or _NKL_, is a Kubernetes controller that provides T There is a more detailed [Installation Reference](docs/README.md) available in the `docs/` directory. -### Why NKL? +### Why NLK? -NKL provides a simple, easy-to-manage way to automate load balancing for your Kubernetes applications by leveraging NGINX Plus hosts running outside your cluster. +NLK provides a simple, easy-to-manage way to automate load balancing for your Kubernetes applications by leveraging NGINX Plus hosts running outside your cluster. -NKL installs easily, has a small footprint, and is easy to configure and manage. +NLK installs easily, has a small footprint, and is easy to configure and manage. -NKL does not require learning a custom object model, you only have to understand NGINX configuration to get the most out of this solution. +NLK does not require learning a custom object model, you only have to understand NGINX configuration to get the most out of this solution. There is thorough documentation available with the specifics in the `docs/` directory. -### What does NKL do? +### What does NLK do? tl;dr: -_**NKL is a Kubernetes controller that monitors Services and Nodes in your cluster, and then sends API calls to an external NGINX Plus server to manage NGINX Plus Upstream servers automatically.**_ +_**NLK is a Kubernetes controller that monitors Services and Nodes in your cluster, and then sends API calls to an external NGINX Plus server to manage NGINX Plus Upstream servers automatically.**_ That's all well and good, but what does it mean? Kubernetes clusters require some tooling to handling routing traffic from the outside world (e.g.: the Internet, corporate network, etc.) to the cluster. This is typically done with a load balancer. The load balancer is responsible for routing traffic to the appropriate worker node which then forwards the traffic to the appropriate Service / Pod. @@ -59,55 +59,55 @@ This is typically done with a load balancer. The load balancer is responsible fo If you are using a hosted Kubernetes solution -- Digital Ocean, AWS, Azure, etc. -- you can use the cloud provider's load balancer service. Those services will create a load balancer for you. You can use the cloud provider's API to manage the load balancer, or you can use the cloud provider's web console. -If you are running Kubernetes on-premise and will need to manage your own load balancer, NKL can help. +If you are running Kubernetes on-premise and will need to manage your own load balancer, NLK can help. -NKL itself does not perform load balancing. Rather, NKL allows you to manage Service resources within your cluster to update your load balancers, with tooling you are most likely already using. +NLK itself does not perform load balancing. Rather, NLK allows you to manage Service resources within your cluster to update your load balancers, with tooling you are most likely already using. - + ## Getting Started -There are few bits of administrivia to get out of the way before you can start leveraging NKL for your load balancing needs. +There are few bits of administrivia to get out of the way before you can start leveraging NLK for your load balancing needs. -As noted above, NKL is intended for when you have one or more Kubernetes clusters running on-premise. In addition to this, +As noted above, NLK is intended for when you have one or more Kubernetes clusters running on-premise. In addition to this, you need to have at least one NGINX Plus host running outside your cluster (Please refer to the [Roadmap](#Roadmap) for information about other load balancer servers). ### Deployment #### RBAC -As with everything Kubernetes, NKL requires RBAC permissions to function properly. The necessary resources are defined in the various YAML files in `deployment/rbac/`. +As with everything Kubernetes, NLK requires RBAC permissions to function properly. The necessary resources are defined in the various YAML files in `deployment/rbac/`. For convenience, two scripts are included, `apply.sh`, and `unapply.sh`. These scripts will apply or remove the RBAC resources, respectively. -The permissions required by NKL are modest. NKL requires the ability to read Resources via shared informers; the resources are Services, Nodes, and ConfigMaps. -The Services and ConfigMap are restricted to a specific namespace (default: "nkl"). The Nodes resource is cluster-wide. +The permissions required by NLK are modest. NLK requires the ability to read Resources via shared informers; the resources are Services, Nodes, and ConfigMaps. +The Services and ConfigMap are restricted to a specific namespace (default: "nlk"). The Nodes resource is cluster-wide. #### Configuration -NKL is configured via a ConfigMap, the default settings are found in `deployment/configmap.yaml`. Presently there is a single configuration value exposed in the ConfigMap, `nginx-hosts`. -This contains a comma-separated list of NGINX Plus hosts that NKL will maintain. +NLK is configured via a ConfigMap, the default settings are found in `deployment/configmap.yaml`. Presently there is a single configuration value exposed in the ConfigMap, `nginx-hosts`. +This contains a comma-separated list of NGINX Plus hosts that NLK will maintain. You will need to update this ConfigMap to reflect the NGINX Plus hosts you wish to manage. -If you were to deploy the ConfigMap and start NKL without updating the `nginx-hosts` value, don't fear; the ConfigMap resource is monitored for changes and NKL will update the NGINX Plus hosts accordingly when the resource is changed, no restart required. +If you were to deploy the ConfigMap and start NLK without updating the `nginx-hosts` value, don't fear; the ConfigMap resource is monitored for changes and NLK will update the NGINX Plus hosts accordingly when the resource is changed, no restart required. There is an extensive [Installation Reference](docs/README.md) available in the `docs/` directory. -Please refer to that for detailed instructions on how to deploy NKL and run a demo application. +Please refer to that for detailed instructions on how to deploy NLK and run a demo application. #### Versioning -Versioning is a work in progress. The CI/CD pipeline is being developed and will be used to build and publish NKL images to the Container Registry. +Versioning is a work in progress. The CI/CD pipeline is being developed and will be used to build and publish NLK images to the Container Registry. Once in place, semantic versioning will be used for published images. #### Deployment Steps -To get NKL up and running in ten steps or fewer, follow these instructions (NOTE, all the aforementioned prerequisites must be met for this to work). +To get NLK up and running in ten steps or fewer, follow these instructions (NOTE, all the aforementioned prerequisites must be met for this to work). There is a much more detailed [Installation Reference](docs/README.md) available in the `docs/` directory. 1. Clone this repo (optional, you can simply copy the `deployments/` directory) -```git clone git@github.com:nginxinc/nginx-k8s-loadbalancer.git``` +```git clone git@github.com:nginxinc/nginx-loadbalancer-kubernetes.git``` 2. Apply the Namespace @@ -127,14 +127,14 @@ There is a much more detailed [Installation Reference](docs/README.md) available 6. Check the logs -```kubectl -n nkl get pods | grep deployment | cut -f1 -d" " | xargs kubectl logs -n nkl --follow $1``` +```kubectl -n nlk get pods | grep deployment | cut -f1 -d" " | xargs kubectl logs -n nlk --follow $1``` -At this point NKL should be up and running. Now would be a great time to go over to the [Installation Reference](docs/README.md) +At this point NLK should be up and running. Now would be a great time to go over to the [Installation Reference](docs/README.md) and follow the instructions to deploy a demo application. ### Monitoring -Presently NKL includes a fair amount of logging. This is intended to be used for debugging purposes. +Presently NLK includes a fair amount of logging. This is intended to be used for debugging purposes. There are plans to add more robust monitoring and alerting in the future. As a rule, we support the use of [OpenTelemetry](https://opentelemetry.io/) for observability, and we will be adding support in the near future. @@ -144,23 +144,23 @@ As a rule, we support the use of [OpenTelemetry](https://opentelemetry.io/) for Presently we are not accepting pull requests. However, we welcome your feedback and suggestions. Please open an issue to let us know what you think! -One way to contribute is to help us test NKL. We are looking for people to test NKL in a variety of environments. +One way to contribute is to help us test NLK. We are looking for people to test NLK in a variety of environments. If you are curious about the implementation, you should certainly browse the code, but first you might wish to refer to the [design document](docs/DESIGN.md). Some of the design decisions are explained there. ## Roadmap -While NKL was initially written specifically for NGINX Plus, we recognize there are other load-balancers that can be supported. +While NLK was initially written specifically for NGINX Plus, we recognize there are other load-balancers that can be supported. -To this end, NKL has been architected to be extensible to support other "Border Servers". -Border Servers are the term NKL uses to describe load-balancers, reverse proxies, etc. that run outside the cluster and handle +To this end, NLK has been architected to be extensible to support other "Border Servers". +Border Servers are the term NLK uses to describe load-balancers, reverse proxies, etc. that run outside the cluster and handle routing outside traffic to your cluster. While we have identified a few potential targets, we are open to suggestions. Please open an issue to share your thoughts on potential implementations. -We look forward to building a community around NKL and value all feedback and suggestions. Varying perspectives and embracing -diverse ideas will be key to NKL becoming a solution that is useful to the community. We will consider it a success +We look forward to building a community around NLK and value all feedback and suggestions. Varying perspectives and embracing +diverse ideas will be key to NLK becoming a solution that is useful to the community. We will consider it a success when we are able to accept pull requests from the community. ## Authors @@ -171,7 +171,7 @@ when we are able to accept pull requests from the community. ## 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) © [F5, Inc.](https://www.f5.com/) 2023 diff --git a/cmd/nginx-k8s-loadbalancer/doc.go b/cmd/nginx-loadbalancer-kubernetes/doc.go similarity index 69% rename from cmd/nginx-k8s-loadbalancer/doc.go rename to cmd/nginx-loadbalancer-kubernetes/doc.go index f6c7c35..5ae90b9 100644 --- a/cmd/nginx-k8s-loadbalancer/doc.go +++ b/cmd/nginx-loadbalancer-kubernetes/doc.go @@ -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 diff --git a/cmd/nginx-k8s-loadbalancer/main.go b/cmd/nginx-loadbalancer-kubernetes/main.go similarity index 100% rename from cmd/nginx-k8s-loadbalancer/main.go rename to cmd/nginx-loadbalancer-kubernetes/main.go diff --git a/cmd/nginx-k8s-loadbalancer/main_test.go b/cmd/nginx-loadbalancer-kubernetes/main_test.go similarity index 100% rename from cmd/nginx-k8s-loadbalancer/main_test.go rename to cmd/nginx-loadbalancer-kubernetes/main_test.go diff --git a/deployments/deployment/deployment.yaml b/deployments/deployment/deployment.yaml index ec3dc2a..4c871c2 100644 --- a/deployments/deployment/deployment.yaml +++ b/deployments/deployment/deployment.yaml @@ -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 @@ -35,4 +35,4 @@ spec: port: 51031 initialDelaySeconds: 5 periodSeconds: 2 - serviceAccountName: nginx-k8s-loadbalancer + serviceAccountName: nginx-loadbalancer-kubernetes diff --git a/deployments/rbac/clusterrolebinding.yaml b/deployments/rbac/clusterrolebinding.yaml index 57e1299..d48ffb8 100644 --- a/deployments/rbac/clusterrolebinding.yaml +++ b/deployments/rbac/clusterrolebinding.yaml @@ -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 diff --git a/deployments/rbac/secret.yaml b/deployments/rbac/secret.yaml index 7b95ce0..71576bf 100644 --- a/deployments/rbac/secret.yaml +++ b/deployments/rbac/secret.yaml @@ -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 diff --git a/deployments/rbac/serviceaccount.yaml b/deployments/rbac/serviceaccount.yaml index ce262f5..76f238c 100644 --- a/deployments/rbac/serviceaccount.yaml +++ b/deployments/rbac/serviceaccount.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: nginx-k8s-loadbalancer + name: nginx-loadbalancer-kubernetes namespace: nlk diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 438be20..63f859c 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -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 @@ -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. diff --git a/docs/README.md b/docs/README.md index c9be0ef..cb79e83 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# nginx-k8s-loadbalancer +# nginx-loadbalancer-kubernetes
@@ -6,7 +6,7 @@
-![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) --- | ---
@@ -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 @@ -39,17 +39,17 @@ This repo contains source code and documents for a new `Kubernetes Controller fr
-## 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)
-## Reference Diagram for NKL TCP Load Balancer Service +## Reference Diagram for NLK TCP Load Balancer Service
-![NKL Stream Diagram](media/nkl-blog-diagram-v1.png) +![NLK Stream Diagram](media/nlk-blog-diagram-v1.png)
@@ -57,19 +57,19 @@ This repo contains source code and documents for a new `Kubernetes Controller fr
-![NGINX LB ConfigMap](media/nkl-configmap.png) +![NGINX LB ConfigMap](media/nlk-configmap.png) ### ConfigMap with 2 Nginx LB Servers defined for HA
-![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 @@ -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.
@@ -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) © [F5 Networks, Inc.](https://www.f5.com/) 2023 diff --git a/docs/http/http-installation-guide.md b/docs/http/http-installation-guide.md index dda0134..00ba4ea 100644 --- a/docs/http/http-installation-guide.md +++ b/docs/http/http-installation-guide.md @@ -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 @@ -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 diff --git a/docs/http/loadbalancer-cluster1.yaml b/docs/http/loadbalancer-cluster1.yaml index dad91d7..9aa0fe0 100644 --- a/docs/http/loadbalancer-cluster1.yaml +++ b/docs/http/loadbalancer-cluster1.yaml @@ -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 diff --git a/docs/http/loadbalancer-cluster2.yaml b/docs/http/loadbalancer-cluster2.yaml index 41022ae..85b292a 100644 --- a/docs/http/loadbalancer-cluster2.yaml +++ b/docs/http/loadbalancer-cluster2.yaml @@ -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 diff --git a/docs/tcp/tcp-installation-guide.md b/docs/tcp/tcp-installation-guide.md index 74b0687..35caf69 100644 --- a/docs/tcp/tcp-installation-guide.md +++ b/docs/tcp/tcp-installation-guide.md @@ -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 ```
@@ -191,7 +191,7 @@ etc/ ``` ``` bash -nginx-k8s-loadbalancer/ +nginx-loadbalancer-kubernetes/ └── docs/ └── tcp/ ├── loadbalancer-nlk.yaml........ LoadBalancer manifest diff --git a/go.mod b/go.mod index fc9358a..3075f62 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 @@ -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 diff --git a/go.sum b/go.sum index a4faf58..a7efba6 100644 --- a/go.sum +++ b/go.sum @@ -120,6 +120,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -137,6 +138,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -151,21 +153,25 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nginxinc/nginx-plus-go-client v0.10.0 h1:3zsMMkPvRDo8D7ZSprXtbAEW/SDmezZWzxdyS+6oAlc= github.com/nginxinc/nginx-plus-go-client v0.10.0/go.mod h1:0v3RsQCvRn/IyrMtW+DK6CNkz+PxEsXDJPjQ3yUMBF0= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -238,8 +244,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -286,15 +290,10 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -303,8 +302,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -441,6 +438,7 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -449,7 +447,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/internal/application/application_constants.go b/internal/application/application_constants.go index ae43477..0ec1826 100644 --- a/internal/application/application_constants.go +++ b/internal/application/application_constants.go @@ -10,7 +10,7 @@ package application // To use these values, add the following annotation to the Service definition: // // annotations: -// nginxinc.io/nkl-: +// nginxinc.io/nlk-: // // where is the name of the upstream in the NGINX Plus configuration and is one of the constants below. // diff --git a/internal/application/doc.go b/internal/application/doc.go index 4d24fab..34c27d0 100644 --- a/internal/application/doc.go +++ b/internal/application/doc.go @@ -25,7 +25,7 @@ Both of these implementations use the NGINX Plus client module to communicate wi Selection of the appropriate client is based on the Annotations present on the Service definition, e.g.: annotations: - nginxinc.io/nkl-: + nginxinc.io/nlk-: where is the name of the upstream in the NGINX Plus configuration and is one of the constants in application_constants.go. */ diff --git a/internal/configuration/settings.go b/internal/configuration/settings.go index cb0a36b..12c9823 100644 --- a/internal/configuration/settings.go +++ b/internal/configuration/settings.go @@ -20,15 +20,15 @@ import ( const ( // ConfigMapsNamespace is the value used to filter the ConfigMaps Resource in the Informer. - ConfigMapsNamespace = "nkl" + ConfigMapsNamespace = "nlk" // ResyncPeriod is the value used to set the resync period for the Informer. ResyncPeriod = 0 - // NklPrefix is used to determine if a Port definition should be handled and used to update a Border Server. + // NlkPrefix is used to determine if a Port definition should be handled and used to update a Border Server. // The Port name () must start with this prefix, e.g.: - // nkl- - NklPrefix = ConfigMapsNamespace + "-" + // nlk- + NlkPrefix = ConfigMapsNamespace + "-" // PortAnnotationPrefix defines the prefix used when looking up a Port in the Service Annotations. // The value of the annotation determines which BorderServer implementation will be used. @@ -38,8 +38,8 @@ const ( // WorkQueueSettings contains the configuration values needed by the Work Queues. // There are two work queues in the application: -// 1. nkl-handler queue, used to move messages between the Watcher and the Handler. -// 2. nkl-synchronizer queue, used to move message between the Handler and the Synchronizer. +// 1. nlk-handler queue, used to move messages between the Watcher and the Handler. +// 2. nlk-synchronizer queue, used to move message between the Handler and the Synchronizer. // The queues are NamedDelayingQueue objects that use an ItemExponentialFailureRateLimiter as the underlying rate limiter. type WorkQueueSettings struct { // Name is the name of the queue. @@ -134,7 +134,7 @@ func NewSettings(ctx context.Context, k8sClient *kubernetes.Clientset) (*Setting WorkQueueSettings: WorkQueueSettings{ RateLimiterBase: time.Second * 2, RateLimiterMax: time.Second * 60, - Name: "nkl-handler", + Name: "nlk-handler", }, }, Synchronizer: SynchronizerSettings{ @@ -145,7 +145,7 @@ func NewSettings(ctx context.Context, k8sClient *kubernetes.Clientset) (*Setting WorkQueueSettings: WorkQueueSettings{ RateLimiterBase: time.Second * 2, RateLimiterMax: time.Second * 60, - Name: "nkl-synchronizer", + Name: "nlk-synchronizer", }, }, Watcher: WatcherSettings{ diff --git a/internal/observation/handler.go b/internal/observation/handler.go index 2c3fb50..83601b0 100644 --- a/internal/observation/handler.go +++ b/internal/observation/handler.go @@ -29,7 +29,7 @@ type HandlerInterface interface { ShutDown() } -// Handler is responsible for processing events in the "nkl-handler" queue. +// Handler is responsible for processing events in the "nlk-handler" queue. // When processing a message the Translation module is used to translate the event into an internal representation. // The translation process may result in multiple events being generated. This fan-out mainly supports the differences // in NGINX Plus API calls for creating/updating Upstreams and deleting Upstreams. diff --git a/internal/observation/handler_test.go b/internal/observation/handler_test.go index ad43431..f4a617f 100644 --- a/internal/observation/handler_test.go +++ b/internal/observation/handler_test.go @@ -28,7 +28,7 @@ func TestHandler_AddsEventToSynchronizer(t *testing.T) { Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{ { - Name: "nkl-back", + Name: "nlk-back", }, }, }, diff --git a/internal/synchronization/synchronizer.go b/internal/synchronization/synchronizer.go index 9eab184..2f6c421 100644 --- a/internal/synchronization/synchronizer.go +++ b/internal/synchronization/synchronizer.go @@ -34,7 +34,7 @@ type Interface interface { } // Synchronizer is responsible for synchronizing the state of the Border Servers. -// Operating against the "nkl-synchronizer", it handles events by creating a Border Client as specified in the +// Operating against the "nlk-synchronizer", it handles events by creating a Border Client as specified in the // Service annotation for the Upstream. see application/border_client.go and application/application_constants.go for details. type Synchronizer struct { eventQueue workqueue.RateLimitingInterface @@ -100,7 +100,7 @@ func (s *Synchronizer) ShutDown() { } // buildBorderClient creates a Border Client for the specified event. -// NOTE: There is an open issue (https://github.com/nginxinc/nginx-k8s-loadbalancer/issues/36) to move creation +// NOTE: There is an open issue (https://github.com/nginxinc/nginx-loadbalancer-kubernetes/issues/36) to move creation // of the underlying Border Server client to the NewBorderClient function. func (s *Synchronizer) buildBorderClient(event *core.ServerUpdateEvent) (application.Interface, error) { logrus.Debugf(`Synchronizer::buildBorderClient`) diff --git a/internal/translation/translator.go b/internal/translation/translator.go index a858cad..b2d0e87 100644 --- a/internal/translation/translator.go +++ b/internal/translation/translator.go @@ -25,12 +25,12 @@ func Translate(event *core.Event) (core.ServerUpdateEvents, error) { return buildServerUpdateEvents(portsOfInterest, event) } -// filterPorts returns a list of ports that have the NklPrefix in the port name. +// filterPorts returns a list of ports that have the NlkPrefix in the port name. func filterPorts(ports []v1.ServicePort) []v1.ServicePort { var portsOfInterest []v1.ServicePort for _, port := range ports { - if strings.HasPrefix(port.Name, configuration.NklPrefix) { + if strings.HasPrefix(port.Name, configuration.NlkPrefix) { portsOfInterest = append(portsOfInterest, port) } } @@ -84,7 +84,7 @@ func buildUpstreamServers(nodeIps []string, port v1.ServicePort) (core.UpstreamS return servers, nil } -// fixIngressName removes the NklPrefix from the port name +// fixIngressName removes the NlkPrefix from the port name func fixIngressName(name string) string { return name[4:] } diff --git a/internal/translation/translator_test.go b/internal/translation/translator_test.go index 4e635d6..2acfd34 100644 --- a/internal/translation/translator_test.go +++ b/internal/translation/translator_test.go @@ -655,7 +655,7 @@ func generateUpdatablePorts(portCount int, updatableCount int) []v1.ServicePort nonupdatable := make([]string, portCount-updatableCount) for i := range updatable { - updatable[i] = configuration.NklPrefix + updatable[i] = configuration.NlkPrefix } for j := range nonupdatable { diff --git a/nkl-logo.svg b/nlk-logo.svg similarity index 99% rename from nkl-logo.svg rename to nlk-logo.svg index 22fb582..fe4488c 100644 --- a/nkl-logo.svg +++ b/nlk-logo.svg @@ -1,11 +1,11 @@