Why my Root Directory is empty when my docker image is deployed on a managed Kubernetes cluster?
Hi. I have created a local docker image and deployed it to a managed kubernetes cluster. I have tested the image locally and works. But when I deploy to the kubernetes cluster I am getting an error from Apache that the Root Directory is empty. I know that the MySQL server installation is missing. At tis step I wish to make sure that the pho files are correctly deployed.
This is my Dockerfile:
FROM php:7.4-apache COPY wordpress/ /var/www/html RUN chmod -R 755 /var/www/html EXPOSE 80
And these are my YAML files to setup the kubernetes cluster:
apiVersion: v1 kind: Service metadata: name: wordpress labels: app: wordpress spec: ports: - port: 80 selector: app: wordpress type: LoadBalancer --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: wp-pv-claim labels: app: wordpress spec: accessModes: - ReadWriteOnce storageClassName: do-block-storage resources: requests: storage: 1Gi #put here your required storage capacity --- apiVersion: apps/v1 kind: Deployment metadata: name: wordpress labels: app: wordpress spec: selector: matchLabels: app: wordpress strategy: type: Recreate template: metadata: labels: app: wordpress spec: containers: - name: wordpress image: ......my Docker Hub Image..... ports: - containerPort: 80 name: wordpress volumeMounts: - name: wordpress-persistent-storage mountPath: /var/www/html #default root path for webserver imagePullSecrets: - name: docker-hub-cred #credentials to sync with Docker Hub & pull the image volumes: - name: wordpress-persistent-storage persistentVolumeClaim: claimName: wp-pv-claim
I have connected to the local docker container and executed the ls command in the root directory and I can see the wordpress files, but when doing the same on the deployed pod, I am getting an empty root directory.
Any suggestions what is wrong?