Hi team,
I have completed this task and was able to connect to the DB successfully. I used ‘envFrom’ instead of ‘env’. And there’s no option to submit this task for review.

code snippet:
spec:
containers:
- image: webdevops/php-apache:alpine-3-php7
name: httpd-php-container
envFrom:
- secretRef:
name: db-secrets
volumeMounts:
- name: php-config-volume
mountPath: /opt/docker/etc/php/php.ini
subPath: php.ini
- image: mysql:5.6
name: mysql-container
envFrom:
- secretRef:
name: db-secrets
volumes:
- name: php-config-volume
configMap:
name: php-config
kubectl create secret generic db-secrets --from-literal MYSQL_USER=mysqluser
–from-literal MYSQL_PASSWORD=mysqlpass --from-literal MYSQL_HOST=mysql-service
–from-literal MYSQL_DATABASE=mysqldb --from-literal MYSQL_ROOT_PASSWORD=mysqlrootpass
Could you please review?
Thanks,
Vijay