Skip to content

Commit 621ec00

Browse files
sjbermankate-osbornbjee19salonichf5
authored
Separate control plane and data plane; support multiple Gateways (#3318)
As a route to efficacy and quickly understanding the Gateway API, its implementation and alignment to NGINX as a data plane, we decided on a simplified, but rigid, deployment pattern. To improve our security posture and installation flexibility the control and data planes are being separated as semi-autonomous, distributed components. This also allows us to support multiple Gateways for a single control plane. A general summary of the changes being made: - control plane and data plane are now in separate Deployments - installing NGF just installs the control plane - when a Gateway resource is created, the control plane provisions an nginx data plane deployment and service - the NginxProxy CRD resource can now be set at the Gateway level, and has been enhanced to include all deployment/service infrastructure-related fields, such as replicas, loadBalancerIP, serviceType, etc. - these fields can be configured globally at installation time in the helm chart, or set on an individual basis per Gateway - updating these fields directly on a provisioned nginx Deployment or Service will not take effect - this does not apply to the control plane Deployment - labels/annotations for the NGINX deployment or service can be set in the Gateway's Infrastructure section - the NGINX pod uses the NGINX agent (currently an unofficial, unreleased version) to update NGINX configuration - control plane communicates with the NGINX agent over a secure gRPC connection, using self-signed certs by default, created at installation time. Cert-manager can be used instead. - multiple Gateways is now supported --------- Co-authored-by: Kate Osborn <[email protected]> Co-authored-by: bjee19 <[email protected]> Co-authored-by: salonichf5 <[email protected]> Co-authored-by: Benjamin Jee <[email protected]>
1 parent 7bce264 commit 621ec00

File tree

289 files changed

+35769
-16508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+35769
-16508
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ A clear and concise description of what you expected to happen.
2424
* Version of Kubernetes
2525
* Kubernetes platform (e.g. Mini-kube or GCP)
2626
* Details on how you expose the NGINX Gateway Fabric Pod (e.g. Service of type LoadBalancer or port-forward)
27-
* Logs of NGINX container: `kubectl -n nginx-gateway logs -l app=nginx-gateway -c nginx`
28-
* NGINX Configuration: `kubectl -n nginx-gateway exec <gateway-pod> -c nginx -- nginx -T`
27+
* Logs of NGINX container: `kubectl -n <nginx-deployment-namespace> logs deployments/<nginx-deployment>`
28+
* NGINX Configuration: `kubectl -n <nginx-deployment-namespace> exec -it deployments/<nginx-deployment> -- nginx -T`
2929

3030
**Additional context**
3131
Add any other context about the problem here. Any log files you want to share.

.github/workflows/conformance.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ jobs:
7676
type=ref,event=pr
7777
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
7878
79-
- name: Generate static deployment
80-
run: |
81-
ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric
82-
ngf_tag=${{ steps.ngf-meta.outputs.version }}
83-
make generate-static-deployment PLUS_ENABLED=${{ inputs.image == 'plus' && 'true' || 'false' }} PREFIX=${ngf_prefix} TAG=${ngf_tag}
84-
working-directory: ./tests
85-
8679
- name: Build binary
8780
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
8881
with:
@@ -151,7 +144,6 @@ jobs:
151144
ngf_tag=${{ steps.ngf-meta.outputs.version }}
152145
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
153146
make helm-install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
154-
make deploy-updated-provisioner PREFIX=${ngf_prefix} TAG=${ngf_tag}
155147
working-directory: ./tests
156148

157149
- name: Run conformance tests

.github/workflows/helm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,4 @@ jobs:
176176
--set=nginx.plus=${{ inputs.image == 'plus' }} \
177177
--set=nginx.image.tag=nightly \
178178
--set=nginxGateway.productTelemetry.enable=false \
179-
${{ inputs.image == 'plus' && '--set=serviceAccount.imagePullSecret=nginx-plus-registry-secret --set=nginx.image.repository=private-registry.nginx.com/nginx-gateway-fabric/nginx-plus' || '' }}"
179+
${{ inputs.image == 'plus' && '--set=nginx.imagePullSecret=nginx-plus-registry-secret --set=nginx.image.repository=private-registry.nginx.com/nginx-gateway-fabric/nginx-plus' || '' }}"

.github/workflows/nfr.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ jobs:
9292
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY }}
9393
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
9494

95+
- name: Login to GAR
96+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
97+
with:
98+
registry: us-docker.pkg.dev
99+
username: oauth2accesstoken
100+
password: ${{ steps.auth.outputs.access_token }}
101+
95102
- name: Set up Cloud SDK
96103
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
97104
with:

.yamllint.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
ignore:
33
- charts/nginx-gateway-fabric/templates
44
- config/crd/bases/
5-
- deploy/crds.yaml
6-
- deploy/*nginx-plus
5+
- deploy
76
- site/static
87

98
rules:
@@ -15,7 +14,9 @@ rules:
1514
require-starting-space: true
1615
ignore-shebangs: true
1716
min-spaces-from-content: 1
18-
comments-indentation: enable
17+
comments-indentation:
18+
ignore: |
19+
charts/nginx-gateway-fabric/values.yaml
1920
document-end: disable
2021
document-start: disable
2122
empty-lines: enable

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ install-ngf-local-build-with-plus: check-for-plus-usage-endpoint build-images-wi
226226

227227
.PHONY: helm-install-local
228228
helm-install-local: install-gateway-crds ## Helm install NGF on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build.
229-
helm install nginx-gateway $(CHART_DIR) --set nginx.image.repository=$(NGINX_PREFIX) --create-namespace --wait --set nginxGateway.image.pullPolicy=Never --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway $(HELM_PARAMETERS)
229+
helm install nginx-gateway $(CHART_DIR) --set nginx.image.repository=$(NGINX_PREFIX) --create-namespace --wait --set nginxGateway.image.pullPolicy=Never --set nginx.service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway $(HELM_PARAMETERS)
230230

231231
.PHONY: helm-install-local-with-plus
232232
helm-install-local-with-plus: check-for-plus-usage-endpoint install-gateway-crds ## Helm install NGF with NGINX Plus on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build-with-plus.
233233
kubectl create namespace nginx-gateway || true
234234
kubectl -n nginx-gateway create secret generic nplus-license --from-file $(PLUS_LICENSE_FILE) || true
235-
helm install nginx-gateway $(CHART_DIR) --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --wait --set nginxGateway.image.pullPolicy=Never --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway --set nginx.plus=true --set nginx.usage.endpoint=$(PLUS_USAGE_ENDPOINT) $(HELM_PARAMETERS)
235+
helm install nginx-gateway $(CHART_DIR) --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --wait --set nginxGateway.image.pullPolicy=Never --set nginx.service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway --set nginx.plus=true --set nginx.usage.endpoint=$(PLUS_USAGE_ENDPOINT) $(HELM_PARAMETERS)
236236

237237
.PHONY: check-for-plus-usage-endpoint
238238
check-for-plus-usage-endpoint: ## Checks that the PLUS_USAGE_ENDPOINT is set in the environment. This env var is required when deploying or testing with N+.

apis/v1alpha1/nginxproxy_types.go

Lines changed: 0 additions & 282 deletions
This file was deleted.

apis/v1alpha1/register.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
3434
scheme.AddKnownTypes(SchemeGroupVersion,
3535
&NginxGateway{},
3636
&NginxGatewayList{},
37-
&NginxProxy{},
38-
&NginxProxyList{},
3937
&ObservabilityPolicy{},
4038
&ObservabilityPolicyList{},
4139
&ClientSettingsPolicy{},

0 commit comments

Comments
 (0)