-
Notifications
You must be signed in to change notification settings - Fork 455
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
Tenant Helm chart: existingSecret does not make sense currently #1795
Comments
No. ExistingSecret if not set, operator will create a secret like that config
|
@jiuker You closed this issue probably a bit too early. I unsuccessfully tested setting an |
operator/helm/tenant/values.yaml Lines 292 to 307 in 09c2011
Have you tried this part? @stephan2012 |
TLDR;I got it working by passing in my secret name to the values.yaml: secrets:
# this field is more like a boolean. if it's empty, minio creates a secret
# if it's NOT empty, minio doesn't create a secret, but does not use this secret
existingSecret: default-tenant-env-config
# this is where the secret name actually gets defined
tenant:
configuration:
name: default-tenant-env-config Example secret: apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: default-tenant-env-config
namespace: minio
data:
config.env: TUlOSU9fUk9PVF9VU0VSPW1pbmlvYWRtaW4KICAgICAgICBNSU5JT19ST09UX1BBU1NXT1JEPUQ2bVluelB1NDZPdFJGZ1M3OHR0Vk5SOHFwcFJJZmQ1 Example secret value decoded: $ kubectl get secret default-tenant-env-config -n minio -o yaml | yq .data[] | base64 --decode
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=D6mYnzPu46OtRFgS78ttVNR8qppRIfd5 further addressing of the tenant helm chart@jiuker this value does not current get used anywhere: operator/helm/tenant/values.yaml Line 9 in d653dc1
I ran the following from the $ ag existingSecret
values.yaml
8: ## Set the value for existingSecret to use a pre created secret and dont create default one
9: # existingSecret: random-env-configuration
297:# existingSecret: custom-env-configuration
304:# name: {{ dig "secrets" "existingSecret" "" (.Values | merge (dict)) }}
templates/tenant-configuration.yaml
1:{{- if not .Values.secrets.existingSecret }} If it's not going to be used and is just a boolean, it should be set to a boolean with a comment explaining that you need to set the The most common reason to use an existingSecret to is avoid plain text credentials in the values file for security sake, so setting the plain text root credentials in If I use the Could you point me to where in the code base here this existing Secret gets parsed? Is it here?: operator/pkg/controller/tenants.go Lines 40 to 45 in d653dc1
Because if that's the case, it looks like the operator/pkg/apis/minio.min.io/v2/helper.go Lines 1053 to 1072 in d653dc1
here's the export bit being trimmed: operator/pkg/apis/minio.min.io/v2/helper.go Line 1025 in d653dc1
I think the best way to accept and parse secrets going forward is to use key/value pairs from a secret that looks like this: apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: my-existing-secret
stringData:
MINIO_ROOT_USER: 'minio'
MINIO_ROOT_PASSWORD: 'minio123' This makes it easier to template and a bit more Kubernetes native the secret as in-line shell commands are bit combersome. It also makes it so that you can use them as env vars for pods, deployments and statefulsets a bit easier like this: https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data |
Yes, in the current operator/helm/tenant/values.yaml Lines 35 to 36 in 856c422
while the template expects it to be at
But yeah, definitely agree with @jessebot that this should be refactored to use |
+1 refactoring for |
Reading thru this, the single issue is reframing Any other refactoring should be considered in a separate feature request. |
Fixed by #1795 |
Is your feature request related to a problem? Please describe.
Looking at the tenant Helm chart, the description for the
existingSecret
parameter statesHowever, the only consequence of setting a value here is that it disables creating a Kubernetes Secret. Somewhat counterintuitively, the templates do not pick it up to provide the root credentials. Instead, the root credentials have to be passed “manually”.
Describe the solution you'd like
Incorporate a given secret name into the configuration.
Describe alternatives you've considered
Alternatively, replace the Secret name with a toggle switch because it de-facto acts as such currently. This introduces a breaking change, of course.
Additional context
N/A
Kindly let me know if you are interested in a PR.
The text was updated successfully, but these errors were encountered: