Skip to content

Commit df8541b

Browse files
authored
Merge branch 'main' into tests/cel-clientsettingspolicies-timeout
2 parents 7862dfa + 1dd7381 commit df8541b

31 files changed

+1486
-407
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
platforms: arm64
5757

5858
- name: Login to GitHub Container Registry
59-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
59+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
6060
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
6161
with:
6262
registry: ghcr.io
@@ -73,7 +73,7 @@ jobs:
7373
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus')}}
7474

7575
- name: Login to NGINX Registry
76-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
76+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
7777
with:
7878
registry: docker-mgmt.nginx.com
7979
username: ${{ steps.idtoken.outputs.id_token }}
@@ -90,7 +90,7 @@ jobs:
9090
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus') }}
9191

9292
- name: Login to GAR
93-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
93+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
9494
with:
9595
registry: us-docker.pkg.dev
9696
username: oauth2accesstoken
@@ -163,7 +163,7 @@ jobs:
163163
164164
- name: Scan SBOM
165165
id: scan
166-
uses: anchore/scan-action@df395807f4554463d4455b8047cf58e37b6acaae # v6.5.0
166+
uses: anchore/scan-action@1638637db639e0ade3258b51db49a9a137574c3e # v6.5.1
167167
with:
168168
sbom: "sbom-${{ inputs.image }}.json"
169169
only-fixed: true

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
297297

