Last active
June 2, 2023 20:01
-
-
Save noseka1/01b7aaad22d0d0f6010323bf0ab61f0f to your computer and use it in GitHub Desktop.
Share NFS volume across multiple pods
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: nfs-example | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: nfs-example | |
template: | |
metadata: | |
labels: | |
app: nfs-example | |
spec: | |
containers: | |
- image: quay.io/noseka1/openshift-toolbox:basic | |
name: nfs-example | |
volumeMounts: | |
- mountPath: /home/toolbox | |
name: nfs-example | |
volumes: | |
- name: nfs-example | |
persistentVolumeClaim: | |
claimName: nfs-example |
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: Pod | |
metadata: | |
name: nfs-example | |
spec: | |
containers: | |
- image: quay.io/noseka1/openshift-toolbox:basic | |
name: nfs-example | |
volumeMounts: | |
- mountPath: /home/toolbox | |
name: nfs-example | |
volumes: | |
- name: nfs-example | |
persistentVolumeClaim: | |
claimName: nfs-example |
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: nfs-example | |
spec: | |
capacity: | |
storage: 1Gi | |
accessModes: | |
- ReadWriteMany | |
nfs: | |
path: /home/toolbox | |
server: 10.131.3.48 | |
storageClassName: nfs-example | |
# claimRef: | |
# name: nfs-example | |
# namespace: xyz |
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: nfs-example | |
spec: | |
accessModes: | |
- ReadWriteMany | |
resources: | |
requests: | |
storage: 1Gi | |
storageClassName: nfs-example | |
volumeName: nfs-example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment