-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo-nfs-flex-volume.yaml
57 lines (56 loc) · 1.51 KB
/
demo-nfs-flex-volume.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
49
50
51
52
53
54
55
56
57
apiVersion: apps/v1
kind: Deployment
metadata:
name: nfs-flex-vol
labels:
app: nfs-flex-vol
spec:
replicas: 1
selector:
matchLabels:
app: nfs-flex-vol
template:
metadata:
labels:
app: nfs-flex-vol
spec:
nodeSelector:
beta.kubernetes.io/os: windows
tolerations:
- key: "os"
operator: "Equal"
value: "windows"
effect: "NoSchedule"
containers:
- name: nfs-flex-vol
image: mcr.microsoft.com/powershell:7.1.0-preview.5-nanoserver-1809
imagePullPolicy: IfNotPresent
command:
- pwsh.exe
args:
- /Command
- Write-Output "$env:POD_NAME Started on $env:NODENAME at $(Get-Date)" >> /d/test.txt;
- ping -t 127.0.0.1 >> /d/test.txt
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODENAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: nfs-volume
mountPath: /d
volumes:
- name: nfs-volume
flexVolume:
driver: "nfs-win/nfs.cmd"
options:
# source can be in any of the following formats
# \\servername\share\path (\'s will need to be escaped)
# nfs://servername/share/path
# //servername/share/path
#source: "nfs://xxx-xxx.cn-shenzhen.nas.aliyuncs.com/!"
source: "nfs://10.20.1.4/var/nfs/general"