Resources for mauilion.dev/posts/kind-pvc-local
-
-
Save mauilion/c40b161822598e5b1720d3b34487fb82 to your computer and use it in GitHub Desktop.
resources for mauilion.dev/posts/kind-pvc-local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: hostpath | |
| namespace: default | |
| labels: | |
| app: book | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: hostpath | |
| template: | |
| metadata: | |
| labels: | |
| app: hostpath | |
| spec: | |
| containers: | |
| - name: name | |
| image: gcr.io/google-containers/echoserver:1.10 | |
| volumeMounts: | |
| - mountPath: /data | |
| name: data | |
| volumes: | |
| - name: data | |
| hostPath: | |
| path: /tmp/data # this is the data on the underlying host! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: pvc | |
| namespace: default | |
| labels: | |
| app: book | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: pvc | |
| template: | |
| metadata: | |
| labels: | |
| app: pvc | |
| spec: | |
| containers: | |
| - name: name | |
| image: gcr.io/google-containers/echoserver:1.10 | |
| volumeMounts: | |
| - mountPath: /data | |
| name: data | |
| volumes: | |
| - name: data | |
| persistentVolumeClaim: | |
| claimName: book |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Cluster | |
| apiVersion: kind.x-k8s.io/v1alpha4 | |
| nodes: | |
| - role: control-plane | |
| extraMounts: | |
| - hostPath: ./data | |
| containerPath: /tmp/data | |
| - role: worker | |
| extraMounts: | |
| - hostPath: ./data | |
| containerPath: /tmp/data | |
| - role: worker | |
| extraMounts: | |
| - hostPath: ./data | |
| containerPath: /tmp/data | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: PersistentVolume | |
| metadata: | |
| name: book | |
| labels: | |
| app: book | |
| spec: | |
| storageClassName: manual | |
| capacity: | |
| storage: 20Gi | |
| accessModes: | |
| - ReadWriteMany | |
| claimRef: # the claimRef is here to provide a "connection" between this pv and the pvc. | |
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| name: book | |
| namespace: default | |
| hostPath: | |
| path: /tmp/data/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: book | |
| namespace: default | |
| labels: | |
| app: book | |
| spec: | |
| storageClassName: manual | |
| accessModes: | |
| - ReadWriteMany | |
| resources: | |
| requests: | |
| # The amount of the volume's storage to request | |
| storage: 20Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment