Skip to content

Commit 8efdfc8

Browse files
authored
NGINX Plus R33 support (#2760) (#2783)
Adding support for NGINX Plus R33. The major change with this release is that NGINX Plus now requires a JWT in order to run. A user must create a Secret with this JWT and supply the secret name to NGF when installing. A user can also create client SSL and CA Secrets for NIM connections. All of these Secrets are mounted to the nginx container. Because of the new usage reporting method, the old usage reporting method has been removed and CLI arguments have been altered. Since this release is a breaking change for N+ users, the choice was made to remove the unused usage reporting flags instead of deprecating them. Updated documentation to describe this process, while also cleaning up the JWT docker registry process for N+.
1 parent 1f60f9e commit 8efdfc8

File tree

83 files changed

+2191
-2078
lines changed

Some content is hidden

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

83 files changed

+2191
-2078
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ jobs:
238238
with:
239239
image: ${{ matrix.image }}
240240
k8s-version: ${{ matrix.k8s-version }}
241+
secrets: inherit
241242
permissions:
242243
contents: read
243244

@@ -259,6 +260,7 @@ jobs:
259260
image: ${{ matrix.image }}
260261
k8s-version: ${{ matrix.k8s-version }}
261262
enable-experimental: ${{ matrix.enable-experimental }}
263+
secrets: inherit
262264
permissions:
263265
contents: write
264266

.github/workflows/conformance.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ jobs:
135135
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }}
136136
kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }}
137137
138+
- name: Setup license file for plus
139+
if: ${{ inputs.image == 'plus' }}
140+
env:
141+
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REGISTRY }}
142+
run: echo "${PLUS_LICENSE}" > license.jwt
143+
138144
- name: Setup conformance tests
139145
run: |
140146
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric

.github/workflows/functional.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ jobs:
100100
NGINX_CONF_DIR=internal/mode/static/nginx/conf
101101
BUILD_AGENT=gha
102102
103+
- name: Setup license file for plus
104+
if: ${{ inputs.image == 'plus' }}
105+
env:
106+
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REGISTRY }}
107+
run: echo "${PLUS_LICENSE}" > license.jwt
108+
103109
- name: Install cloud-provider-kind
104110
run: |
105111
CLOUD_PROVIDER_KIND_VERSION=v0.4.0 # renovate: datasource=github-tags depName=kubernetes-sigs/cloud-provider-kind

.github/workflows/helm.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ jobs:
9898
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }}
9999
kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }}
100100
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
101+
kubectl create namespace nginx-gateway
102+
103+
- name: Create plus secret
104+
if: ${{ inputs.image == 'plus' }}
105+
env:
106+
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REGISTRY }}
107+
run: |
108+
echo "${PLUS_LICENSE}" > license.jwt
109+
kubectl create secret generic nplus-license --from-file license.jwt -n nginx-gateway
101110
102111
- name: Set up Python
103112
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
@@ -110,7 +119,7 @@ jobs:
110119

111120
- name: Install Chart
112121
run: |
113-
ct install --config .ct.yaml --helm-extra-set-args="--set=nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }} \
122+
ct install --config .ct.yaml --namespace nginx-gateway --helm-extra-set-args="--set=nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }} \
114123
--set=nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx${{ inputs.image == 'plus' && '-plus' || ''}} \
115124
--set=nginx.plus=${{ inputs.image == 'plus' }} \
116125
--set=nginx.image.tag=${{ steps.nginx-meta.outputs.version }} \
@@ -143,10 +152,14 @@ jobs:
143152
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
144153
kubectl create namespace nginx-gateway
145154
146-
- name: Create k8s secret
155+
- name: Create plus secrets
147156
if: ${{ inputs.image == 'plus' }}
157+
env:
158+
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REGISTRY }}
148159
run: |
160+
echo "${PLUS_LICENSE}" > license.jwt
149161
kubectl create secret docker-registry nginx-plus-registry-secret --docker-server=private-registry.nginx.com --docker-username=${{ secrets.JWT_PLUS_REGISTRY }} --docker-password=none -n nginx-gateway
162+
kubectl create secret generic nplus-license --from-file license.jwt -n nginx-gateway
150163
151164
- name: Set up Python
152165
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0

