Skip to content
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: load secrets for OpenStack Helm via a values file #19

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

cardoe
Copy link
Contributor

@cardoe cardoe commented Mar 7, 2024

Generate a helm values file with the secrets in it. That can then be stored and used via tools like https://github.com/jkroepke/helm-secrets Then switch to using the OpenStack Helm charts via their repo so that we can execute their helm charts like we do the other components.

@cardoe
Copy link
Contributor Author

cardoe commented Mar 7, 2024

I realize now this wouldn't work because the MariaDB and RabbitMQ operator need to read the secret. So we would need to still create the secret from this data. So still more to iterate here.

@skrobul
Copy link
Collaborator

skrobul commented Mar 7, 2024

https://github.com/jkroepke/helm-secrets can use sops and it can generate both plain values, Secrets or whatever else. The downside over sealed secrets is that whoever has the key can view the credentials locally. Can be partially mitigated if we use non-gpg backend

@cardoe
Copy link
Contributor Author

cardoe commented Mar 7, 2024

Yeah maybe the docs give a couple of suggested options and that's one?

@cardoe cardoe force-pushed the openstack-secrets branch from 2ff8e7f to 8cec26c Compare March 7, 2024 21:29
@cardoe cardoe changed the title wip: another secrets idea feat: load secrets for OpenStack Helm via a values file Mar 7, 2024
@cardoe cardoe marked this pull request as ready for review March 7, 2024 21:34
@cardoe cardoe force-pushed the openstack-secrets branch from 12c62a4 to eb61015 Compare March 14, 2024 18:52
@cardoe
Copy link
Contributor Author

cardoe commented Mar 19, 2024

The goal with this is to make it easier for folks to run the helm commands and to be less opinionated about the secrets storage.

@cardoe
Copy link
Contributor Author

cardoe commented Mar 19, 2024

So to provide some more context:

  1. remove using Sealed Secrets for OpenStack Helm components, which removes the need for the post-renderer
  2. Put secrets into a values file instead of creating them as separate files and then loading them dynamically from the cluster

This should make us less opinionated and easier to use.

@cardoe
Copy link
Contributor Author

cardoe commented Mar 19, 2024

Ultimately the helm commands go from:

helm --namespace openstack template \
     ironic \
    ./openstack-helm/ironic/ \
    -f components/13-ironic/aio-values.yaml \
    --set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
    --set endpoints.oslo_db.auth.ironic.password="$(kubectl --namespace openstack get secret ironic-db-password -o jsonpath='{.data.password}' | base64 -d)" \
    --set endpoints.oslo_messaging.auth.ironic.password="$(kubectl --namespace openstack get secret ironic-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)" \
    --set endpoints.identity.auth.ironic.password="$(kubectl --namespace openstack get secret ironic-keystone-password -o jsonpath='{.data.password}' | base64 -d)" \
    | kubectl -n openstack apply -f -

to

helm --namespace openstack template \
     ironic \
    ./openstack-helm/ironic/ \
    -f components/13-ironic/aio-values.yaml \
    -f secret-openstack.yaml \
    | kubectl -n openstack apply -f -

I also wrapped up the helm call with kustomize since we've done that in every other component.

@cardoe cardoe force-pushed the openstack-secrets branch from eb61015 to f143722 Compare March 19, 2024 14:47
scripts/gen-os-secrets.sh Show resolved Hide resolved
Copy link
Collaborator

@skrobul skrobul left a comment

Choose a reason for hiding this comment

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

previous review was supposed to be with Approve, not Request changes, sorry

cardoe and others added 4 commits March 20, 2024 08:44
Move the loading of the OpenStack secrets into populating a values file
that can be supplied to the helm command. In theory now a user could
supply this file separately and use GitOps to install the OpenStack Helm
components.
Since we're applying this immediately and not storing it, we don't need
to run this through sealed secrets.
Switched to the published helm chart repo for the OpenStack components
and change to using kustomize to execute helm like the other components
are.
Co-authored-by: Marek Skrobacki <[email protected]>
@cardoe cardoe force-pushed the openstack-secrets branch from 6ef39b3 to 0656c60 Compare March 20, 2024 13:44
@cardoe cardoe requested a review from skrobul March 20, 2024 13:44
@cardoe cardoe merged commit fbec37a into main Mar 20, 2024
7 checks passed
@cardoe cardoe deleted the openstack-secrets branch March 20, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants