[Example] persistent local volume test #513
taylor
started this conversation in
Show and tell
Replies: 1 comment
-
https://gist.github.com/taylor/d5e0ec09c0f4030fdf49b4113ca6a39a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Testing local persistent volumes in kind
Reference:
Create Kind cluster
If you open a new shell set KUBECONFIG, eg.
export KUBECONFIG=$(pwd)/localvoltest.conf
Create persistent volume config then load it. Configure the path you want to use for the volume. I used
/var/tmp
. See manual-pv.yamlNote: the hostname for affinity is matching what's in kind or it did not work for me
Create persistent volume claim config then apply it to the cluster. See simple-pvc.yaml
Start an pod which writes to a file in the persistent volume. To show more of how not to do things I'm starting a multiple replicas in my example which all write to the same file w/o properly dealing with lock files :) See #local-writer.yaml. Load with
Start another pod to read from the file in the same volume. See local-reader.yaml
Monitor the data being written to the local file via the local-reader pod logs:
Cleanup the volumes and pods
Delete the kind cluster:
kind delete cluster --name localvoltest
Beta Was this translation helpful? Give feedback.
All reactions