Skip to content

Commit a883fe6

Browse files
committed
update based on reviews
1 parent 634c7a7 commit a883fe6

File tree

12 files changed

+147
-90
lines changed

12 files changed

+147
-90
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
245245
| `nginx.usage.resolver` | The nameserver used to resolve the NGINX Plus usage reporting endpoint. Used with NGINX Instance Manager. | string | `""` |
246246
| `nginx.usage.secretName` | The name of the Secret containing the JWT for NGINX Plus usage reporting. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `"nplus-license"` |
247247
| `nginx.usage.skipVerify` | Disable client verification of the NGINX Plus usage reporting server certificate. | bool | `false` |
248-
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"autoscaling":{"enable":false},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"gwAPIInferenceExtension":{"enable":false},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"name":"","nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{},"labels":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
248+
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"autoscaling":{"enable":false},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"gwAPIInferenceExtension":{"enable":false,"endpointPicker":{"disableTLS":false,"enableSecureVerify":false}},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"name":"","nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{},"labels":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
249249
| `nginxGateway.affinity` | The affinity of the NGINX Gateway Fabric control plane pod. | object | `{}` |
250250
| `nginxGateway.autoscaling` | Autoscaling configuration for the NGINX Gateway Fabric control plane. | object | `{"enable":false}` |
251251
| `nginxGateway.autoscaling.enable` | Enable or disable Horizontal Pod Autoscaler for the control plane. | bool | `false` |
@@ -258,6 +258,9 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
258258
| `nginxGateway.gatewayControllerName` | The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is gateway.nginx.org. | string | `"gateway.nginx.org/nginx-gateway-controller"` |
259259
| `nginxGateway.gwAPIExperimentalFeatures.enable` | Enable the experimental features of Gateway API which are supported by NGINX Gateway Fabric. Requires the Gateway APIs installed from the experimental channel. | bool | `false` |
260260
| `nginxGateway.gwAPIInferenceExtension.enable` | Enable Gateway API Inference Extension support. Allows for configuring InferencePools to route traffic to AI workloads. | bool | `false` |
261+
| `nginxGateway.gwAPIInferenceExtension.endpointPicker` | EndpointPicker TLS configuration. | object | `{"disableTLS":false,"enableSecureVerify":false}` |
262+
| `nginxGateway.gwAPIInferenceExtension.endpointPicker.disableTLS` | Disable TLS for EndpointPicker communication. By default, TLS is enabled. Set to true only for development/testing or when using a service mesh for encryption. | bool | `false` |
263+
| `nginxGateway.gwAPIInferenceExtension.endpointPicker.enableSecureVerify` | Enable TLS certificate verification when connecting to the EndpointPicker. By default, certificate verification is disabled. REQUIRED: Must be false until Gateway API Inference Extension EndpointPicker supports mounting certificates. See: https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/1556 | bool | `false` |
261264
| `nginxGateway.image` | The image configuration for the NGINX Gateway Fabric control plane. | object | `{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"}` |
262265
| `nginxGateway.image.repository` | The NGINX Gateway Fabric image to use | string | `"ghcr.io/nginx/nginx-gateway-fabric"` |
263266
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only deployment is supported. | string | `"deployment"` |

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ spec:
103103
{{- if .Values.nginxGateway.gwAPIInferenceExtension.enable }}
104104
- --gateway-api-inference-extension
105105
{{- end }}
106+
{{- if .Values.nginxGateway.gwAPIInferenceExtension.endpointPicker.disableTLS }}
107+
- --endpoint-picker-disable-tls
108+
{{- end }}
109+
{{- if .Values.nginxGateway.gwAPIInferenceExtension.endpointPicker.enableSecureVerify }}
110+
- --endpoint-picker-enable-secure-verify
111+
{{- end }}
106112
{{- if .Values.nginxGateway.snippetsFilters.enable }}
107113
- --snippets-filters
108114
{{- end }}

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,28 @@
846846
"required": [],
847847
"title": "enable",
848848
"type": "boolean"
849+
},
850+
"endpointPicker": {
851+
"description": "EndpointPicker TLS configuration.",
852+
"properties": {
853+
"disableTLS": {
854+
"default": false,
855+
"description": "Disable TLS for EndpointPicker communication. By default, TLS is enabled.\nSet to true only for development/testing or when using a service mesh for encryption.",
856+
"required": [],
857+
"title": "disableTLS",
858+
"type": "boolean"
859+
},
860+
"enableSecureVerify": {
861+
"default": false,
862+
"description": "Enable TLS certificate verification when connecting to the EndpointPicker.\nBy default, certificate verification is disabled.\nREQUIRED: Must be false until Gateway API Inference Extension EndpointPicker supports mounting certificates.\nSee: https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/1556",
863+
"required": [],
864+
"title": "enableSecureVerify",
865+
"type": "boolean"
866+
}
867+
},
868+
"required": [],
869+
"title": "endpointPicker",
870+
"type": "object"
849871
}
850872
},
851873
"required": [],

