From 97a6610e9b8708d7b1cea976456b1874838e331a Mon Sep 17 00:00:00 2001 From: Valeriano Manassero <14011549+valeriano-manassero@users.noreply.github.com> Date: Thu, 9 Feb 2023 16:58:27 +0100 Subject: [PATCH] Added: create queues switch --- charts/clearml-agent/templates/_helpers.tpl | 11 +++++++++++ .../templates/agentk8sglue-deployment.yaml | 6 ++++-- charts/clearml-agent/values.yaml | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/clearml-agent/templates/_helpers.tpl b/charts/clearml-agent/templates/_helpers.tpl index 3239bae..4a9f3c9 100644 --- a/charts/clearml-agent/templates/_helpers.tpl +++ b/charts/clearml-agent/templates/_helpers.tpl @@ -73,6 +73,17 @@ Create secret to access docker registry {{- end }} +{{/* +Create a queues parameter +*/}} +{{- define "agentk8sglue.createQueues" -}} +{{- if .Values.enterpriseFeatures.createQueues }} +{{- printf "%d" 1}} +{{- else }} +{{- printf "%d" 0 }} +{{- end }} +{{- end }} + {{/* Create a string composed by queue names */}} diff --git a/charts/clearml-agent/templates/agentk8sglue-deployment.yaml b/charts/clearml-agent/templates/agentk8sglue-deployment.yaml index a3f9f8d..3fce8b4 100644 --- a/charts/clearml-agent/templates/agentk8sglue-deployment.yaml +++ b/charts/clearml-agent/templates/agentk8sglue-deployment.yaml @@ -161,14 +161,16 @@ spec: {{- if .Values.enterpriseFeatures.enabled }} - name: K8S_GLUE_QUEUE value: {{ include "agentk8sglue.queues" . | quote }} + - name: CLEARML_K8S_GLUE_CREATE_QUEUE + value: {{ include "agentk8sglue.createQueues" . | quote }} - name: CLEARML_K8S_GLUE_APPLY_VAULT_ENV_VARS value: {{ .Values.enterpriseFeatures.applyVaultEnvVars | quote }} - name: "CLEARML_K8S_GLUE_POD_MIN_RES_FIELD" - value: {{.Values.enterpriseFeatures.monitoredResources.minResourcesFieldName}} + value: {{ .Values.enterpriseFeatures.monitoredResources.minResourcesFieldName }} - name: "CLEARML_K8S_GLUE_MAX_RESOURCES" value: "{{.Values.enterpriseFeatures.monitoredResources.maxResources}}" - name: "CLEARML_K8S_GLUE_POD_MAX_RES_FIELD" - value: {{.Values.enterpriseFeatures.monitoredResources.maxResourcesFieldName}} + value: {{ .Values.enterpriseFeatures.monitoredResources.maxResourcesFieldName }} {{- else }} - name: K8S_GLUE_QUEUE value: {{ .Values.agentk8sglue.queue }} diff --git a/charts/clearml-agent/values.yaml b/charts/clearml-agent/values.yaml index 7a66a50..47cbe4a 100644 --- a/charts/clearml-agent/values.yaml +++ b/charts/clearml-agent/values.yaml @@ -228,6 +228,8 @@ enterpriseFeatures: maxPods: 10 # -- Agent must use owner Token useOwnerToken: true + # -- Create queues if they don't exist + createQueues: false # -- ClearML queues and related template OVERRIDES used this agent will consume queues: # -- name of the queue will be used for this template