Skip to content
Permalink
Browse files
Stop using "cluster admin" role and restrict to k8s namespace (#3618)
  • Loading branch information
the-scott-hand committed Sep 21, 2020
1 parent c6f634b commit a3cda1954a34bf0d4cff3aade826e9f35a493c05
Showing 1 changed file with 36 additions and 5 deletions.
@@ -217,21 +217,52 @@ metadata:
k8s-app: {{ .Release.Name }}-apiserver

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Release.Name }}-apiserver
labels:
app: {{ .Release.Name }}-apiserver
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
kind: Role
name: {{ .Release.Name }}-apiserver
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-apiserver
namespace: {{ .Release.Namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Release.Name }}-apiserver
rules:
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

---
apiVersion: v1
kind: Service

0 comments on commit a3cda19

Please sign in to comment.