-
Notifications
You must be signed in to change notification settings - Fork 118
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
operator support for mounting secrets from CSI secret store #748
Conversation
This is not ready yet. Need to write some jinja code to loop through the custom_secrets and convert snake_case so it retains the camelCase |
jinja code added. Ready for review. |
description: "The name of the secret that is to be mounted to the Kiali pod's file system. The name of the custom secret must not be the same name as one created by the operator. Names such as `kiali`, `kiali-cert-secret`, and `kiali-cabundle` should not be used as a custom secret name because the operator may want to create one with one of those names." | ||
type: string | ||
csi: | ||
description: "Defines CSI-specific settings that allows a secret from an external CSI secret store to be injected in the pod via a volume mount. For details, see https://secrets-store-csi-driver.sigs.k8s.io/" |
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.
@rumstead can you review this little documentation blurb? This will show up in the kiali.io documentation website in the Kiali CR reference page - it will end up somewhere around here. I just want to make sure I'm not blowing smoke :) If you have some better documentation blurb to put here, please suggest it.
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. Should we add an example to the already existing examples?
Maybe:
- name: "kiali-secret-csi"
mount: "/mnt/secrets-store"
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: kiali-secretprovider
If you think we need more docs in the future like there are for custom dashboards I can contribute something.
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. Should we add an example to the already existing examples?
We could. I can add it to this PR. I don't know what the true values would/should look like, so please suggest something that would be good for that example CR.
If you think we need more docs in the future like there are for custom dashboards I can contribute something.
Yes. I was thinking we should have a dedicated "something" in the docs for this. I was thinking it is a simple FAQ that we would add here which shows up here. Feel free to submit a PR over in the kiali.io repo.
I did some quick manual testing just to confirm there isn't obvious bugs here (and with the helm charts PR) and everything looks good. It appears CSI secrets must exist at the time of deployment (there is no So this PR is ready to be merged. |
For the record, I do not have CSI set up, so my testing just involved deploying a Kiali CR and seeing the server pod try to start up (even though it can't) and that it has the proper deployment yaml. So in short, did the following quick test:
diff --git a/deploy/kiali/kiali_cr_dev.yaml b/deploy/kiali/kiali_cr_dev.yaml
index d80ebe4..62d46ba 100644
--- a/deploy/kiali/kiali_cr_dev.yaml
+++ b/deploy/kiali/kiali_cr_dev.yaml
@@ -28,6 +28,15 @@ spec:
service_type: $SERVICE_TYPE
logger:
log_level: info
+ custom_secrets:
+ - name: csi-test
+ mount: /csi-test
+ optional: true
+ csi:
+ driver: secrets-store.csi.k8s.io
+ readOnly: true
+ volumeAttributes:
+ secretProviderClass: kiali-secretprovider
At this point you will see the server pod trying to start but failing because CSI isn't set up - but that confirms the CSI yaml is correctly configured:
You'll notice |
part of: kiali/kiali#6942
helm-charts companion PR: kiali/helm-charts#250