- Create the following folder structure:
Mac/Linux: /tmp/data/db Windows: c:/temp/data/db
-
If you're on Windows go into mongo.deployment.yml and change the PVs local path to /c/temp/data/db. Save the file.
-
Run the following to add the database passwords as secrets:
kubectl create secret generic db-passwords --from-literal=db-password='password' --from-literal=db-root-password='password'
-
Start everything
kubectl create -f .k8s
-
Wait until all the pods are available (check via http:https://localhost)
-
Get the name of the mongo pod.
-
Delete the mongo Pod: kubectl delete pod [mongo-pod-name]
-
Once the pod is deleted, run kubectl get pv and note the reclaim policy that's shown and the status (should show Bound since the policy was Retain
-
Delete everything else:
kubectl delete -f .k8s