Skip to content

Commit

Permalink
Use existingClearmlConfigSecret (#283)
Browse files Browse the repository at this point in the history
* use config as secret

* update chart and readme

* avoid creating secret if not needed

* move string on values.yaml
  • Loading branch information
uzmargomez authored May 14, 2024
1 parent 5ded87e commit cfe6248
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/clearml-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: clearml-agent
description: MLOps platform Task running agent
type: application
version: "5.1.4"
version: "5.1.5"
appVersion: "1.24"
kubeVersion: ">= 1.21.0-0 < 1.30.0-0"
home: https://clear.ml
Expand All @@ -21,4 +21,4 @@ keywords:
annotations:
artifacthub.io/changes: |
- kind: fixed
description: honor existingAgentk8sglueSecret in deployment template
description: Use existingClearmlConfigSecret in deployment template
2 changes: 1 addition & 1 deletion charts/clearml-agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ClearML Kubernetes Agent

![Version: 5.1.4](https://img.shields.io/badge/Version-5.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.24](https://img.shields.io/badge/AppVersion-1.24-informational?style=flat-square)
![Version: 5.1.5](https://img.shields.io/badge/Version-5.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.24](https://img.shields.io/badge/AppVersion-1.24-informational?style=flat-square)

MLOps platform Task running agent

Expand Down
13 changes: 10 additions & 3 deletions charts/clearml-agent/templates/agentk8sglue-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
volumeMounts:
- name: {{ include "clearmlAgent.fullname" . }}-pt
mountPath: /root/template
{{ if .Values.clearml.clearmlConfig }}
{{ if or (.Values.clearml.clearmlConfig) (.Values.clearml.existingClearmlConfigSecret) }}
- name: k8sagent-clearml-conf-volume
mountPath: /root/clearml.conf
subPath: clearml.conf
Expand Down Expand Up @@ -103,7 +103,7 @@ spec:
- name: K8S_GLUE_EXTRA_ARGS
value: "--namespace {{ .Release.Namespace }} --template-yaml /root/template/template.yaml"
{{- end }}
{{- if .Values.clearml.clearmlConfig }}
{{ if or (.Values.clearml.clearmlConfig) (.Values.clearml.existingClearmlConfigSecret) }}
- name: CLEARML_CONFIG_FILE
value: /root/clearml.conf
{{- end }}
Expand Down Expand Up @@ -160,7 +160,14 @@ spec:
- name: {{ include "clearmlAgent.fullname" . }}-pt
configMap:
name: {{ include "clearmlAgent.fullname" . }}-pt
{{ if .Values.clearml.clearmlConfig }}
{{ if .Values.clearml.existingClearmlConfigSecret }}
- name: k8sagent-clearml-conf-volume
secret:
secretName: {{ .Values.clearml.existingClearmlConfigSecret }}
items:
- key: clearml.conf
path: clearml.conf
{{ else if .Values.clearml.clearmlConfig }}
- name: k8sagent-clearml-conf-volume
secret:
secretName: {{ include "clearmlAgent.fullname" . }}-ac
Expand Down
2 changes: 2 additions & 0 deletions charts/clearml-agent/templates/clearml-secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if or (not .Values.clearml.existingAgentk8sglueSecret) (not .Values.clearml.existingClearmlConfigSecret) }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,6 +7,7 @@ data:
agentk8sglue_key: {{ .Values.clearml.agentk8sglueKey | b64enc }}
agentk8sglue_secret: {{ .Values.clearml.agentk8sglueSecret | b64enc }}
clearml.conf: {{ .Values.clearml.clearmlConfig | b64enc }}
{{- end }}
---
{{- if .Values.imageCredentials.enabled }}
{{- if not .Values.imageCredentials.existingSecret }}
Expand Down
10 changes: 10 additions & 0 deletions charts/clearml-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ clearml:

# -- If this is set, chart will not generate a secret but will use what is defined here
existingClearmlConfigSecret: ""
# The secret should be defined as the following example
#
# apiVersion: v1
# kind: Secret
# metadata:
# name: secret-name
# stringData:
# clearml.conf: |-
# sdk {
# }
# -- ClearML configuration file
clearmlConfig: |-
sdk {
Expand Down

0 comments on commit cfe6248

Please sign in to comment.