feat: add role and role binding
This commit is contained in:
parent
204f25a6af
commit
96880f1886
@ -18,6 +18,8 @@ spec:
|
|||||||
app.kubernetes.io/name: {{ .Release.Name }}-flink # Adding the flink prefix to the template labels
|
app.kubernetes.io/name: {{ .Release.Name }}-flink # Adding the flink prefix to the template labels
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: {{ include "flink-kube-operator.serviceAccountName" . }}
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: flink
|
- name: flink
|
||||||
image: {{ .Values.flink.image.repository }}:{{ .Values.flink.image.tag }}
|
image: {{ .Values.flink.image.repository }}:{{ .Values.flink.image.tag }}
|
||||||
|
|||||||
38
helm/templates/operator/role.yaml
Normal file
38
helm/templates/operator/role.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ include "flink-kube-operator.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }} # Namespace where the role is created
|
||||||
|
labels:
|
||||||
|
{{- include "flink-kube-operator.labels" . | nindent 4 }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- flink.logicamp.tech # API group of the FlinkJob CRD
|
||||||
|
resources:
|
||||||
|
- flink-jobs # The plural name of your custom resource
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- delete
|
||||||
|
- patch
|
||||||
|
- watch
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: {{ include "flink-kube-operator.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }} # Namespace where the RoleBinding is created
|
||||||
|
labels:
|
||||||
|
{{- include "flink-kube-operator.labels" . | nindent 4 }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ include "flink-kube-operator.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }} # Ensure that the service account is in the same namespace
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: {{ include "flink-kube-operator.serviceAccountName" . }}
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
Loading…
x
Reference in New Issue
Block a user