I am observing this error, though i think i have added completed all the points, but still not able to complete this task… any pointers or support…
For more clarity, below are the dyaml files are error message…
deployment yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: lamp-wp
spec:
replicas: 1
selector:
matchLabels:
app: lamp-wp
template:
metadata:
labels:
app: lamp-wp
spec:
containers:
- name: httpd-php-container
image: webdevops/php-apache:alpine-3-php7
volumeMounts:
- name: php-config-volume
mountPath: /opt/docker/etc/php
- name: app-volume
mountPath: /app
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-root-password
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-password
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-host
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-database
- name: mysql-container
image: mysql:5.6
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-root-password
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-password
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-host
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-secrets
key: mysql-database
volumes:
- name: php-config-volume
configMap:
name: php-config
- name: app-volume
configMap:
name: lamp-config
and this is secret file:
apiVersion: v1
data:
mysql-database: bXlzcWw=
mysql-host: bXlzcWw=
mysql-password: cGFzc3dvcmQ=
mysql-root-password: cGFzcw==
mysql-user: bXlzbA==
kind: Secret
metadata:
name: mysql-secrets
and this configmap:
apiVersion: v1
kind: ConfigMap
metadata:
name: php-config
data:
php.ini: |
variables_order = “EGPCS”
lamp-config configmap was created with --from-file --dry-run=client -o yaml and then replace the fixed values with getenv(‘’)… as /tmp/index.php was saved with root user and we don’t have access to modify the file…
Error detail:
thor@jump_host ~$ k get po
NAME READY STATUS RESTARTS AGE
lamp-wp-64c8f6d79b-txlwr 1/2 CrashLoopBackOff 1 (4s ago) 29s
thor@jump_host ~$ k logs -f lamp-wp-64c8f6d79b-txlwr -c httpd-php-container
→ Executing /opt/docker/provision/entrypoint.d/05-permissions.sh
→ Executing /opt/docker/provision/entrypoint.d/20-php-fpm.sh
cp: can’t stat ‘/opt/docker/etc/php/fpm/php-fpm.conf’: No such file or directory
I figured out the issue and the issue was with adding configmap at /opt/docker/etc/php, i tried to add with subpath and it worked as by adding with above way, all the other stuff available in the folder will be replaced… so subpath is the only available way for this…