Skip to content

Commit

Permalink
Adding roles. rolebindings for pecan-monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
sutekar1597 committed Jul 24, 2022
1 parent 40d8402 commit b430649
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions templates/docs/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" . }}-docs
automountServiceAccountToken: false
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.project }}/docs:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
2 changes: 1 addition & 1 deletion templates/docs/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
{{- include "pecan.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods"]
resources: ["pods", "services", "endpoints"]
verbs:
- list
- watch
Expand Down
2 changes: 2 additions & 0 deletions templates/monitor/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" . }}-monitor
automountServiceAccountToken: false
initContainers:
- name: check-rabbitmq
image: "{{ $.Values.image.checks }}"
Expand Down
21 changes: 21 additions & 0 deletions templates/monitor/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" . }}-monitor
labels:
{{- include "pecan.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods", "endpoints", "Services"]
verbs:
- list
- watch
- get
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- list
- watch
- get
14 changes: 14 additions & 0 deletions templates/monitor/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# We bind the role to the pecan-monitor service account.
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "pecan.fullname" . }}-monitor
labels:
{{- include "pecan.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "pecan.fullname" . }}-monitor
subjects:
- kind: ServiceAccount
name: {{ include "pecan.fullname" . }}-monitor

0 comments on commit b430649

Please sign in to comment.