charts/nginx-gateway-fabric/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,19 @@ nginxGateway:
214214
# -- Enable Gateway API Inference Extension support. Allows for configuring InferencePools to route traffic to AI workloads.
215215
enable: false
216216

217+
# -- EndpointPicker TLS configuration.
218+
endpointPicker:
219+
# -- Disable TLS for EndpointPicker communication. By default, TLS is enabled.
220+
# Set to true only for development/testing or when using a service mesh for encryption.
221+
disableTLS: false
222+
223+
# -- Enable TLS certificate verification when connecting to the EndpointPicker.
224+
# By default, certificate verification is disabled.
225+
# REQUIRED: Must be false until Gateway API Inference Extension EndpointPicker supports mounting certificates.
226+
# See: https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/1556
227+
enableSecureVerify: false
228+
229+
217230
snippetsFilters:
218231
# -- Enable SnippetsFilters feature. SnippetsFilters allow inserting NGINX configuration into the generated NGINX
219232
# config for HTTPRoute and GRPCRoute resources.

cmd/gateway/commands.go

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ const (
3737
`The controller name must be of the form: DOMAIN/PATH. The controller's domain is '%s'`
3838
plusFlag = "nginx-plus"
3939

40-
serverTLSSecret = "server-tls"
41-
agentTLSSecret = "agent-tls"
42-
nginxOneTelemetryEndpointHost = "agent.connect.nginx.com"
43-
endpointPickerEnableTLSFlag = "endpoint-picker-enable-tls"
44-
endpointPickerSkipSecureVerifyFlag = "endpoint-picker-skip-secure-verify"
40+
serverTLSSecret = "server-tls"
41+
agentTLSSecret = "agent-tls"
42+
nginxOneTelemetryEndpointHost = "agent.connect.nginx.com"
43+
endpointPickerDisableTLSFlag = "endpoint-picker-disable-tls"
44+
endpointPickerEnableSecureVerifyFlag = "endpoint-picker-enable-secure-verify"
4545
)
4646

4747
// common flags.
4848
var (
49-
endpointPickerEnableTLS bool
50-
endpointPickerSkipSecureVerify bool
49+
endpointPickerDisableTLS bool
50+
endpointPickerEnableSecureVerify bool
5151
)
5252

5353
// usageReportParams holds the parameters for building the usage report configuration for PLUS.
@@ -296,8 +296,8 @@ func createControllerCommand() *cobra.Command {
296296
EndpointPort: nginxOneConsoleTelemetryEndpointPort.value,
297297
EndpointTLSSkipVerify: nginxOneConsoleTLSSkipVerify,
298298
},
299-
EndpointPickerEnableTLS: endpointPickerEnableTLS,
300-
EndpointPickerSkipSecureVerify: endpointPickerSkipSecureVerify,
299+
EndpointPickerDisableTLS: endpointPickerDisableTLS,
300+
EndpointPickerEnableSecureVerify: endpointPickerEnableSecureVerify,
301301
}
302302

