@@ -37,9 +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"
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"
45+ )
46+
47+ // common flags.
48+ var (
49+ endpointPickerEnableTLS bool
50+ endpointPickerSkipSecureVerify bool
4351)
4452
4553// usageReportParams holds the parameters for building the usage report configuration for PLUS.
@@ -288,6 +296,8 @@ func createControllerCommand() *cobra.Command {
288296 EndpointPort : nginxOneConsoleTelemetryEndpointPort .value ,
289297 EndpointTLSSkipVerify : nginxOneConsoleTLSSkipVerify ,
290298 },
299+ EndpointPickerEnableTLS : endpointPickerEnableTLS ,
300+ EndpointPickerSkipSecureVerify : endpointPickerSkipSecureVerify ,
291301 }
292302
293303 if err := controller .StartManager (conf ); err != nil {
@@ -320,6 +330,20 @@ func createControllerCommand() *cobra.Command {
320330 ` Lives in the same Namespace as the controller.` ,
321331 )
322332
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+
323347 cmd .Flags ().Var (
324348 & serviceName ,
325349 serviceFlag ,
@@ -763,11 +787,28 @@ func createEndpointPickerCommand() *cobra.Command {
763787 Short : "Shim server for communication between NGINX and the Gateway API Inference Extension Endpoint Picker" ,
764788 RunE : func (_ * cobra.Command , _ []string ) error {
765789 logger := ctlrZap .New ().WithName ("endpoint-picker-shim" )
766- handler := createEndpointPickerHandler (realExtProcClientFactory (), logger )
790+ handler := createEndpointPickerHandler (
791+ realExtProcClientFactory (endpointPickerEnableTLS , endpointPickerSkipSecureVerify ),
792+ logger ,
793+ )
767794 return endpointPickerServer (handler )
768795 },
769796 }
770797
798+ cmd .Flags ().BoolVar (
799+ & endpointPickerEnableTLS ,
800+ endpointPickerEnableTLSFlag ,
801+ true ,
802+ "Enables TLS when connecting to the endpoint picker." ,
803+ )
804+
805+ cmd .Flags ().BoolVar (
806+ & endpointPickerSkipSecureVerify ,
807+ endpointPickerSkipSecureVerifyFlag ,
808+ true ,
809+ "Disables server certificate verification when connecting to the endpoint picker, if TLS is enabled" ,
810+ )
811+
771812 return cmd
772813}
773814
0 commit comments