{{- if not .Values.agentk8sglue.serviceExistingAccountName }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "clearmlAgent.serviceAccountName" . }} namespace: {{ .Release.Namespace }} {{- end }} {{- if .Values.enterpriseFeatures.serviceAccountClusterAccess }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "clearmlAgent.name" . }}-kpa rules: - apiGroups: - "" resources: - pods - secrets - services verbs: ["get", "list", "watch", "create", "patch", "delete"] - apiGroups: - "" resources: - namespaces verbs: ["list"] {{- if .Values.agentk8sglue.taskAsJob }} - apiGroups: - batch - extensions resources: - jobs verbs: ["get", "list", "watch", "create", "patch", "delete"] {{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ include "clearmlAgent.name" . }}-kpa subjects: - kind: ServiceAccount name: {{ include "clearmlAgent.serviceAccountName" . }} namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ include "clearmlAgent.name" . }}-kpa {{- else }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "clearmlAgent.name" . }}-kpa rules: - apiGroups: - "" resources: - pods - secrets - services verbs: ["get", "list", "watch", "create", "patch", "delete"] - apiGroups: - "" resources: - namespaces verbs: ["list"] {{- if .Values.agentk8sglue.taskAsJob }} - apiGroups: - batch - extensions resources: - jobs verbs: ["get", "list", "watch", "create", "patch", "delete"] {{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "clearmlAgent.name" . }}-kpa subjects: - kind: ServiceAccount name: {{ include "clearmlAgent.serviceAccountName" . }} namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ include "clearmlAgent.name" . }}-kpa {{- end }}