{{- if .Values.enterpriseFeatures.enabled }} {{- if .Values.enterpriseFeatures.clearmlApplications.enabled }} apiVersion: v1 kind: ServiceAccount metadata: name: "clearml-apps-sa" namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "clearmlApplications.referenceName" . }}-kpa rules: - apiGroups: - "" resources: - pods verbs: ["get", "list", "watch", "create", "patch", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "clearmlApplications.referenceName" . }}-kpa subjects: - kind: ServiceAccount name: "clearml-apps-sa" namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ include "clearmlApplications.referenceName" . }}-kpa {{- end }} {{- end }} {{- range .Values.enterpriseFeatures.clearmlApplications.additionalClusterRoleBindings }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ include "clearmlApplications.referenceName" $ }}-kpa-{{ . }} subjects: - kind: ServiceAccount name: "clearml-apps-sa" namespace: {{ $.Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ . }} {{- end }} {{- range .Values.enterpriseFeatures.clearmlApplications.additionalRoleBindings }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "clearmlApplications.referenceName" $ }}-kpa-{{ . }} subjects: - kind: ServiceAccount name: "clearml-apps-sa" namespace: {{ $.Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ . }} {{- end }}