diff --git a/helm-chart/templates/02-cluster-role.yaml b/helm-chart/templates/02-cluster-role.yaml index ae7c9a6fb..58be9fcc1 100644 --- a/helm-chart/templates/02-cluster-role.yaml +++ b/helm-chart/templates/02-cluster-role.yaml @@ -24,3 +24,28 @@ rules: - list - get - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + {{- include "kubeshark.labels" . | nindent 4 }} + annotations: + {{- if .Values.tap.annotations }} + {{- toYaml .Values.tap.annotations | nindent 4 }} + {{- end }} + name: kubeshark-self-secrets-role + namespace: {{ .Release.Namespace }} +rules: + - apiGroups: + - "v1" + - "" + resourceNames: + - kubeshark-secret + resources: + - secrets + verbs: + - get + - watch + - update + - patch diff --git a/helm-chart/templates/03-cluster-role-binding.yaml b/helm-chart/templates/03-cluster-role-binding.yaml index 6be80b65d..6ca853ab7 100644 --- a/helm-chart/templates/03-cluster-role-binding.yaml +++ b/helm-chart/templates/03-cluster-role-binding.yaml @@ -18,3 +18,23 @@ subjects: - kind: ServiceAccount name: {{ include "kubeshark.serviceAccountName" . }} namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: kubeshark-self-secrets-role-binding + labels: + {{- include "kubeshark.labels" . | nindent 4 }} + annotations: + {{- if .Values.tap.annotations }} + {{- toYaml .Values.tap.annotations | nindent 4 }} + {{- end }} + namespace: {{ .Release.Namespace }} +subjects: + - kind: ServiceAccount + name: {{ include "kubeshark.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: kubeshark-self-secrets-role + apiGroup: rbac.authorization.k8s.io \ No newline at end of file