-
Notifications
You must be signed in to change notification settings - Fork 17
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
refactor: use secret config instead of action for configuring TLS ingress gateway #401
Conversation
Bumping juju and ops packages to use them in newer versions of the charms, plus testing them in a CI with a more recent juju version. This commit also skips some test cases that will be removed in a follow up commit introduced by #401. Part of canonical/bundle-kubeflow#859 Part of #398 Signed-off-by: Daniela Plascencia <daniela.plascencia@canonical.com>
281d923
to
a836a8c
Compare
a836a8c
to
0ca9c17
Compare
The recommended way of handling user secrets is by saving the user secret ID in a charm configuration, that way the charm can use it to get the contents of the secret. When the charm is granted with the user secret via the CLI, it allows the charm to observe secret events, which help handle changes in their contents. The istio-pilot charm implemented a way to use actions to wrap the secret logic, but because of the above, this commit does a small refactor to remove the set-tls and unset-tls actions and instead directly use user secrets. This commit also renames ssl to tls to be more accurate when referring to the actual configuration that gets done in the Gateway. Part of #398
0ca9c17
to
9f1691f
Compare
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.
lgtm apart from a few minor comments
Will do another pass after the blocking PR is merged/rebased
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.
Really nice work @DnPlas! I left some comments
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 job once more! Could you also include the PR's title/commit the this refers to TLS?
…ress gateway (#401) * refactor: use secret config instead of action The recommended way of handling user secrets is by saving the user secret ID in a charm configuration, that way the charm can use it to get the contents of the secret. When the charm is granted with the user secret via the CLI, it allows the charm to observe secret events, which help handle changes in their contents. The istio-pilot charm implemented a way to use actions to wrap the secret logic, but because of the above, this commit does a small refactor to remove the set-tls and unset-tls actions and instead directly use user secrets. This commit also renames ssl to tls to be more accurate when referring to the actual configuration that gets done in the Gateway. Part of #398
…ress gateway (#401) * refactor: use secret config instead of action The recommended way of handling user secrets is by saving the user secret ID in a charm configuration, that way the charm can use it to get the contents of the secret. When the charm is granted with the user secret via the CLI, it allows the charm to observe secret events, which help handle changes in their contents. The istio-pilot charm implemented a way to use actions to wrap the secret logic, but because of the above, this commit does a small refactor to remove the set-tls and unset-tls actions and instead directly use user secrets. This commit also renames ssl to tls to be more accurate when referring to the actual configuration that gets done in the Gateway. Part of #398
…ress gateway (#401) * refactor: use secret config instead of action The recommended way of handling user secrets is by saving the user secret ID in a charm configuration, that way the charm can use it to get the contents of the secret. When the charm is granted with the user secret via the CLI, it allows the charm to observe secret events, which help handle changes in their contents. The istio-pilot charm implemented a way to use actions to wrap the secret logic, but because of the above, this commit does a small refactor to remove the set-tls and unset-tls actions and instead directly use user secrets. This commit also renames ssl to tls to be more accurate when referring to the actual configuration that gets done in the Gateway. Part of #398
This PR cherry-picks all the work done for enabling TLS ingress gateway using juju secrets. * docs: add instructions for TLS with secrets (#421) * refactor: use secret config instead of action for configuring TLS ingress gateway (#401) * fix: check routes is not empty before popping values (#424) Fixes #398
The recommended way of handling user secrets is by saving the user secret ID in a charm configuration, that way the charm can use it to get the contents of the secret. When the charm is granted with the user secret via the CLI, it allows the charm to observe secret events, which help handle changes in their contents. The istio-pilot charm implemented a way to use actions to wrap the secret logic, but because of the above, this commit does a small refactor to remove the set-tls and unset-tls actions and instead use user secrets directly.
This commit also renames ssl to tls to be more accurate when referring to the actual configuration that gets done in the Gateway.
Part of #398
Merge after #402
Manual testing
NOTE: this feature works with juju > 3.3, installing and bootstrapping a controller version 3.4 is recommended to be in sync with the CI (changes introduced by #402).
juju add-secret istio-tls-secret tls-crt=<some str> tls-key=<another str>
istio-pilot
to access the secret contentsjuju grant-secret istio-tls-secret istio-pilot
istio-pilot
charm as a config option withjuju config istio-pilot tls-secret-id=secret:<secret ID resulting from step 2>
. If you have lost it, you can always check withjuju secrets
.Gateway
resource is configured with TLS and that theSecret
(the kubernetes resource) has the expected values:juju update-secret secret:<secret id> tls-crt=new-crt tls-key=new-key
secret-changed`` message in
juju debug-log. The
juju status` msg should mention that the TLS configuration is being applied.Secret
to confirm the new values are thereistio-pilot
configurationjuju config istio-pilot tls-secret-id=""
juju remove-secret istio-tls-secret
Gateway
is not configured with TLS and the kubernetesSecret
does not exist anymoreTODO