-
Notifications
You must be signed in to change notification settings - Fork 8.1k
fix custom sni in bootstrap clusters properly #28565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@@ -135,13 +137,14 @@ func tlsContextConvert(tls *networkingAPI.ClientTLSSettings, sniName string, met | |||
}, | |||
} | |||
tlsContext.CommonTlsContext.AlpnProtocols = util.ALPNInMeshH2 | |||
// For ISTIO_MUTUAL if custom SNI is not provided, use the default SNI name. | |||
if len(tls.Sni) == 0 { | |||
tlsContext.Sni = sniName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do the other types use tls.Sni
but here we use sniName
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch we have to set tls.Sni
if it exists and if it does not exist for ISTIO_MUTUAL we will have to set the default SNI name. This was existing implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like for ISTIO_MUTUAL we only honor the sniName not the ones given in tls.Sni. So the existing implementation is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore the above. I corrected the code. If tls.Sni
exists we use it otherwise use the default sniName
. All tests are passing now. PTAL
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
/test integ-pilot-k8s-tests_istio |
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
/test integ-pilot-k8s-tests_istio |
@@ -374,7 +374,7 @@ | |||
, | |||
{ | |||
"name": "zipkin", | |||
"transport_socket": {"name":"envoy.transport_sockets.tls","typed_config":{"@type":"type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext","common_tls_context":{"combined_validation_context":{"default_validation_context":{},"validation_context_sds_secret_config":{"name":"file-root:/etc/zipkin/ca.pem","sds_config":{"api_config_source":{"api_type":"GRPC","grpc_services":[{"envoy_grpc":{"cluster_name":"sds-grpc"}}],"transport_api_version":"V3"},"resource_api_version":"V3"}}}}}}, | |||
"transport_socket": {"name":"envoy.transport_sockets.tls","typed_config":{"@type":"type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext", "sni":"zipkin-custom-sni", "common_tls_context":{"combined_validation_context":{"default_validation_context":{},"validation_context_sds_secret_config":{"name":"file-root:/etc/zipkin/ca.pem","sds_config":{"api_config_source":{"api_type":"GRPC","grpc_services":[{"envoy_grpc":{"cluster_name":"sds-grpc"}}],"transport_api_version":"V3"},"resource_api_version":"V3"}}}}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
@howardjohn Can you PTAL when you get chance? |
/test integ-pilot-k8s-tests_istio |
* fix custom sni properly Signed-off-by: Rama Chavali <rama.rao@salesforce.com> * remove unnecessary code Signed-off-by: Rama Chavali <rama.rao@salesforce.com> * fix istio mutual tls Signed-off-by: Rama Chavali <rama.rao@salesforce.com> * revert istio mutual tls Signed-off-by: Rama Chavali <rama.rao@salesforce.com> * try setting again Signed-off-by: Rama Chavali <rama.rao@salesforce.com> Co-authored-by: Rama Chavali <rama.rao@salesforce.com>
#26684 did not fix the custom sni properly. It did not add it correctly to the upstream tls settings. This PR fixes it.
[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ X] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure
Pull Request Attributes
Please check any characteristics that apply to this pull request.
[X ] Does not have any changes that may affect Istio users.