Import data to config map from kubernetes secret

Kubernetes can’t make that substitution for you, you should do it with shell in the entrypoint of the container. This is a working example. I modify the default entrypoint to create a new variable with that substitution. After this command you should add the desired entrypoint. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: app labels: app: … Read more

How to mount multiple files / secrets into common directory in kubernetes?

Projected Volume You can use a projected volume to have two secrets in the same directory Example apiVersion: v1 kind: Pod metadata: labels: run: alpine-secret name: alpine-secret spec: containers: – command: – sleep – “3600” image: alpine name: alpine-secret volumeMounts: – name: xyfiles mountPath: “/var/secrets/” readOnly: true volumes: – name: xyfiles projected: sources: – secret: … Read more

How to set secret files to kubernetes secrets by yaml?

As answered on previous post, we need to provide the certificate/key encoded as based64 to the file. Here is generic example for a certiticate (in this case SSL): The secret.yml.tmpl: apiVersion: v1 kind: Secret metadata: name: test-secret namespace: default type: Opaque data: server.crt: SERVER_CRT server.key: SERVER_KEY Pre-process the file to include the certificate/key: sed “s/SERVER_CRT/`cat … Read more

Can’t create Secret in Kubernetes: illegal base64 data at input

I got the decoded values “mega_secret_key” and “really_secret_value1” from from your encoded data. Seems they are not encoded in right way. So, encode your data in right way: $ echo “mega_secret_key” | base64 bWVnYV9zZWNyZXRfa2V5Cg== $ echo “really_secret_value1” | base64 cmVhbGx5X3NlY3JldF92YWx1ZTEK Then check whether they are encoded properly: $ echo “bWVnYV9zZWNyZXRfa2V5Cg==” | base64 -d mega_secret_key $ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)