Deploy MySQL on Kubernetes - Failed

Hi @Inderpreet / @Tej-Singh-Rana,

Another system issue?

The error is “DB credentials are not working”

echo “YUIidhb667” | base64
WVVJaWRoYjY2Nwo=
echo “kodekloud_joy” | base64
a29kZWtsb3VkX2pveQo=
echo “8FmzjvFU6S” | base64
OEZtemp2RlU2Uwo=
echo “kodekloud_db5” | base64
a29kZWtsb3VkX2RiNQo=


apiVersion: v1
data:
password: WVVJaWRoYjY2Nwo=
kind: Secret
metadata:
name: mysql-root-pass
type: Opaque


apiVersion: v1
data:
username: a29kZWtsb3VkX2pveQo=
password: OEZtemp2RlU2Uwo=
kind: Secret
metadata:
name: mysql-user-pass
type: Opaque


apiVersion: v1
data:
database: a29kZWtsb3VkX2RiNQo=
kind: Secret
metadata:
name: mysql-db-url
type: Opaque

What is the error you have? can you share a screenshot of it? Also, Can you share the deployment yaml file? you can follow this example to test your secrets Distribute Credentials Securely Using Secrets | Kubernetes

@Ayman,

  1. Found my mistake, I didn’t use ‘-n’ when convert,

$ echo “YUIidhb667” | base64
WVVJaWRoYjY2Nwo=

$ echo -n “YUIidhb667” | base64
WVVJaWRoYjY2Nw==

  1. HOWEVER what’s interesting when I verified (without ‘-n’), it shows the correct password, how can be?

kubectl get secrets mysql-root-pass --template={{.data.password}} | base64 -d
YUIidhb667