Skip to content

do not hardcode cert watch path in pilot agent#12142

Closed
drichelson wants to merge 4 commits intoistio:release-1.1from
drichelson:proxyCertWatchConfig
Closed

do not hardcode cert watch path in pilot agent#12142
drichelson wants to merge 4 commits intoistio:release-1.1from
drichelson:proxyCertWatchConfig

Conversation

@drichelson
Copy link
Contributor

@drichelson drichelson commented Feb 28, 2019

Addresses #11984 for pilot-agent.

Note: Changes made in vendor directory will be reverted and a proper update of the api dependency will be committed once istio/api#824 is merged

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Feb 28, 2019
@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: drichelson
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: andraxylia

If they are not already assigned, you can assign the PR to them by writing /assign @andraxylia in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 28, 2019
@istio-testing
Copy link
Collaborator

@drichelson: PR needs rebase.

Details

Instructions 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.

@istio-testing
Copy link
Collaborator

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

isValid: false,
},
{
name: "cert files to watch partially invalid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File is not goimports-ed (from goimports)


type watcher struct {
certs []CertSource
certs []string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The watcher code now takes a list of absolute file paths to watch. This allows for maximum flexibility when cert file names and locations are dictated by outside forces.

@rshriram
Copy link
Member

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Feb 28, 2019
@istio-testing
Copy link
Collaborator

@drichelson: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/e2e-simpleTests.sh 563a496 link /test e2e-simpleTests
prow/e2e-bookInfoTests-v1alpha3.sh 563a496 link /test e2e-bookInfoTests-envoyv2-v1alpha3
prow/e2e_pilotv2_auth_sds.sh 563a496 link /test istio_auth_sds_e2e
prow/istio-pilot-e2e-envoyv2-v1alpha3.sh 563a496 link /test istio-pilot-e2e-envoyv2-v1alpha3
prow/e2e-mixer-no_auth.sh 563a496 link /test e2e-mixer-no_auth
prow/e2e-dashboard.sh 563a496 link /test e2e-dashboard
prow/release-test.sh 563a496 link /test release-test
prow/istio-pilot-multicluster-e2e.sh 563a496 link /test istio-pilot-multicluster-e2e
prow/istio-unit-tests.sh e994dda link /test istio-unit-tests
prow/istio-integ-local-tests.sh e994dda link /test istio-integ-local-tests
prow/istio-presubmit.sh e994dda link /test istio-presubmit
prow/istio-integ-k8s-tests.sh e994dda link /test istio-integ-k8s-tests
Details

Instructions 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.

envoyProxy := envoy.NewProxy(proxyConfig, role.ServiceNode(), proxyLogLevel, pilotSAN, role.IPAddresses)
agent := proxy.NewAgent(envoyProxy, proxy.DefaultRetry, pilot.TerminationDrainDuration())
watcher := envoy.NewWatcher(certs, agent.ConfigCh())
watcher := envoy.NewWatcher(proxyConfig.TlsCertsToWatch, agent.ConfigCh())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can not see how these files are used other than watch them ans restart envoy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true. dont you have to update the mTLS plugin in pilot to generate envoy TLS contexts to use the right paths?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hzxuzhonghu: correct. The actual certs that envoy uses come from other configs:

  1. xDS (pilot-discovery) mTLS certs are defined in static config.
  2. All cert info for proxied requests is passed down from xDS config.

Moving forward my understanding is that Envoy's SDS will handle more of #2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my point is XDS still uses the old path /etc/certs.. the code change here only tells pilot agent to watch the new path. but Pilot (discovery) is still using the old one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rshriram We'll open a separate issue/PR for any pilot-discovery changes needed to customize these cert paths if that's ok.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think we need fix it here.

@rshriram rshriram changed the title WIP: do not merge. Proxy cert watch config do not hardcode cert watch path in pilot agent Feb 28, 2019
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Feb 28, 2019
@drichelson
Copy link
Contributor Author

@rshriram This PR depends on an update of the vendored istio.io/api dependency. I have it updated locally. Should that change be a part of this PR, or should api get updated in a separate workflow?

@drichelson
Copy link
Contributor Author

Due to the large number of changes in the istio.io/api dependency I created a separate PR for updating it: #12160

@rshriram
Copy link
Member

Hi, per my other comment, could you send the API pr to master branch and send this PR to master branch as well ? This is a two part fix and I am not sure if both will end up in Pilot before the 1.1 release. I would much rather have a complete feature in 1.1 vs a partial one. We can always cherry pick these fixes into a 1.1.x patch release, as its a trivial fix

path.Join(model.AuthCertsPath, model.KeyFilename),
path.Join(model.AuthCertsPath, model.RootCertFilename),
}
if role.Type == model.Ingress {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yu can get rid of this ingress cert thing.. and restrict this to just the mTLS certs. we are using SDS for ingress and gateways. and the certs specified in both do not have to have a standard path. So thsi code is likely a legacy leftover..

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay with the changes as it is, but please move to master

@drichelson
Copy link
Contributor Author

Closing and creating a new more comprehensive PR that targets master branch

@drichelson drichelson closed this Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR needs to be rebased before being merged ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants