K8S level 3 exercise "Deploy Lamp Stack on Kubernetes Cluster"

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.

Hi @Mundofik

I guess you have not copied the index.php into the container.
You can refer to the solution for the task here.

Regards.

Yes yes, I did. I had a look at that solution and what I did seems to be pretty much the same :confused: That’s why I do not get where I failed. I will try doing it again.

I am trying it again today, but there are connectivity issues within your platform…



Opening new terminals does not help. I cannot run any command and the time is slowly ending

Just seen this:

Failing this lab will delete my streak. Can it please be reset, as it the issues I am having are not my fault. but kk platform?
Thanks.