303303
if err := controller.StartManager(conf); err != nil {
@@ -330,20 +330,6 @@ func createControllerCommand() *cobra.Command {
330330
` Lives in the same Namespace as the controller.`,
331331
)
332332

333-
cmd.Flags().BoolVar(
334-
&endpointPickerEnableTLS,
335-
endpointPickerEnableTLSFlag,
336-
true,
337-
"Enables TLS when connecting to the endpoint picker.",
338-
)
339-
340-
cmd.Flags().BoolVar(
341-
&endpointPickerSkipSecureVerify,
342-
endpointPickerSkipSecureVerifyFlag,
343-
true,
344-
"Disables server certificate verification when connecting to the endpoint picker, if TLS is enabled",
345-
)
346-
347333
cmd.Flags().Var(
348334
&serviceName,
349335
serviceFlag,
@@ -465,6 +451,8 @@ func createControllerCommand() *cobra.Command {
465451
"traffic to AI workloads.",
466452
)
467453

454+
addEPPConnectionFlags(cmd)
455+
468456
cmd.Flags().Var(
469457
&nginxDockerSecrets,
470458
nginxDockerSecretFlag,
@@ -788,28 +776,34 @@ func createEndpointPickerCommand() *cobra.Command {
788776
RunE: func(_ *cobra.Command, _ []string) error {
789777
logger := ctlrZap.New().WithName("endpoint-picker-shim")
790778
handler := createEndpointPickerHandler(
791-
realExtProcClientFactory(endpointPickerEnableTLS, endpointPickerSkipSecureVerify),
779+
realExtProcClientFactory(endpointPickerDisableTLS, endpointPickerEnableSecureVerify),
792780
logger,
793781
)
794782
return endpointPickerServer(handler)
795783
},
796784
}
797785

786+
addEPPConnectionFlags(cmd)
787+
788+
return cmd
789+
}
790+
791+
func addEPPConnectionFlags(cmd *cobra.Command) {
798792
cmd.Flags().BoolVar(
799-
&endpointPickerEnableTLS,
800-
endpointPickerEnableTLSFlag,
801-
true,
802-
"Enables TLS when connecting to the endpoint picker.",
793+
&endpointPickerDisableTLS,
794+
endpointPickerDisableTLSFlag,
795+
false,
796+
"Disables TLS when connecting to the EndpointPicker. "+
797+
"Set to true only for development/testing or when using a service mesh for encryption.",
803798
)
804799

805800
cmd.Flags().BoolVar(
806-
&endpointPickerSkipSecureVerify,
807-
endpointPickerSkipSecureVerifyFlag,
808-
true,
809-
"Disables server certificate verification when connecting to the endpoint picker, if TLS is enabled",
801+
&endpointPickerEnableSecureVerify,
802+
endpointPickerEnableSecureVerifyFlag,
803+
false,
804+
"Enables server certificate verification when connecting to the EndpointPicker, if TLS is enabled. "+
805+
"REQUIRED: Must be false until Gateway API Inference Extension EndpointPicker supports mounting certificates.",
810806
)
811-
812-
return cmd
813807
}
814808

815809
func parseFlags(flags *pflag.FlagSet) ([]string, []string) {

cmd/gateway/commands_test.go

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ func TestControllerCmdFlagValidation(t *testing.T) {
161161
"--nginx-one-telemetry-endpoint-host=telemetry-endpoint-host",
162162
"--nginx-one-telemetry-endpoint-port=443",
163163
"--nginx-one-tls-skip-verify",
164-
"--endpoint-picker-enable-tls",
165-
"--endpoint-picker-skip-secure-verify",
164+
"--endpoint-picker-disable-tls",
165+
"--endpoint-picker-enable-secure-verify",
166166
},
167167
wantErr: false,
168168
},
@@ -931,29 +931,37 @@ func TestEndpointPickerFlags(t *testing.T) {
931931
t.Parallel()
932932
tests := []flagTestCase{
933933
{
934-
name: "valid flags",
934+
name: "valid flags with default values",
935+
args: []string{
936+
"--endpoint-picker-disable-tls=false",
937+
"--endpoint-picker-enable-secure-verify=false",
938+
},
939+
wantErr: false,
940+
},
941+
{
942+
name: "valid flags with changed values",
935943
args: []string{
936-
"--endpoint-picker-enable-tls=true",
937-
"--endpoint-picker-skip-secure-verify=false",
944+
"--endpoint-picker-disable-tls=true",
945+
"--endpoint-picker-enable-secure-verify=true",
938946
},
939947
wantErr: false,
940948
},
941949
{
942-
name: "endpoint-picker-enable-tls is not a bool",
950+
name: "endpoint-picker-disable-tls is not a bool",
943951
args: []string{
944-
"--endpoint-picker-enable-tls=not-a-bool",
952+
"--endpoint-picker-disable-tls=not-a-bool",
945953
},
946954
wantErr: true,
947-
expectedErrPrefix: `invalid argument "not-a-bool" for "--endpoint-picker-enable-tls" flag:` +
955+
expectedErrPrefix: `invalid argument "not-a-bool" for "--endpoint-picker-disable-tls" flag:` +
948956
` strconv.ParseBool: parsing "not-a-bool": invalid syntax`,
949957
},
950958
{
951-
name: "endpoint-picker-skip-secure-verify is not a bool",
959+
name: "endpoint-picker-enable-secure-verify is not a bool",
952960
args: []string{
953-
"--endpoint-picker-skip-secure-verify=not-a-bool",
961+
"--endpoint-picker-enable-secure-verify=not-a-bool",
954962
},
955963
wantErr: true,
956-
expectedErrPrefix: `invalid argument "not-a-bool" for "--endpoint-picker-skip-secure-verify" flag:` +
964+
expectedErrPrefix: `invalid argument "not-a-bool" for "--endpoint-picker-enable-secure-verify" flag:` +
957965
` strconv.ParseBool: parsing "not-a-bool": invalid syntax`,
958966
},
959967
}

cmd/gateway/endpoint_picker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ func endpointPickerServer(handler http.Handler) error {
3535
}
3636

3737
// realExtProcClientFactory returns a factory that creates a new gRPC connection and client per request.
38-
func realExtProcClientFactory(enableTLS, skipSecureVerify bool) extProcClientFactory {
38+
func realExtProcClientFactory(disableTLS, enableSecureVerify bool) extProcClientFactory {
3939
return func(target string) (extprocv3.ExternalProcessorClient, func() error, error) {
4040
var opts []grpc.DialOption
4141

42-
if !enableTLS {
42+
if disableTLS {
4343
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
4444
} else {
4545
creds := credentials.NewTLS(&tls.Config{
46-
InsecureSkipVerify: skipSecureVerify, //nolint:gosec
46+
InsecureSkipVerify: !enableSecureVerify, //nolint:gosec
4747
})
4848
opts = append(opts, grpc.WithTransportCredentials(creds))
4949
}

internal/controller/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ type Config struct {
5252
InferenceExtension bool
5353
// SnippetsFilters indicates if SnippetsFilters are enabled.
5454
SnippetsFilters bool
55-
// EndpointPickerEnableTLS indicates if TLS is enabled for EndpointPicker communication.
56-
EndpointPickerEnableTLS bool
57-
// EndpointPickerSkipSecureVerify indicates if secure verification is skipped for EndpointPicker communication.
58-
EndpointPickerSkipSecureVerify bool
55+
// EndpointPickerDisableTLS indicates if TLS is disabled for EndpointPicker communication.
56+
EndpointPickerDisableTLS bool
57+
// EndpointPickerEnableSecureVerify indicates if secure verification is enabled for EndpointPicker communication.
58+
EndpointPickerEnableSecureVerify bool
5959
}
6060

6161
// GatewayPodConfig contains information about this Pod.

internal/controller/manager.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,21 @@ func StartManager(cfg config.Config) error {
208208
ctx,
209209
mgr,
210210
provisioner.Config{
211-
DeploymentStore: nginxUpdater.NginxDeployments,
212-
StatusQueue: statusQueue,
213-
Logger: cfg.Logger.WithName("provisioner"),
214-
EventRecorder: recorder,
215-
GatewayPodConfig: &cfg.GatewayPodConfig,
216-
GCName: cfg.GatewayClassName,
217-
AgentTLSSecretName: cfg.AgentTLSSecretName,
218-
NGINXSCCName: cfg.NGINXSCCName,
219-
Plus: cfg.Plus,
220-
NginxDockerSecretNames: cfg.NginxDockerSecretNames,
221-
PlusUsageConfig: &cfg.UsageReportConfig,
222-
NginxOneConsoleTelemetryConfig: cfg.NginxOneConsoleTelemetryConfig,
223-
InferenceExtension: cfg.InferenceExtension,
224-
EndpointPickerEnableTLS: cfg.EndpointPickerEnableTLS,
225-
EndpointPickerSkipSecureVerify: cfg.EndpointPickerSkipSecureVerify,
211+
DeploymentStore: nginxUpdater.NginxDeployments,
212+
StatusQueue: statusQueue,
213+
Logger: cfg.Logger.WithName("provisioner"),
214+
EventRecorder: recorder,
215+
GatewayPodConfig: &cfg.GatewayPodConfig,
216+
GCName: cfg.GatewayClassName,
217+
AgentTLSSecretName: cfg.AgentTLSSecretName,
218+
NGINXSCCName: cfg.NGINXSCCName,
219+
Plus: cfg.Plus,
220+
NginxDockerSecretNames: cfg.NginxDockerSecretNames,
221+
PlusUsageConfig: &cfg.UsageReportConfig,
222+
NginxOneConsoleTelemetryConfig: cfg.NginxOneConsoleTelemetryConfig,
223+
InferenceExtension: cfg.InferenceExtension,
224+
EndpointPickerDisableTLS: cfg.EndpointPickerDisableTLS,
225+
EndpointPickerEnableSecureVerify: cfg.EndpointPickerEnableSecureVerify,
226226
},
227227
)
228228
if err != nil {

internal/controller/provisioner/objects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,11 +1126,11 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
11261126
"endpoint-picker",
11271127
}
11281128

1129-
if p.cfg.EndpointPickerEnableTLS {
1130-
command = append(command, "--endpoint-picker-enable-tls")
1129+
if p.cfg.EndpointPickerDisableTLS {
1130+
command = append(command, "--endpoint-picker-disable-tls")
11311131
}
1132-
if p.cfg.EndpointPickerSkipSecureVerify {
1133-
command = append(command, "--endpoint-picker-skip-secure-verify")
1132+
if p.cfg.EndpointPickerEnableSecureVerify {
1133+
command = append(command, "--endpoint-picker-enable-secure-verify")
11341134
}
11351135

11361136
spec.Spec.Containers = append(spec.Spec.Containers, corev1.Container{

0 commit comments

Comments
 (0)