298298
- name: Login to GitHub Container Registry
299-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
299+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
300300
with:
301301
registry: ghcr.io
302302
username: ${{ github.repository_owner }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7979

8080
- name: Lint Actions
81-
uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
81+
uses: reviewdog/action-actionlint@50b75b9513baa71e6a1899a1ebaa9ac9851cf16c # v1.66.0
8282
with:
8383
actionlint_flags: -shellcheck ""
8484

.github/workflows/nfr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
9494

9595
- name: Login to GAR
96-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
96+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
9797
with:
9898
registry: us-docker.pkg.dev
9999
username: oauth2accesstoken
@@ -184,7 +184,7 @@ jobs:
184184
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
185185

186186
- name: Download Artifacts
187-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
187+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
188188
with:
189189
path: tests/results/
190190
merge-multiple: true

.github/workflows/update-docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
needs-updating: ${{ steps.update.outputs.needs-updating }}
6060
steps:
6161
- name: Login to GitHub Container Registry
62-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
62+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
6363
with:
6464
registry: ghcr.io
6565
username: ${{ github.repository_owner }}

charts/nginx-gateway-fabric/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
264264
| `certGenerator.ttlSecondsAfterFinished` | How long to wait after the cert generator job has finished before it is removed by the job controller. | int | `30` |
265265
| `clusterDomain` | The DNS cluster domain of your Kubernetes cluster. | string | `"cluster.local"` |
266266
| `gateways` | A list of Gateway objects. View https://gateway-api.sigs.k8s.io/reference/spec/#gateway for full Gateway reference. | list | `[]` |
267-
| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{"hostPorts":[],"lifecycle":{},"readinessProbe":{},"resources":{},"volumeMounts":[]},"debug":false,"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","loadBalancerClass":"","loadBalancerIP":"","loadBalancerSourceRanges":[],"nodePorts":[],"type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` |
267+
| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{"hostPorts":[],"lifecycle":{},"readinessProbe":{},"resources":{},"volumeMounts":[]},"debug":false,"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","nginxOneConsole":{"dataplaneKeySecretName":"","endpointHost":"agent.connect.nginx.com","endpointPort":443,"skipVerify":false},"plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","loadBalancerClass":"","loadBalancerIP":"","loadBalancerSourceRanges":[],"nodePorts":[],"type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` |
268268
| `nginx.config` | The configuration for the data plane that is contained in the NginxProxy resource. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | `{}` |
269269
| `nginx.container` | The container configuration for the NGINX container. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | `{"hostPorts":[],"lifecycle":{},"readinessProbe":{},"resources":{},"volumeMounts":[]}` |
270270
| `nginx.container.hostPorts` | A list of HostPorts to expose on the host. This configuration allows containers to bind to a specific port on the host node, enabling external network traffic to reach the container directly through the host's IP address and port. Use this option when you need to expose container ports on the host for direct access, such as for debugging, legacy integrations, or when NodePort/LoadBalancer services are not suitable. Note: Using hostPort may have security and scheduling implications, as it ties pods to specific nodes and ports. | list | `[]` |
@@ -276,6 +276,11 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
276276
| `nginx.imagePullSecret` | The name of the secret containing docker registry credentials. Secret must exist in the same namespace as the helm release. The control plane will copy this secret into any namespace where NGINX is deployed. | string | `""` |
277277
| `nginx.imagePullSecrets` | A list of secret names containing docker registry credentials. Secrets must exist in the same namespace as the helm release. The control plane will copy these secrets into any namespace where NGINX is deployed. | list | `[]` |
278278
| `nginx.kind` | The kind of NGINX deployment. | string | `"deployment"` |
279+
| `nginx.nginxOneConsole` | Configuration for NGINX One Console. | object | `{"dataplaneKeySecretName":"","endpointHost":"agent.connect.nginx.com","endpointPort":443,"skipVerify":false}` |
280+
| `nginx.nginxOneConsole.dataplaneKeySecretName` | Name of the secret which holds the dataplane key that is required to authenticate with the NGINX One Console. Secret must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `""` |
281+
| `nginx.nginxOneConsole.endpointHost` | The Endpoint host that the NGINX One Console telemetry metrics will be sent to. | string | `"agent.connect.nginx.com"` |
282+
| `nginx.nginxOneConsole.endpointPort` | The endpoint port that the NGINX One Console telemetry metrics will be sent to. | int | `443` |
283+
| `nginx.nginxOneConsole.skipVerify` | Skip TLS verification for NGINX One Console connections. | bool | `false` |
279284
| `nginx.plus` | Is NGINX Plus image being used. | bool | `false` |
280285
| `nginx.pod` | The pod configuration for the NGINX data plane pod. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | `{}` |
281286
| `nginx.replicas` | The number of replicas of the NGINX Deployment. | int | `1` |

charts/nginx-gateway-fabric/templates/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ spec:
103103
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints" }}
104104
- --nginx-scc={{ include "nginx-gateway.scc-name" . }}-nginx
105105
{{- end}}
106+
{{- if .Values.nginx.nginxOneConsole.dataplaneKeySecretName }}
107+
- --nginx-one-dataplane-key-secret={{ .Values.nginx.nginxOneConsole.dataplaneKeySecretName }}
108+
{{- if .Values.nginx.nginxOneConsole.endpointHost }}
109+
- --nginx-one-telemetry-endpoint-host={{ .Values.nginx.nginxOneConsole.endpointHost }}
110+
{{- end }}
111+
{{- if .Values.nginx.nginxOneConsole.endpointPort }}
112+
- --nginx-one-telemetry-endpoint-port={{ .Values.nginx.nginxOneConsole.endpointPort }}
113+
{{- end }}
114+
{{- if .Values.nginx.nginxOneConsole.skipVerify }}
115+
- --nginx-one-tls-skip-verify
116+
{{- end }}
117+
{{- end }}
106118
env:
107119
- name: POD_NAMESPACE
108120
valueFrom:

charts/nginx-gateway-fabric/values.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,44 @@
445445
"required": [],
446446
"title": "kind"
447447
},
448+
"nginxOneConsole": {
449+
"description": "Configuration for NGINX One Console.",
450+
"properties": {
451+
"dataplaneKeySecretName": {
452+
"default": "",
453+
"description": "Name of the secret which holds the dataplane key that is required to authenticate with the NGINX One Console.\nSecret must exist in the same namespace that the NGINX Gateway Fabric control plane is running in\n(default namespace: nginx-gateway).",
454+
"required": [],
455+
"title": "dataplaneKeySecretName",
456+
"type": "string"
457+
},
458+
"endpointHost": {
459+
"default": "agent.connect.nginx.com",
460+
"description": "The Endpoint host that the NGINX One Console telemetry metrics will be sent to.",
461+
"required": [],
462+
"title": "endpointHost",
463+
"type": "string"
464+
},
465+
"endpointPort": {
466+
"default": 443,
467+
"description": "The endpoint port that the NGINX One Console telemetry metrics will be sent to.",
468+
"maximum": 65535,
469+
"minimum": 1,
470+
"required": [],
471+
"title": "endpointPort",
472+
"type": "integer"
473+
},
474+
"skipVerify": {
475+
"default": false,
476+
"description": "Skip TLS verification for NGINX One Console connections.",
477+
"required": [],
478+
"title": "skipVerify",
479+
"type": "boolean"
480+
}
481+
},
482+
"required": [],
483+
"title": "nginxOneConsole",
484+
"type": "object"
485+
},
448486
"plus": {
449487
"default": false,
450488
"description": "Is NGINX Plus image being used.",

charts/nginx-gateway-fabric/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,27 @@ nginx:
212212
# -- Is NGINX Plus image being used.
213213
plus: false
214214

215+
# -- Configuration for NGINX One Console.
216+
nginxOneConsole:
217+
# -- Name of the secret which holds the dataplane key that is required to authenticate with the NGINX One Console.
218+
# Secret must exist in the same namespace that the NGINX Gateway Fabric control plane is running in
219+
# (default namespace: nginx-gateway).
220+
dataplaneKeySecretName: ""
221+
222+
# -- The Endpoint host that the NGINX One Console telemetry metrics will be sent to.
223+
endpointHost: "agent.connect.nginx.com"
224+
225+
# @schema
226+
# type: integer
227+
# minimum: 1
228+
# maximum: 65535
229+
# @schema
230+
# -- The endpoint port that the NGINX One Console telemetry metrics will be sent to.
231+
endpointPort: 443
232+
233+
# -- Skip TLS verification for NGINX One Console connections.
234+
skipVerify: false
235+
215236
# -- The name of the secret containing docker registry credentials.
216237
# Secret must exist in the same namespace as the helm release. The control
217238
# plane will copy this secret into any namespace where NGINX is deployed.

cmd/gateway/commands.go

Lines changed: 74 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"os"
77
"runtime/debug"
88
"strconv"
9-
"strings"
109
"time"
1110

1211
"github.com/spf13/cobra"
@@ -38,8 +37,9 @@ const (
3837
`The controller name must be of the form: DOMAIN/PATH. The controller's domain is '%s'`
3938
plusFlag = "nginx-plus"
4039

41-
serverTLSSecret = "server-tls"
42-
agentTLSSecret = "agent-tls"
40+
serverTLSSecret = "server-tls"
41+
agentTLSSecret = "agent-tls"
42+
nginxOneTelemetryEndpointHost = "agent.connect.nginx.com"
4343
)
4444

4545
func createRootCommand() *cobra.Command {
@@ -58,27 +58,31 @@ func createRootCommand() *cobra.Command {
5858
func createControllerCommand() *cobra.Command {
5959
// flag names
6060
const (
61-
configFlag = "config"
62-
serviceFlag = "service"
63-
agentTLSSecretFlag = "agent-tls-secret"
64-
metricsDisableFlag = "metrics-disable"
65-
metricsSecureFlag = "metrics-secure-serving"
66-
metricsPortFlag = "metrics-port"
67-
healthDisableFlag = "health-disable"
68-
healthPortFlag = "health-port"
69-
leaderElectionDisableFlag = "leader-election-disable"
70-
leaderElectionLockNameFlag = "leader-election-lock-name"
71-
productTelemetryDisableFlag = "product-telemetry-disable"
72-
gwAPIExperimentalFlag = "gateway-api-experimental-features"
73-
nginxDockerSecretFlag = "nginx-docker-secret" //nolint:gosec // not credentials
74-
usageReportSecretFlag = "usage-report-secret"
75-
usageReportEndpointFlag = "usage-report-endpoint"
76-
usageReportResolverFlag = "usage-report-resolver"
77-
usageReportSkipVerifyFlag = "usage-report-skip-verify"
78-
usageReportClientSSLSecretFlag = "usage-report-client-ssl-secret" //nolint:gosec // not credentials
79-
usageReportCASecretFlag = "usage-report-ca-secret" //nolint:gosec // not credentials
80-
snippetsFiltersFlag = "snippets-filters"
81-
nginxSCCFlag = "nginx-scc"
61+
configFlag = "config"
62+
serviceFlag = "service"
63+
agentTLSSecretFlag = "agent-tls-secret"
64+
nginxOneDataplaneKeySecretFlag = "nginx-one-dataplane-key-secret" //nolint:gosec // not credentials
65+
nginxOneTelemetryEndpointHostFlag = "nginx-one-telemetry-endpoint-host"
66+
nginxOneTelemetryEndpointPortFlag = "nginx-one-telemetry-endpoint-port"
67+
nginxOneTLSSkipVerifyFlag = "nginx-one-tls-skip-verify"
68+
metricsDisableFlag = "metrics-disable"
69+
metricsSecureFlag = "metrics-secure-serving"
70+
metricsPortFlag = "metrics-port"
71+
healthDisableFlag = "health-disable"
72+
healthPortFlag = "health-port"
73+
leaderElectionDisableFlag = "leader-election-disable"
74+
leaderElectionLockNameFlag = "leader-election-lock-name"
75+
productTelemetryDisableFlag = "product-telemetry-disable"
76+
gwAPIExperimentalFlag = "gateway-api-experimental-features"
77+
nginxDockerSecretFlag = "nginx-docker-secret" //nolint:gosec // not credentials
78+
usageReportSecretFlag = "usage-report-secret"
79+
usageReportEndpointFlag = "usage-report-endpoint"
80+
usageReportResolverFlag = "usage-report-resolver"
81+
usageReportSkipVerifyFlag = "usage-report-skip-verify"
82+
usageReportClientSSLSecretFlag = "usage-report-client-ssl-secret" //nolint:gosec // not credentials
83+
usageReportCASecretFlag = "usage-report-ca-secret" //nolint:gosec // not credentials
84+
snippetsFiltersFlag = "snippets-filters"
85+
nginxSCCFlag = "nginx-scc"
8286
)
8387

8488
// flag values
@@ -101,7 +105,19 @@ func createControllerCommand() *cobra.Command {
101105
validator: validateResourceName,
102106
value: agentTLSSecret,
103107
}
104-
nginxSCCName = stringValidatingValue{
108+
nginxOneConsoleDataplaneKeySecretName = stringValidatingValue{
109+
validator: validateResourceName,
110+
}
111+
nginxOneConsoleTelemetryEndpointHost = stringValidatingValue{
112+
validator: validateResourceName,
113+
value: nginxOneTelemetryEndpointHost,
114+
}
115+
nginxOneConsoleTelemetryEndpointPort = intValidatingValue{
116+
validator: validateAnyPort,
117+
value: 443,
118+
}
119+
nginxOneConsoleTLSSkipVerify bool
120+
nginxSCCName = stringValidatingValue{
105121
validator: validateResourceName,
106122
}
107123
disableMetrics bool
@@ -257,6 +273,12 @@ func createControllerCommand() *cobra.Command {
257273
NginxDockerSecretNames: nginxDockerSecrets.values,
258274
AgentTLSSecretName: agentTLSSecretName.value,
259275
NGINXSCCName: nginxSCCName.value,
276+
NginxOneConsoleTelemetryConfig: config.NginxOneConsoleTelemetryConfig{
277+
DataplaneKeySecretName: nginxOneConsoleDataplaneKeySecretName.value,
278+
EndpointHost: nginxOneConsoleTelemetryEndpointHost.value,
279+
EndpointPort: nginxOneConsoleTelemetryEndpointPort.value,
280+
EndpointTLSSkipVerify: nginxOneConsoleTLSSkipVerify,
281+
},
260282
}
261283

262284
if err := controller.StartManager(conf); err != nil {
@@ -304,6 +326,32 @@ func createControllerCommand() *cobra.Command {
304326
`NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway).`,
305327
)
306328

329+
cmd.Flags().Var(
330+
&nginxOneConsoleDataplaneKeySecretName,
331+
nginxOneDataplaneKeySecretFlag,
332+
`The name of the Secret containing the NGINX One Console's dataplane key. Must exist in the same namespace that `+
333+
`the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway).`,
334+
)
335+
336+
cmd.Flags().Var(
337+
&nginxOneConsoleTelemetryEndpointHost,
338+
nginxOneTelemetryEndpointHostFlag,
339+
`The host of the NGINX One Console's telemetry endpoint.`,
340+
)
341+
342+
cmd.Flags().Var(
343+
&nginxOneConsoleTelemetryEndpointPort,
344+
nginxOneTelemetryEndpointPortFlag,
345+
`The port of the NGINX One Console's telemetry endpoint.`,
346+
)
347+
348+
cmd.Flags().BoolVar(
349+
&nginxOneConsoleTLSSkipVerify,
350+
nginxOneTLSSkipVerifyFlag,
351+
false,
352+
"Disable client verification of the NGINX One Console's telemetry endpoint server certificate.",
353+
)
354+
307355
cmd.Flags().BoolVar(
308356
&disableMetrics,
309357
metricsDisableFlag,
@@ -741,19 +789,13 @@ func createGatewayPodConfig(version, svcName string) (config.GatewayPodConfig, e
741789
return config.GatewayPodConfig{}, err
742790
}
743791

744-
// use image tag version if set, otherwise fall back to binary version
745-
ngfVersion := version
746-
if imageParts := strings.Split(image, ":"); len(imageParts) == 2 {
747-
ngfVersion = imageParts[1]
748-
}
749-
750792
c := config.GatewayPodConfig{
751793
ServiceName: svcName,
752794
Namespace: ns,
753795
Name: name,
754796
UID: podUID,
755797
InstanceName: instance,
756-
Version: ngfVersion,
798+
Version: version,
757799
Image: image,
758800
}
759801

0 commit comments

Comments
 (0)