This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdeployment.yaml
111 lines (96 loc) · 2.31 KB
/
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
# vim:set sw=2 ts=2 et:
#
# Copyright (c) 2017 Torchbox Ltd.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely. This software is provided 'as-is', without any express or implied
# warranty.
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: kube-system
name: hostpath-provisioner
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: hostpath-provisioner
subjects:
- kind: ServiceAccount
name: hostpath-provisioner
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:persistent-volume-provisioner
---
# The default system:persistent-volume-provisioner role in Kubernetes 1.8 is
# insufficient:
#
# I1007 18:09:10.073558 1 controller.go:874] cannot start watcher for PVC default/testpvc: events is forbidden: User "system:serviceaccount:kube-system:hostpath-provisioner" cannot list events in the namespace "default": access denied
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: hostpath-provisioner-extra
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
- list
- get
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hostpath-provisioner-extra
subjects:
- kind: ServiceAccount
namespace: kube-system
name: hostpath-provisioner
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: hostpath-provisioner-extra
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hostpath-provisioner
namespace: kube-system
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: /volumes
containers:
- name: hostpath-provisioner
image: torchbox/k8s-hostpath-provisioner:latest
volumeMounts:
- name: volumes
mountPath: /volumes
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi