-
Notifications
You must be signed in to change notification settings - Fork 128
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
feat(oidc): allow for secret csi driver mounts #250
Conversation
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
I still need to test this against a secret csi driver, I am just using existing deployments that leverage the secret csi driver to guide the yaml here. Once I test it, I will publish the PR and share some of the evidence. |
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
@jmazzitelli let me know your thoughts |
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.
wow, is this all we need :) I have a trivial change request. But if this is all you need, then I can do the operator changes.
@rumstead Can you provide simple test procedures so I can manually test this? Doesn't have to mean installing CSI -- I just want to see what you used for the helm values that got the mounts to be defined in the deployment (even if it means without CSI that my deployment doesn't start). A dry-run of helm is fine, too. I think you are using this for values, but I'm not sure: deployment:
custom_secrets:
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "kiali-secretprovider" |
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
Sure thing, here is the values.yaml I used called
auth:
strategy: "openid"
openid:
client_id: "abc-123"
issuer_uri: "https://foo"
http_proxy: "http://proxy-foo"
https_proxy: "http://proxy-foo"
insecure_skip_verify_tls: true
disable_rbac: true
deployment:
image_version: v1.76.0
version_label: v1.76.0
custom_secrets:
- name: "kiali-secret-csi"
mount: "/mnt/secrets-store"
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: kiali-secretprovider
server:
web_port: 443
web_schema: https |
Here's a quick test:
helm template \
--show-only templates/deployment.yaml \
--set deployment.custom_secrets[0].name=csi-secret-name \
--set deployment.custom_secrets[0].mount=/csi-secret-mount \
--set deployment.custom_secrets[0].csi.driver=csi-secret-driver \
--set deployment.custom_secrets[0].csi.readOnly=true \
--set deployment.custom_secrets[0].csi.volumeAttributes.secretProviderClass=csi-secret-providerclass \
kiali-server \
_output/charts/kiali-server-1.82.0-SNAPSHOT.tgz Essentially, the values that command passes in are these: deployment:
custom_secrets:
- name: "csi-secret-name"
mount: "/csi-secret-mount"
csi:
driver: csi-secret-driver
readOnly: true
volumeAttributes:
secretProviderClass: csi-secret-providerclass
volume mount: volumeMounts:
...
- name: csi-secret-name
mountPath: "/csi-secret-mount" volume: volumes:
...
- name: csi-secret-name
csi:
driver: csi-secret-driver
readOnly: true
volumeAttributes:
secretProviderClass: csi-secret-providerclass |
@rumstead please confirm that test procedure I documented in the previous comment is correct and that it produces what you expect. |
I get the expected output: volumeMounts:
...
- name: csi-secret-name
mountPath: "/csi-secret-mount"
volumes:
...
- name: csi-secret-name
csi:
driver: csi-secret-driver
readOnly: true
volumeAttributes:
secretProviderClass: csi-secret-providerclass
... |
@rumstead I'm doing more testing and I noticed something that doesn't look broken, but I think I will need to document somewhere. In my test procedure - in the helm template command - add So run this:
and you don't see the optional field. You can see what happens if you set the optional field on a non-CSI secret by adding these params to that above command:
That results in: - name: second-name
secret:
secretName: second-name
optional: true Does the CSI secret configuration support the "optional" field like the normal secret config? I don't think it does. I just tried it and I get validation errors when I try - edit the deployment and add It does not look like the If that is true, then I should probably change the docs here to say this (update: I added a small blurb in those docs in this commit in the operator PR: kiali/kiali-operator@b8848eb) |
After some quick manual testing of my own, this PR is ready to merge as is the operator PR |
yea great catch and shout. I agree, I don't think the |
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.
this is ready to go - approve.
kiali/kiali#6942
To deploy the token in a scalable and secure manner, we want to leverage the secret CSI drivers backed by secret management tools. The secret CSI driver uses a pod's service account for authorization and will only create the secret when there is a mount requested. However, the kiali helm chat doesn't allow us to add any volume mounts which in turn doesn't trigger the secret creation.
The goal of this PR is to allow a user to add additional mounts and leverage the existing custom_secrets configuration option.