Skip to content

Commit

Permalink
Adding role, rolebindings, clusterrole for web
Browse files Browse the repository at this point in the history
  • Loading branch information
sutekar1597 committed Jul 24, 2022
1 parent b430649 commit 2541bf6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions templates/web/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "pecan.fullname" . }}-web
labels:
{{- include "pecan.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs:
- get
- list
- watch
- update
2 changes: 2 additions & 0 deletions templates/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pecan.fullname" . }}-web
automountServiceAccountToken: false
initContainers:
- name: check-rabbitmq
image: "{{ $.Values.image.checks }}"
Expand Down
21 changes: 21 additions & 0 deletions templates/web/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "pecan.fullname" . }}-web
labels:
{{- include "pecan.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods", "endpoints", "Services", "persistentvolumeclaims"]
verbs:
- list
- watch
- get
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- list
- watch
- get
17 changes: 17 additions & 0 deletions templates/web/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# We bind the role to the pecan-web service account.
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "pecan.fullname" . }}-web
labels:
{{- include "pecan.labels" . | nindent 4 }}
roleRef:
- apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "pecan.fullname" . }}-web
- apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "pecan.fullname" . }}-web
subjects:
- kind: ServiceAccount
name: {{ include "pecan.fullname" . }}-web

0 comments on commit 2541bf6

Please sign in to comment.