forked from torchbox/k8s-hostpath-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-deployment.yaml
112 lines (110 loc) · 2.44 KB
/
example-deployment.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
apiVersion: v1
kind: Namespace
metadata:
name: ps-gfs
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hostpath-provisioner
namespace: ps-gfs
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hostpath-provisioner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hostpath-provisioner
subjects:
- kind: ServiceAccount
name: hostpath-provisioner
namespace: ps-gfs
roleRef:
kind: ClusterRole
name: hostpath-provisioner
apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-hostpath-provisioner
namespace: ps-gfs
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "update", "patch", "list", "watch", "create"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-hostpath-provisioner
namespace: ps-gfs
subjects:
- kind: ServiceAccount
name: hostpath-provisioner
namespace: ps-gfs
roleRef:
kind: Role
name: leader-locking-hostpath-provisioner
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hostpath-provisioner
namespace: ps-gfs
spec:
replicas: 1
selector:
matchLabels:
app: hostpath-provisioner
strategy:
type: Recreate
template:
metadata:
labels:
app: hostpath-provisioner
spec:
serviceAccountName: hostpath-provisioner
volumes:
- name: volumes
hostPath:
path: /mnt/gfs
containers:
- name: hostpath-provisioner
imagePullPolicy: Always
image: owps/k8s-hostpath-provisioner
volumeMounts:
- name: volumes
mountPath: /mnt/gfs
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gfs
provisioner: torchbox.com/hostpath
parameters:
pvDir: /mnt/gfs