thor@jump-host ~/serj2t-kodekloud-drupal$ thor@jump-host ~$ ls -l /drupal-mysql-data
total 188488
-rw-r----- 1 999 ping 56 May 15 13:00 auto.cnf
-rw------- 1 999 ping 1676 May 15 13:00 ca-key.pem
-rw-r–r-- 1 999 ping 1112 May 15 13:00 ca.pem
-rw-r–r-- 1 999 ping 1112 May 15 13:00 client-cert.pem
-rw------- 1 999 ping 1680 May 15 13:00 client-key.pem
drwxr-x— 2 999 ping 4096 May 15 13:00 drupal
-rw-r----- 1 999 ping 1318 May 15 13:00 ib_buffer_pool
-rw-r----- 1 999 ping 50331648 May 15 13:00 ib_logfile0
-rw-r----- 1 999 ping 50331648 May 15 13:00 ib_logfile1
-rw-r----- 1 999 ping 79691776 May 15 13:00 ibdata1
-rw-r----- 1 999 ping 12582912 May 15 13:00 ibtmp1
drwxr-x— 2 999 ping 4096 May 15 13:00 mysql
lrwxrwxrwx 1 999 ping 27 May 15 13:00 mysql.sock → /var/run/mysqld/mysqld.sock
drwxr-x— 2 999 ping 4096 May 15 13:00 performance_schema
-rw------- 1 999 ping 1680 May 15 13:00 private_key.pem
-rw-r–r-- 1 999 ping 452 May 15 13:00 public_key.pem
-rw-r–r-- 1 999 ping 1112 May 15 13:00 server-cert.pem
-rw------- 1 999 ping 1680 May 15 13:00 server-key.pem
drwxr-x— 2 999 ping 12288 May 15 13:00 sys
thor@jump-host ~$
thor@jump-host ~$
thor@jump-host ~$ k get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE
drupal-mysql-pv 5Gi RWO Retain Bound default/drupal-mysql-pvc 8m58s
thor@jump-host ~$ k get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
drupal-mysql-pvc Bound drupal-mysql-pv 5Gi RWO local-path 8m56s
thor@jump-host ~$
Could you p;lease share more details of the task?
Like, if it’s from Linux domain or from 100DaysofDevops?
Hi, this is kubernetes Level4 Task 4
Deploy Drupal App on Kubernetes
As per the error, I think you got your PV wrong. It should look somthing like this:
apiVersion: v1
kind: PersistentVolume
metadata:
name: drupal-mysql-pv
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/drupal-mysql-data"
Could you please try this again?
My pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: drupal-mysql-pv
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
local:
path: /drupal-mysql-data
claimRef:
name: drupal-mysql-pvc
namespace: default
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- jump-host
and you can see, what pvc is bound, also you can see a data on folder /drupal-mysql-data
The PV in the lab may be bound, but the task specifically says
Configure a persistent volume drupal-mysql-pv with hostPath = /drupal-mysql-data …
So try using hostPath instead.
Thanks Bro! It’s my bad.
Now is Ok.
Works with “hostPath”
