Cert file path override fixes.#13367
Conversation
|
Hi @drichelson. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pilot/cmd/pilot-agent/main.go
Outdated
| // Add cert paths as node metadata only if they differ from defaults | ||
| if tlsServerCertChain != model.DefaultCertChain { | ||
| role.Metadata[model.NodeMetadataTLSServerCertChain] = tlsServerCertChain | ||
| proxyConfig.EnvoyNodeMetadata[model.NodeMetadataTLSServerCertChain] = tlsServerCertChain |
There was a problem hiding this comment.
The role.Metadata was never initialized or read, so setting it was a fail. Instead we are using the new EnvoyNodeMetadata field on the ProxyConfig struct. This gets passed in to the bootstrap code so it seems like the logical place for it to live.
There was a problem hiding this comment.
instead of piggybacking on metadata, cant you do this check after https://github.com/istio/istio/pull/13367/files#diff-5cb6a377bcea0cba4f2dd118a326af06R181 has been called?
There was a problem hiding this comment.
@rshriram I'm not sure what you mean by "piggybacking on metadata". The cert file overrides are used by both the file watcher here in pilot-agent and they are sent as node metadata so they can be used by pilot to configure listeners + clusters.
pilot/cmd/pilot-agent/main.go
Outdated
| proxyCmd.PersistentFlags().StringVar(&tlsClientCertChain, "tlsClientCertChain", | ||
| model.DefaultCertChain, "Absolute path to client cert-chain file used for istio mTLS") | ||
| proxyCmd.PersistentFlags().StringVar(&tlsClientKey, "tlsSClientKey", | ||
| proxyCmd.PersistentFlags().StringVar(&tlsClientKey, "tlsClientKey", |
|
/ok-to-test |
|
can you clarify this:
Destination rules merely specify the paths. they dont provide certs. So a bit more context would help. |
|
@rshriram These changes are all about cert file paths, not cert contents. I'll outline the current scenario for our (Salesforce) mesh:
I hope that helps. |
|
Sorry for the delayed response and sorry to keep this pr waiting. I understand the setup and the requirement to customize cert path. What I am uncomfortable about is changing the mesh config api to add the default node metadata under the default proxy config section. This will lead to others stuffing additional metadata in the helm chart that might conflict with ones inserted by us per sidecar in the sidecar injector. What takes precedence ? Default or one in sidecar injector that appears as env vars? I believe it’s latter but that behavior needs documenting and good explanation. If we can do this without modifying the mesh config proto, it would be great. Otherwise lets get this in with proper docs. |
I'm thinking of this as a simpler approach: Abandon command line args for setting cert paths and instead set the ISTIO_META env vars for custom cert paths. The cert watcher can check for these env vars and watch non-default paths if they are set. Thoughts? |
|
That works! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: drichelson If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@drichelson: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This PR addresses #11984
It is a followup to #12189
Please see api PR: istio/api#902 as it will need to be merged before this can be finalized.
Addresses a few bugs from the original PR and adds the ability to override client certs (set in DestinationRule) with envoy node metadata.
I've included the api changes in the vendor dir. I will remove them once the api PR is merged. This is causing the lint failure.