clearml-helm-charts/charts/clearml/templates/apps-deployment.yaml
Valeriano Manassero 99903085cd
Fix existing secret reference (#149)
* Fixed: existingSecret reference

* Changed: bump version

* Changed: bump up version
2023-02-09 10:11:03 +01:00

127 lines
5.2 KiB
YAML

{{- if .Values.enterpriseFeatures.enabled }}
{{- if .Values.enterpriseFeatures.clearmlApplications.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "clearmlApplications.referenceName" . }}
labels:
{{- include "clearml.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.enterpriseFeatures.clearmlApplications.replicaCount }}
selector:
matchLabels:
{{- include "clearmlApplications.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.enterpriseFeatures.clearmlApplications.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "clearmlApplications.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.imageCredentials.enabled }}
imagePullSecrets:
{{- if .Values.imageCredentials.existingSecret }}
- name: {{ .Values.imageCredentials.existingSecret }}
{{- else }}
- name: clearml-registry-key
{{- end }}
{{- end }}
volumes:
- name: {{ include "clearml.name" . }}-apps-pt
configMap:
name: {{ include "clearml.name" . }}-apps-pt
{{- if .Values.enterpriseFeatures.clearmlApplications.additionalConfigs }}
- name: apps-config
configMap:
name: "{{ include "clearmlApplications.referenceName" . }}-configmap"
{{- end }}
serviceAccountName: "clearml-apps-sa"
initContainers:
- name: init-apps
image: "{{ .Values.enterpriseFeatures.clearmlApplications.image.repository }}:{{ .Values.enterpriseFeatures.clearmlApplications.image.tag | default .Chart.AppVersion }}"
command:
- /bin/sh
- -c
- >
set -x;
while [ $(curl -sw '%{http_code}' "http://{{ include "apiserver.referenceName" . }}:{{ .Values.apiserver.service.port }}/debug.ping" -o /dev/null) -ne 200 ] ; do
echo "waiting for apiserver" ;
sleep 5 ;
done
containers:
- name: clearml-apps
image: "{{ .Values.enterpriseFeatures.clearmlApplications.image.repository }}:{{ .Values.enterpriseFeatures.clearmlApplications.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.enterpriseFeatures.clearmlApplications.image.pullPolicy }}
ports:
- name: http
containerPort: 8008
protocol: TCP
env:
- name: CLEARML_API_HOST
value: "http://{{ include "apiserver.referenceName" . }}:{{ .Values.apiserver.service.port }}"
- name: CLEARML_FILES_HOST
value: "http://{{ include "fileserver.referenceName" . }}:{{ .Values.fileserver.service.port }}"
- name: CLEARML_WEB_HOST
value: "http://{{ include "webserver.referenceName" . }}:{{ .Values.webserver.service.port }}"
- name: CLEARML_AGENT_DEFAULT_BASE_DOCKER
value: "{{ .Values.enterpriseFeatures.clearmlApplications.basePodImage.repository }}:{{ .Values.enterpriseFeatures.clearmlApplications.basePodImage.tag }}"
- name: CLEARML_WORKER_ID
value: "apps-agent-1"
- name: CLEARML_NO_DEFAULT_SERVER
value: "true"
- name: K8S_GLUE_EXTRA_ARGS
value: "--namespace {{ .Release.Namespace }} --template-yaml /root/template/template.yaml \
--child-report-tags application --max-pods 5 --use-owner-token"
- name: K8S_GLUE_QUEUE
value: "apps_queue"
- name: CLEARML_AGENT_DISABLE_SSH_MOUNT
value: "1"
- name: CLEARML_API_ACCESS_KEY
valueFrom:
secretKeyRef:
name: clearml-conf
key: apps_agent_key
- name: CLEARML_API_SECRET_KEY
valueFrom:
secretKeyRef:
name: clearml-conf
key: apps_agent_secret
- name: CLEARML_AGENT_GIT_USER
valueFrom:
secretKeyRef:
name: clearml-conf
key: apps_git_agent_user
- name: CLEARML_AGENT_GIT_PASS
valueFrom:
secretKeyRef:
name: clearml-conf
key: apps_git_agent_pass
{{- if .Values.enterpriseFeatures.clearmlApplications.extraEnvs }}
{{ toYaml .Values.enterpriseFeatures.clearmlApplications.extraEnvs | nindent 10 }}
{{- end }}
volumeMounts:
- name: {{ include "clearml.name" . }}-apps-pt
mountPath: /root/template
{{- if .Values.enterpriseFeatures.clearmlApplications.additionalConfigs }}
- name: apps-config
mountPath: /opt/clearml/config/default
{{- end }}
resources:
{{- toYaml .Values.enterpriseFeatures.clearmlApplications.resources | nindent 12 }}
{{- with .Values.enterpriseFeatures.clearmlApplications.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFeatures.clearmlApplications.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFeatures.clearmlApplications.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}