/
nfs-server.yaml
48 lines (47 loc) · 1.09 KB
/
nfs-server.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# Adapted from https://medium.com/platformer-blog/nfs-persistent-volumes-with-kubernetes-a-case-study-ce1ed6e2c266
#
# Assuming PersistentVolume was created with:
#
# gcloud compute disks create --size=500GB --zone=us-west1-a --type pd-ssd pd
#
# Deploy by running:
#
# kubectl apply -f nfs-server.yaml
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: nfs-server
spec:
replicas: 1
selector:
matchLabels:
role: nfs-server
template:
metadata:
labels:
role: nfs-server
spec:
nodeSelector:
cloud.google.com/gke-nodepool: default-pool
containers:
- name: nfs-server
image: gcr.io/google_containers/volume-nfs:0.8
ports:
- name: nfs
containerPort: 2049
- name: mountd
containerPort: 20048
- name: rpcbind
containerPort: 111
securityContext:
privileged: true
volumeMounts:
- mountPath: /exports
name: pd
volumes:
- name: pd
gcePersistentDisk:
pdName: pd
fsType: ext4