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

Use environment variables instead of k8s secret for passwords #902

Open
chrism417 opened this issue Sep 5, 2023 · 1 comment
Open

Use environment variables instead of k8s secret for passwords #902

chrism417 opened this issue Sep 5, 2023 · 1 comment

Comments

@chrism417
Copy link

When deploying the cluster, is there some other way to set the password for the root/app user other than a k8s secret?

The only place I see to set the passwords are here: https://github.com/bitpoke/mysql-operator/blob/master/deploy/charts/mysql-cluster/values.yaml#L14-L17 which requires a kubernetes secret.

For example, is there a way to use a SecretProviderClass?

@zozidalom
Copy link

I don't know about an option for this unfortunately, but the workaround I found was this:

In Gitlab CI/CD to use an environment variable to setup the config I use helmfile and I created a File type CI/CD variable for the values.yaml file of my chart which contains my mysql-cluster.

Then in the secret I just read the variables from the values.yaml file.

apiVersion: v1
kind: Secret
metadata:
  name: my-mysql
type: Opaque
data:
  ROOT_PASSWORD: {{ .Values.rootPassword | b64enc }}
  DATABASE: {{ .Values.database | b64enc }}
  USER: {{ .Values.user | b64enc }}
  PASSWORD: {{ .Values.password | b64enc }}

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

No branches or pull requests

2 participants