|
| 1 | +##### Node Service Account, Roles, RoleBindings |
| 2 | +apiVersion: v1 |
| 3 | +kind: ServiceAccount |
| 4 | +metadata: |
| 5 | + name: csi-gce-pd-node-sa |
| 6 | + |
| 7 | +--- |
| 8 | +##### Controller Service Account, Roles, Rolebindings |
| 9 | +apiVersion: v1 |
| 10 | +kind: ServiceAccount |
| 11 | +metadata: |
| 12 | + name: csi-gce-pd-controller-sa |
| 13 | + |
| 14 | +--- |
| 15 | +# xref: https://github.com/kubernetes-csi/external-provisioner/blob/master/deploy/kubernetes/rbac.yaml |
| 16 | +kind: ClusterRole |
| 17 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 18 | +metadata: |
| 19 | + name: csi-gce-pd-provisioner-role |
| 20 | +rules: |
| 21 | + - apiGroups: [""] |
| 22 | + resources: ["persistentvolumes"] |
| 23 | + verbs: ["get", "list", "watch", "create", "delete"] |
| 24 | + - apiGroups: [""] |
| 25 | + resources: ["persistentvolumeclaims"] |
| 26 | + verbs: ["get", "list", "watch", "update"] |
| 27 | + - apiGroups: ["storage.k8s.io"] |
| 28 | + resources: ["storageclasses"] |
| 29 | + verbs: ["get", "list", "watch"] |
| 30 | + - apiGroups: [""] |
| 31 | + resources: ["events"] |
| 32 | + verbs: ["list", "watch", "create", "update", "patch"] |
| 33 | + - apiGroups: ["storage.k8s.io"] |
| 34 | + resources: ["csinodes"] |
| 35 | + verbs: ["get", "list", "watch"] |
| 36 | + - apiGroups: [""] |
| 37 | + resources: ["nodes"] |
| 38 | + verbs: ["get", "list", "watch"] |
| 39 | + - apiGroups: ["snapshot.storage.k8s.io"] |
| 40 | + resources: ["volumesnapshots"] |
| 41 | + verbs: ["get", "list"] |
| 42 | + - apiGroups: ["snapshot.storage.k8s.io"] |
| 43 | + resources: ["volumesnapshotcontents"] |
| 44 | + verbs: ["get", "list"] |
| 45 | +--- |
| 46 | + |
| 47 | +kind: ClusterRoleBinding |
| 48 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 49 | +metadata: |
| 50 | + name: csi-gce-pd-controller-provisioner-binding |
| 51 | +subjects: |
| 52 | + - kind: ServiceAccount |
| 53 | + name: csi-gce-pd-controller-sa |
| 54 | +roleRef: |
| 55 | + kind: ClusterRole |
| 56 | + name: csi-gce-pd-provisioner-role |
| 57 | + apiGroup: rbac.authorization.k8s.io |
| 58 | + |
| 59 | +--- |
| 60 | +# xref: https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml |
| 61 | +kind: ClusterRole |
| 62 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 63 | +metadata: |
| 64 | + name: csi-gce-pd-attacher-role |
| 65 | +rules: |
| 66 | + - apiGroups: [""] |
| 67 | + resources: ["persistentvolumes"] |
| 68 | + verbs: ["get", "list", "watch", "update", "patch"] |
| 69 | + - apiGroups: [""] |
| 70 | + resources: ["nodes"] |
| 71 | + verbs: ["get", "list", "watch"] |
| 72 | + - apiGroups: ["storage.k8s.io"] |
| 73 | + resources: ["csinodes"] |
| 74 | + verbs: ["get", "list", "watch"] |
| 75 | + - apiGroups: ["storage.k8s.io"] |
| 76 | + resources: ["volumeattachments"] |
| 77 | + verbs: ["get", "list", "watch", "update", "patch"] |
| 78 | + - apiGroups: ["storage.k8s.io"] |
| 79 | + resources: ["volumeattachments/status"] |
| 80 | + verbs: ["patch"] |
| 81 | +--- |
| 82 | + |
| 83 | +kind: ClusterRoleBinding |
| 84 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 85 | +metadata: |
| 86 | + name: csi-gce-pd-controller-attacher-binding |
| 87 | +subjects: |
| 88 | + - kind: ServiceAccount |
| 89 | + name: csi-gce-pd-controller-sa |
| 90 | +roleRef: |
| 91 | + kind: ClusterRole |
| 92 | + name: csi-gce-pd-attacher-role |
| 93 | + apiGroup: rbac.authorization.k8s.io |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +apiVersion: scheduling.k8s.io/v1 |
| 98 | +kind: PriorityClass |
| 99 | +metadata: |
| 100 | + name: csi-gce-pd-controller |
| 101 | +value: 900000000 |
| 102 | +globalDefault: false |
| 103 | +description: "This priority class should be used for the GCE PD CSI driver controller deployment only." |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +apiVersion: scheduling.k8s.io/v1 |
| 108 | +kind: PriorityClass |
| 109 | +metadata: |
| 110 | + name: csi-gce-pd-node |
| 111 | +value: 900001000 |
| 112 | +globalDefault: false |
| 113 | +description: "This priority class should be used for the GCE PD CSI driver node deployment only." |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +# Resizer must be able to work with PVCs, PVs, SCs. |
| 118 | +kind: ClusterRole |
| 119 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 120 | +metadata: |
| 121 | + name: csi-gce-pd-resizer-role |
| 122 | +rules: |
| 123 | + - apiGroups: [""] |
| 124 | + resources: ["persistentvolumes"] |
| 125 | + verbs: ["get", "list", "watch", "update", "patch"] |
| 126 | + - apiGroups: [""] |
| 127 | + resources: ["persistentvolumeclaims"] |
| 128 | + verbs: ["get", "list", "watch"] |
| 129 | + - apiGroups: [""] |
| 130 | + resources: ["persistentvolumeclaims/status"] |
| 131 | + verbs: ["update", "patch"] |
| 132 | + - apiGroups: [""] |
| 133 | + resources: ["events"] |
| 134 | + verbs: ["list", "watch", "create", "update", "patch"] |
| 135 | + |
| 136 | +--- |
| 137 | +kind: ClusterRoleBinding |
| 138 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 139 | +metadata: |
| 140 | + name: csi-gce-pd-resizer-binding |
| 141 | +subjects: |
| 142 | + - kind: ServiceAccount |
| 143 | + name: csi-gce-pd-controller-sa |
| 144 | +roleRef: |
| 145 | + kind: ClusterRole |
| 146 | + name: csi-gce-pd-resizer-role |
| 147 | + apiGroup: rbac.authorization.k8s.io |
| 148 | + |
| 149 | +--- |
| 150 | +apiVersion: policy/v1beta1 |
| 151 | +kind: PodSecurityPolicy |
| 152 | +metadata: |
| 153 | + name: csi-gce-pd-node-psp |
| 154 | +spec: |
| 155 | + seLinux: |
| 156 | + rule: RunAsAny |
| 157 | + supplementalGroups: |
| 158 | + rule: RunAsAny |
| 159 | + runAsUser: |
| 160 | + rule: RunAsAny |
| 161 | + fsGroup: |
| 162 | + rule: RunAsAny |
| 163 | + privileged: true |
| 164 | + volumes: |
| 165 | + - '*' |
| 166 | + hostNetwork: true |
| 167 | + allowedHostPaths: |
| 168 | + - pathPrefix: "/var/lib/kubelet/plugins_registry/" |
| 169 | + - pathPrefix: "/var/lib/kubelet" |
| 170 | + - pathPrefix: "/var/lib/kubelet/plugins/pd.csi.storage.gke.io/" |
| 171 | + - pathPrefix: "/dev" |
| 172 | + - pathPrefix: "/etc/udev" |
| 173 | + - pathPrefix: "/lib/udev" |
| 174 | + - pathPrefix: "/run/udev" |
| 175 | + - pathPrefix: "/sys" |
| 176 | +--- |
| 177 | + |
| 178 | +kind: ClusterRole |
| 179 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 180 | +metadata: |
| 181 | + name: csi-gce-pd-node-deploy |
| 182 | +rules: |
| 183 | + - apiGroups: ['policy'] |
| 184 | + resources: ['podsecuritypolicies'] |
| 185 | + verbs: ['use'] |
| 186 | + resourceNames: |
| 187 | + - csi-gce-pd-node-psp |
| 188 | +--- |
| 189 | + |
| 190 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 191 | +kind: ClusterRoleBinding |
| 192 | +metadata: |
| 193 | + name: csi-gce-pd-node |
| 194 | +roleRef: |
| 195 | + apiGroup: rbac.authorization.k8s.io |
| 196 | + kind: ClusterRole |
| 197 | + name: csi-gce-pd-node-deploy |
| 198 | +subjects: |
| 199 | +- kind: ServiceAccount |
| 200 | + name: csi-gce-pd-node-sa |
| 201 | + |
| 202 | +--- |
| 203 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 204 | +kind: ClusterRoleBinding |
| 205 | +metadata: |
| 206 | + name: csi-gce-pd-controller |
| 207 | +roleRef: |
| 208 | + apiGroup: rbac.authorization.k8s.io |
| 209 | + kind: ClusterRole |
| 210 | + name: csi-gce-pd-node-deploy |
| 211 | +subjects: |
| 212 | +- kind: ServiceAccount |
| 213 | + name: csi-gce-pd-controller-sa |
| 214 | + |
| 215 | +--- |
| 216 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 217 | +kind: ClusterRole |
| 218 | +metadata: |
| 219 | + name: csi-gce-pd-snapshotter-role |
| 220 | +rules: |
| 221 | + - apiGroups: [""] |
| 222 | + resources: ["events"] |
| 223 | + verbs: ["list", "watch", "create", "update", "patch"] |
| 224 | + # Secrets resource omitted since GCE PD snapshots does not require them |
| 225 | + - apiGroups: ["snapshot.storage.k8s.io"] |
| 226 | + resources: ["volumesnapshotclasses"] |
| 227 | + verbs: ["get", "list", "watch"] |
| 228 | + - apiGroups: ["snapshot.storage.k8s.io"] |
| 229 | + resources: ["volumesnapshotcontents"] |
| 230 | + verbs: ["create", "get", "list", "watch", "update", "delete"] |
| 231 | + - apiGroups: ["snapshot.storage.k8s.io"] |
| 232 | + resources: ["volumesnapshotcontents/status"] |
| 233 | + verbs: ["update"] |
| 234 | +--- |
| 235 | + |
| 236 | +kind: ClusterRoleBinding |
| 237 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 238 | +metadata: |
| 239 | + name: csi-gce-pd-controller-snapshotter-binding |
| 240 | +subjects: |
| 241 | + - kind: ServiceAccount |
| 242 | + name: csi-gce-pd-controller-sa |
| 243 | +roleRef: |
| 244 | + kind: ClusterRole |
| 245 | + name: csi-gce-pd-snapshotter-role |
| 246 | + apiGroup: rbac.authorization.k8s.io |
0 commit comments