Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Stop using "cluster admin" role and restrict to k8s namespace (#3618)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-scott-hand authored Sep 21, 2020
1 parent c6f634b commit a3cda19
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions deploy/kubernetes/helm/templates/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a3cda19

Please sign in to comment.