-
Notifications
You must be signed in to change notification settings - Fork 339
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
chore(*) ExternalServices add CA and Client certificate support #1094
Conversation
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
4fc74de
to
34b6fe1
Compare
# Conflicts: # pkg/xds/topology/outbound.go Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
pkg/xds/topology/outbound.go
Outdated
tlsEnabled = externalService.Spec.Networking.Tls.Enabled | ||
externalServiceEndpoint, err := buildExternalServiceEndpoint(externalService, mesh.Meta.GetMesh(), loader) | ||
if err != nil { | ||
log.Info("Unable to create ExternalService endpoint", err) |
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.
If err
happened, maybe log also should be log.Error
regardless it doesn't affect the execution?
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.
I also think log.Error
is better. How about this
log.Error(err, "unable to create ExternalService endpoint. Endpoint won't be included in the XDS.", "name", externalService.Meta.GetName(), "mesh", externalService.Meta.GetMesh())
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
pkg/xds/envoy/tls.go
Outdated
@@ -183,8 +183,35 @@ func ServiceSpiffeIDMatcher(mesh string, service string) *envoy_type_matcher.Str | |||
} | |||
} | |||
|
|||
func CreateUpstreamTlsContextNoMetadata(sni string) (*envoy_auth.UpstreamTlsContext, error) { | |||
func CreateUpstreamTlsContextNoMetadata(ca, cert, key *envoy_core.DataSource, sni string) (*envoy_auth.UpstreamTlsContext, error) { |
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.
How about UpstreamTlsContextOutsideMesh()
or UpstreamTLSContextManuallMTLS
instead of CreateUpstreamTlsContextNoMetadata()
?
Can you also put this function in existing tls
subpackage if possible? I want to throw there all the things tls related eventually
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.
Renaming is fine, but am not sure why to move only this function and not the whole tls.go?
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.
feel free to move whole tls.go
pkg/xds/topology/outbound.go
Outdated
tlsEnabled = externalService.Spec.Networking.Tls.Enabled | ||
externalServiceEndpoint, err := buildExternalServiceEndpoint(externalService, mesh.Meta.GetMesh(), loader) | ||
if err != nil { | ||
log.Info("Unable to create ExternalService endpoint", err) |
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.
I also think log.Error
is better. How about this
log.Error(err, "unable to create ExternalService endpoint. Endpoint won't be included in the XDS.", "name", externalService.Meta.GetName(), "mesh", externalService.Meta.GetMesh())
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
f7dcd17
to
e685596
Compare
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
5c27e51
to
53a65d4
Compare
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
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.
Have you tested mTLS? at least manually?
@@ -76,3 +76,7 @@ func (k *k8SDeployment) Delete(cluster framework.Cluster) error { | |||
func (k *k8SDeployment) GetExternalAppAddress() string { | |||
return k.ip | |||
} | |||
|
|||
func (k *k8SDeployment) GetCert() string { | |||
return "" |
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 is it empty on K8S?
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.
It is actually not implemented there. Will just panic.
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.
Ok, but why? Is it because we don't have this test on Kubernetes? If so, please add a comment why we don't have a test on Kubernetes
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Summary
Add CA and Client certificate support