diff --git a/charts/studio/templates/clusterrole-datachain-worker-nodes.yaml b/charts/studio/templates/clusterrole-datachain-worker-nodes.yaml new file mode 100644 index 00000000..2c55dbd6 --- /dev/null +++ b/charts/studio/templates/clusterrole-datachain-worker-nodes.yaml @@ -0,0 +1,18 @@ +{{- if ((.Values.studioDatachainWorker).serviceAccount).create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "studio-datachain-worker.serviceAccountName" . }}-nodes + labels: + {{- include "studio-datachain-worker.labels" . | nindent 4 }} + {{- with .Values.studioDatachainWorker.serviceAccount.annotations }} + annotations: + helm.sh/hook: pre-install, pre-upgrade + helm.sh/hook-delete-policy: hook-failed, before-hook-creation + {{- toYaml . | nindent 4 }} + {{- end }} +rules: + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "patch"] +{{- end }} diff --git a/charts/studio/templates/clusterrolebinding-datachain-worker-nodes.yaml b/charts/studio/templates/clusterrolebinding-datachain-worker-nodes.yaml new file mode 100644 index 00000000..4dc3da7b --- /dev/null +++ b/charts/studio/templates/clusterrolebinding-datachain-worker-nodes.yaml @@ -0,0 +1,22 @@ +{{- if ((.Values.studioDatachainWorker).serviceAccount).create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "studio-datachain-worker.serviceAccountName" . }}-nodes + labels: + {{- include "studio-datachain-worker.labels" . | nindent 4 }} + {{- with .Values.studioDatachainWorker.serviceAccount.annotations }} + annotations: + helm.sh/hook: pre-install, pre-upgrade + helm.sh/hook-delete-policy: hook-failed, before-hook-creation + {{- toYaml . | nindent 4 }} + {{- end }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "studio-datachain-worker.serviceAccountName" . }}-nodes +subjects: + - kind: ServiceAccount + name: {{ include "studio-datachain-worker.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/studio/templates/job-studio-datachain-worker.yaml b/charts/studio/templates/job-studio-datachain-worker.yaml index c23ea13d..45bb5e72 100644 --- a/charts/studio/templates/job-studio-datachain-worker.yaml +++ b/charts/studio/templates/job-studio-datachain-worker.yaml @@ -56,6 +56,10 @@ spec: value: {{ (.Values.studioDatachainWorkerJobTemplate).idleTimeout | quote }} - name: WATCHDOG_KEEPALIVE_FILE value: "/tmp/watchdog-keepalive" + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName envFrom: - configMapRef: name: studio