Hello, I have tried the exercise in object
but I get “Unable to Connect to ‘host’” message in the UI.
It seems that the value of the host is not retrieved and I cannot get why. Should I include something specific for the host?
In the pod template inside the deploy I have added the mountPath + subPath, as I was getting this error at the beginning
My deploy config is copied here below. Sorry for the length of the message, but it is not possible to add txt files.
apiVersion: apps/v1
kind: Deployment
metadata:
name: lamp-wp
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: httpd-php-container
image: webdevops/php-apache:alpine-3-php7
ports:
- containerPort: 80
volumeMounts:
- name: php-ini
mountPath: /opt/docker/etc/php/php.ini
subPath: php.ini
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-root-passwd
key: key1
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-db
key: key1
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-user
key: key1
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwd
key: key1
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
name: mysql-host
key: key1
- name: mysql-container
image: mysql:5.6
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-root-passwd
key: key1
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-db
key: key1
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-user
key: key1
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwd
key: key1
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
name: mysql-host
key: key1
volumes:
- name: php-ini
configMap:
name: php-config
Thanks in advance.