.github/workflows/nfr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ jobs:
111111
echo "GKE_NUM_NODES=12" >> vars.env
112112
echo "GKE_MACHINE_TYPE=n2d-standard-16" >> vars.env
113113
114+
- name: Setup license file for plus
115+
if: matrix.type == 'plus'
116+
env:
117+
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REGISTRY }}
118+
run: echo "${PLUS_LICENSE}" > license.jwt
119+
114120
- name: Create GKE cluster
115121
working-directory: ./tests
116122
run: make create-gke-cluster CI=true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ internal/mode/static/nginx/modules/coverage
4646
*.crt
4747
*.key
4848

49+
# JWT files
50+
*.jwt
51+
4952
# Dotenv files
5053
**/*.env
5154

.hugo_build.lock

Whitespace-only changes.

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ignore:
33
- charts/nginx-gateway-fabric/templates
44
- config/crd/bases/
55
- deploy/crds.yaml
6+
- deploy/*nginx-plus
67
- site/static
78

89
rules:

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# variables that should not be overridden by the user
22
VERSION = edge
3-
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
3+
SELF_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
44
CHART_DIR = $(SELF_DIR)charts/nginx-gateway-fabric
55
NGINX_CONF_DIR = internal/mode/static/nginx/conf
66
NJS_DIR = internal/mode/static/nginx/modules/src
77
KIND_CONFIG_FILE = $(SELF_DIR)config/cluster/kind-cluster.yaml
8-
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key
9-
BUILD_AGENT=local
10-
PLUS_ENABLED ?= false
8+
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=$(SELF_DIR)nginx-repo.crt --secret id=nginx-repo.key,src=$(SELF_DIR)nginx-repo.key
9+
BUILD_AGENT = local
1110

1211
PROD_TELEMETRY_ENDPOINT = oss.edge.df.f5.com:443
1312
# the telemetry related variables below are also configured in goreleaser.yml
@@ -49,6 +48,8 @@ TARGET ?= local## The target of the build. Possible values: local and container
4948
OUT_DIR ?= build/out## The folder where the binary will be stored
5049
GOARCH ?= amd64## The architecture of the image and/or binary. For example: amd64 or arm64
5150
GOOS ?= linux## The OS of the image and/or binary. For example: linux or darwin
51+
PLUS_ENABLED ?= false
52+
PLUS_LICENSE_FILE ?= $(SELF_DIR)license.jwt
5253
override NGINX_DOCKER_BUILD_OPTIONS += --build-arg NJS_DIR=$(NJS_DIR) --build-arg NGINX_CONF_DIR=$(NGINX_CONF_DIR) --build-arg BUILD_AGENT=$(BUILD_AGENT)
5354

5455
.DEFAULT_GOAL := help
@@ -227,7 +228,9 @@ helm-install-local: install-gateway-crds ## Helm install NGF on configured kind
227228

228229
.PHONY: helm-install-local-with-plus
229230
helm-install-local-with-plus: 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.
230-
helm install nginx-gateway $(CHART_DIR) --set nginx.image.repository=$(NGINX_PLUS_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 --set nginx.plus=true $(HELM_PARAMETERS)
231+
kubectl create namespace nginx-gateway || true
232+
kubectl -n nginx-gateway create secret generic nplus-license --from-file $(PLUS_LICENSE_FILE) || true
233+
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 $(HELM_PARAMETERS)
231234

232235
# Debug Targets
233236
.PHONY: debug-build

build/Dockerfile.nginx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG NGINX_CONF_DIR
66
ARG BUILD_AGENT
77

88
RUN apk add --no-cache libcap \
9-
&& mkdir -p /var/lib/nginx /usr/lib/nginx/modules \
9+
&& mkdir -p /usr/lib/nginx/modules \
1010
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
1111
&& setcap -v 'cap_net_bind_service=+ep' /usr/sbin/nginx \
1212
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
@@ -18,7 +18,7 @@ COPY ${NGINX_CONF_DIR}/nginx.conf /etc/nginx/nginx.conf
1818
COPY ${NGINX_CONF_DIR}/grpc-error-locations.conf /etc/nginx/grpc-error-locations.conf
1919
COPY ${NGINX_CONF_DIR}/grpc-error-pages.conf /etc/nginx/grpc-error-pages.conf
2020

21-
RUN chown -R 101:1001 /etc/nginx /var/cache/nginx /var/lib/nginx
21+
RUN chown -R 101:1001 /etc/nginx /var/cache/nginx
2222

2323
LABEL org.nginx.ngf.image.build.agent="${BUILD_AGENT}"
2424

0 commit comments

Comments
 (0)