HI All, I've got an MYSQL error with the Bravos deployment in the Game of Pods L . . .

Markeen Rice-Wallace:
HI All, I’ve got an MYSQL error with the Bravos deployment in the Game of Pods Lab. It’s complaining that the secret env vars are incompatible for the configuration of the drupal-mysql deployment.
> NAME READY STATUS RESTARTS AGE
> drupal-mysql-6b64486999-rfqss 0/1 Error 1 16s
> controlplane $ kubectl logs drupal-mysql-6b64486999-rfqss
> 2021-03-29 11:11:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
> 2021-03-29 11:11:56+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
> 2021-03-29 11:11:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
> 2021-03-29 11:11:56+00:00 [ERROR] [Entrypoint]: MYSQL_USER=“root”, MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user
> Remove MYSQL_USER=“root” and use one of the following to control the root user password:
> - MYSQL_ROOT_PASSWORD
> - MYSQL_ALLOW_EMPTY_PASSWORD
> - MYSQL_RANDOM_ROOT_PASSWORD
My Deployment manifest & Secret manifest.

apiVersion: v1
data:
  MYSQL_DATABASE: ZHJ1cGFsLWRhdGFiYXNl
  MYSQL_ROOT_PASSWORD: cm9vdF9wYXNzd29yZA==
  MYSQL_USER: cm9vdA==
kind: Secret
metadata:
  creationTimestamp: "2021-03-29T11:02:25Z"
  name: drupal-mysql-secret
  namespace: default
  resourceVersion: "2784"
  selfLink: /api/v1/namespaces/default/secrets/drupal-mysql-secret
  uid: 3eb982c0-907e-11eb-bd67-0242ac110036
type: Opaque
---
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: drupal-mysql
  name: drupal-mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drupal-mysql
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: drupal-mysql
    spec:
      volumes:
        - name: drupal-mysql-pvc
          persistentVolumeClaim:
            claimName: drupal-mysql-pvc
      containers:
      - image: mysql:5.7
        name: mysql
        envFrom:
          - secretRef:
              name: drupal-mysql-secret
        volumeMounts:
          - mountPath: "/var/lib/mysql"
            subPath: "dbdata"
            name: drupal-mysql-pvc

Markeen Rice-Wallace:
Can I still complete this lab if I remove the MYSQL_USER=root env?

Markeen Rice-Wallace:
My work around has been to use the other values, instead of all the vars in that secret. If that var isn’t used, you might want to update the lab to no longer require it.

Markeen Rice-Wallace:
I got timed out on my env, but this lab can’t be done due to this issue. The lab expects this var to exist and won’t pass it.

I ran into the same problem. What I had to do was bring all secrets in via envFrom and then bring them all in as separate env declarations. The tests failed and the deployment would not start. I deleted it all and them applied my yaml again and magically it went through and I was presented with the magic phrase.

I have submitted a bug with the KK folks hoping it gets resolved for others.

Here is the deployment yaml that got me through it…

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: drupal-mysql
  name: drupal-mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drupal-mysql
  template:
    metadata:
      labels:
        app: drupal-mysql
    spec:
      containers:
      - image: mysql:5.7
        name: mysql
        env:
        - name: MYSQL_USER
          valueFrom:
            secretKeyRef:
              name: drupal-mysql-secret
              key: MYSQL_USER
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: drupal-mysql-secret
              key: MYSQL_ROOT_PASSWORD
        - name: MYSQL_DATABASE
          valueFrom:
            secretKeyRef:
              name: drupal-mysql-secret
              key: MYSQL_DATABASE
        envFrom:
        - secretRef:
            name: drupal-mysql-secret
        volumeMounts:
        - mountPath: "/var/lib/mysql"
          subPath: "dbdata"
          name: mypd
      volumes:
      - name: mypd
        persistentVolumeClaim:
          claimName: drupal-mysql-pvc