Let's explore persistent volumes (PVs):
- In our case, run the following describe nodes command:
kc describe nodes
The preceding command gives the following output:
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits
default handsonaks-wp-mariadb-0 0 (0%) 0 (0%) 0 (0%) 0 (0%)
default handsonaks-wp-wordpress-6ddcfd5c89-p2925 300m (31%) 0 (0%) 512Mi (38%) 0 (0%)
- Are all pods on agent-0? Your pod placement may vary. To verify this run the following command:
ab443838-9b3e-4811-b287-74e417a9@Azure:~$ kc get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
data-handsonaks-wp-mariadb-0 Bound pvc-752cea13-0c73-11e9-9914-82000ff4ac53 8Gi RWO default 1h
handsonaks-wp-wordpress Bound pvc-74f785bc-0c73-11e9-9914-82000ff4ac53 10Gi RWO default 1h
The following command shows the PVCs that are bound to the pods:
kc get pv # the actual persistent volumes
...
Type: AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
DiskName: kubernetes-dynamic-pvc-74f785bc-0c73-11e9-9914-82000ff4ac53
DiskURI: /subscriptions/12736543-b466-490b-88c6-f1136a239821/resourceGroups/MC_cloud-shell-storage-westus_myhandsonaks_westus2/providers/Microsoft.Compute/disks/kubernetes-dynamic-pvc-74f785bc-0c73-11e9-9914-82000ff4ac53
...
# shows the actual disk backing up the PVC
- Verify that your site is actually working:
ab443838-9b3e-4811-b287-74e417a9@Azure:~$ kc get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
handsonaks-wp-wordpress LoadBalancer 10.0.78.128 <EXTERNAL-IP> 80:31425/TCP,443:31446/TCP 1h
- Log on to the site (using the Log In link) as follows:
helm status handsonaks-wp
echo Password: $(kubectl get secret --namespace default handsonaks-wp-wordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)
- Add a test post and click on Post Comment to publish it:
We will verify whether this post survives a reboot in the next section.