-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnfs-server-ephemeral.yml
82 lines (82 loc) · 1.9 KB
/
nfs-server-ephemeral.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nfs-server-alpine
app.kubernetes.io/component: nfs-server-alpine
app.kubernetes.io/instance: nfs-server-alpine
name: nfs-server-alpine
spec:
replicas: 1
selector:
matchLabels:
deployment: nfs-server-alpine
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
deployment: nfs-server-alpine
spec:
containers:
- env:
- name: SHARED_DIRECTORY
value: /nfsshare
- name: VOLUME_COUNT
value: "100"
image: itsthenetwork/nfs-server-alpine:12
imagePullPolicy: IfNotPresent
name: nfs-server-alpine
startupProbe:
exec:
command:
- pidof
- rpc.mountd
failureThreshold: 30
periodSeconds: 10
livenessProbe:
exec:
command:
- pidof
- rpc.mountd
readinessProbe:
exec:
command:
- pidof
- rpc.mountd
lifecycle:
postStart:
exec:
command:
- "/bin/sh"
- "-c"
- >
for dir in $(seq ${VOLUME_COUNT}); do mkdir -p $SHARED_DIRECTORY/pv$dir && chmod 777 $SHARED_DIRECTORY/pv$dir; done
securityContext:
privileged: true
volumeMounts:
- mountPath: /nfsshare
name: volume
volumes:
- emptyDir: {}
name: volume
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nfs-server-alpine
app.kubernetes.io/component: nfs-server-alpine
app.kubernetes.io/instance: nfs-server-alpine
name: nfs-server-alpine
spec:
ports:
- port: 2049
protocol: TCP
targetPort: 2049
selector:
deployment: nfs-server-alpine
type: ClusterIP