Skip to content

Instantly share code, notes, and snippets.

@unya
Created October 1, 2017 13:55
Show Gist options
  • Save unya/702c2a5a9379365ef0904a471283d677 to your computer and use it in GitHub Desktop.
Save unya/702c2a5a9379365ef0904a471283d677 to your computer and use it in GitHub Desktop.
NFS + PV + PVC on GKE
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: volume-test
spec:
replicas: 2
selector:
matchLabels:
app: volume-test
template:
metadata:
name: volume-test
labels:
app: volume-test
spec:
volumes:
- name: ssl-certs
hostPath:
path: /etc/ssl/certs
- name: volume
persistentVolumeClaim:
claimName: volume
containers:
- name: volume-test
image: ubuntu
imagePullPolicy: Always
volumeMounts:
- name: volume
mountPath: /mnt/volume
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: volume
namespace: default
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
nfs:
server: shared-storage-vm.c.gcp-project.internal
path: "/data/volume"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: volume
namespace: default
spec:
storageClassName: ""
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment