Skip to content

Commit

Permalink
Add the required role-binding for the init container
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Nov 1, 2023
1 parent e1ac770 commit e4d25d1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions deploy/helm/ifrcgo-helm/templates/api/role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Role and rolebinding to allow the api init container to wait for the migrations job to complete
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "ifrcgo-helm.fullname" . }}-watch-resources-role
labels:
component: api-deployment
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
rules:
- apiGroups: [""]
resources: ["services","pods","deployments"]
verbs: ["get","watch","list"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get","watch","list"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "ifrcgo-helm.fullname" . }}-watch-resources-role-binding
labels:
component: api-deployment
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
subjects:
- kind: ServiceAccount
name: default
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "ifrcgo-helm.fullname" . }}-watch-resources-role

0 comments on commit e4d25d1

Please sign in to comment.