-
-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathkind-pvc-hostpath.yaml
113 lines (113 loc) · 2.64 KB
/
kind-pvc-hostpath.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
113
---
apiVersion: v1
kind: Namespace
metadata:
name: local-storage
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hostpath-provisioner
namespace: local-storage
---
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: local-storage
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: local-storage
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "update", "patch"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["list", "watch", "create"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-hostpath-provisioner
namespace: local-storage
subjects:
- kind: ServiceAccount
name: hostpath-provisioner
namespace: local-storage
roleRef:
kind: Role
name: leader-locking-hostpath-provisioner
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hostpath-provisioner
namespace: local-storage
labels:
app: hostpath-provisioner
spec:
replicas: 3
selector:
matchLabels:
app: hostpath-provisioner
template:
metadata:
labels:
app: hostpath-provisioner
spec:
containers:
- name: hostpath-provisioner
image: mauilion/hostpath-provisioner:dev
imagePullPolicy: "IfNotPresent"
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: pv-volume
mountPath: /tmp/hostpath-provisioner
serviceAccountName: hostpath-provisioner
volumes:
- name: pv-volume
hostPath:
path: /tmp/hostpath-provisioner
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: standard
annotations:
storageclass.kubernetes.io/is-default-class: "true"
reclaimPolicy: Retain
provisioner: example.com/hostpath