2023-01-04 08:32:01 +00:00
{{- if .Values.apiserver.enabled }}
apiVersion : apps/v1
kind : Deployment
metadata :
name : {{ include "apiserver.referenceName" . }}
labels :
{{- include "clearml.labels" . | nindent 4 }}
2024-05-28 06:40:54 +00:00
{{- with .Values.apiserver.deploymentAnnotations }}
annotations :
{{ toYaml . | indent 4 }}
{{- end }}
2023-01-04 08:32:01 +00:00
spec :
replicas : {{ .Values.apiserver.replicaCount }}
selector :
matchLabels :
{{- include "apiserver.selectorLabels" . | nindent 6 }}
template :
metadata :
{{- with .Values.apiserver.podAnnotations }}
annotations :
{{- toYaml . | nindent 8 }}
{{- end }}
labels :
{{- include "apiserver.selectorLabels" . | nindent 8 }}
spec :
2023-09-27 07:19:55 +00:00
serviceAccountName : {{ .Values.apiserver.serviceAccountName }}-apiserver
2023-01-04 08:32:01 +00:00
{{- if .Values.imageCredentials.enabled }}
imagePullSecrets :
{{- if .Values.imageCredentials.existingSecret }}
2023-02-08 13:20:25 +00:00
- name : {{ .Values.imageCredentials.existingSecret }}
2023-01-04 08:32:01 +00:00
{{- else }}
- name : clearml-registry-key
{{- end }}
{{- end }}
2024-06-04 09:34:41 +00:00
{{- if or .Values.apiserver.additionalConfigs .Values.apiserver.existingAdditionalConfigsConfigMap .Values.apiserver.existingAdditionalConfigsSecret .Values.apiserver.additionalVolumes }}
2023-01-18 12:34:29 +00:00
volumes :
2024-06-04 09:34:41 +00:00
{{- if .Values.apiserver.existingAdditionalConfigsConfigMap }}
2023-01-04 08:32:01 +00:00
- name : apiserver-config
2023-01-18 12:34:29 +00:00
configMap :
name : {{ .Values.apiserver.existingAdditionalConfigsConfigMap }}
2024-06-04 09:34:41 +00:00
{{- else if .Values.apiserver.existingAdditionalConfigsSecret }}
- name : apiserver-config
2023-01-18 12:34:29 +00:00
secret :
secretName : {{ .Values.apiserver.existingAdditionalConfigsSecret }}
2024-06-04 09:34:41 +00:00
{{- else if .Values.apiserver.additionalConfigs }}
- name : apiserver-config
2023-01-04 08:32:01 +00:00
configMap :
name : "{{ include " apiserver.referenceName" . }}-configmap"
2024-06-04 09:34:41 +00:00
{{- end }}
{{- if .Values.apiserver.additionalVolumes }}
{{- toYaml .Values.apiserver.additionalVolumes | nindent 8 }}
{{- end }}
2023-01-04 08:32:01 +00:00
{{- end }}
2023-03-16 07:42:27 +00:00
securityContext :
{{ toYaml .Values.apiserver.podSecurityContext | nindent 8 }}
2023-01-04 08:32:01 +00:00
initContainers :
- name : init-apiserver
2023-03-16 07:42:27 +00:00
image : "{{ include " registryNamePrefix" (dict "globalValues" .Values.global "imageRegistryValue" .Values.apiserver.image.registry) }}{{ .Values.apiserver.image.repository }}:{{ .Values.apiserver.image.tag }}"
2023-01-04 08:32:01 +00:00
command :
- /bin/sh
- -c
- >
set -x;
2023-01-30 11:44:41 +00:00
{{- if .Values.elasticsearch.enabled }}
2023-01-04 08:32:01 +00:00
while [ $(curl -sw '%{http_code}' "http://{{ include "elasticsearch.servicename" . }}:{{ include "elasticsearch.serviceport" . }}/_cluster/health" -o /dev/null) -ne 200 ] ; do
echo "waiting for elasticsearch" ;
sleep 5 ;
2023-01-30 11:44:41 +00:00
done ;
{{- end }}
{{- if .Values.mongodb.enabled }}
2023-03-07 07:19:22 +00:00
while [ $(curl --telnet-option BOGUS --connect-timeout 2 -s "telnet://{{ .Release.Name }}-{{ include "mongodb.hostname" . }}:27017" -o /dev/null; echo $?) -ne 49 ] ; do
2023-01-30 11:44:41 +00:00
echo "waiting for mongodb" ;
sleep 5 ;
done ;
{{- end }}
{{- if .Values.redis.enabled }}
while [ $(curl --telnet-option BOGUS --connect-timeout 2 -s "telnet://{{ include "redis.servicename" . }}:{{ include "redis.serviceport" . }}" -o /dev/null; echo $?) -ne 49 ] ; do
echo "waiting for redis" ;
sleep 5 ;
done ;
{{- end }}
2023-03-16 07:42:27 +00:00
securityContext :
{{ toYaml .Values.apiserver.containerSecurityContext | nindent 12 }}
2023-06-07 06:34:19 +00:00
resources :
{{- toYaml .Values.apiserver.initContainers.resources | nindent 12 }}
2023-01-04 08:32:01 +00:00
containers :
- name : clearml-apiserver
2023-03-16 07:42:27 +00:00
image : "{{ include " registryNamePrefix" (dict "globalValues" .Values.global "imageRegistryValue" .Values.apiserver.image.registry) }}{{ .Values.apiserver.image.repository }}:{{ .Values.apiserver.image.tag }}"
2023-01-04 08:32:01 +00:00
imagePullPolicy : {{ .Values.apiserver.image.pullPolicy }}
ports :
- name : http
containerPort : 8008
protocol : TCP
env :
2023-02-09 09:29:00 +00:00
- name : CLEARML__HOSTS__ELASTIC__WORKERS__HOSTS
value : {{ include "elasticsearch.connectionstring" . }}
- name : CLEARML__HOSTS__ELASTIC__EVENTS__HOSTS
value : {{ include "elasticsearch.connectionstring" . }}
- name : CLEARML__HOSTS__ELASTIC__DATASETS__HOSTS
value : {{ include "elasticsearch.connectionstring" . }}
- name : CLEARML__HOSTS__ELASTIC__LOGS__HOSTS
value : {{ include "elasticsearch.connectionstring" . }}
2023-01-24 08:27:42 +00:00
{{- if .Values.mongodb.enabled }}
2023-01-04 08:32:01 +00:00
- name : CLEARML_MONGODB_SERVICE_CONNECTION_STRING
value : {{ include "mongodb.connectionstring" . | quote }}
2023-01-24 08:27:42 +00:00
{{- else }}
- name : CLEARML__HOSTS__MONGO__BACKEND__HOST
value : {{ .Values.externalServices.mongodbConnectionStringBackend | quote }}
- name : CLEARML__HOSTS__MONGO__AUTH__HOST
value : {{ .Values.externalServices.mongodbConnectionStringAuth | quote }}
{{- end }}
2023-01-04 08:32:01 +00:00
- name : CLEARML_REDIS_SERVICE_HOST
value : {{ include "redis.servicename" . }}
- name : CLEARML_REDIS_SERVICE_PORT
value : "{{ include " redis.serviceport" . }}"
- name : CLEARML_CONFIG_PATH
2023-01-05 10:52:53 +00:00
value : /opt/clearml/config
- name : CLEARML__apiserver__default_company_name
2023-01-04 08:32:01 +00:00
value : "{{ .Values.clearml.defaultCompany }}"
- name : CLEARML__APISERVER__AUTH__SESSION_AUTH_COOKIE_NAME
value : {{ .Values.clearml.cookieName }}
2023-02-14 07:42:26 +00:00
{{- if .Values.clearml.cookieDomain }}
2023-01-04 08:32:01 +00:00
- name : CLEARML__APISERVER__AUTH__COOKIES__DOMAIN
value : ".{{ .Values.clearml.cookieDomain }}"
{{- end }}
- name : CLEARML__secure__credentials__apiserver__user_key
valueFrom :
secretKeyRef :
2023-06-14 13:43:23 +00:00
name : {{ include "clearml.confSecretName" .}}
2023-01-04 08:32:01 +00:00
key : apiserver_key
- name : CLEARML__secure__credentials__apiserver__user_secret
valueFrom :
secretKeyRef :
2023-06-14 13:43:23 +00:00
name : {{ include "clearml.confSecretName" .}}
2023-01-04 08:32:01 +00:00
key : apiserver_secret
- name : CLEARML__secure__auth__token_secret
valueFrom :
secretKeyRef :
2023-06-14 13:43:23 +00:00
name : {{ include "clearml.confSecretName" .}}
2023-01-04 08:32:01 +00:00
key : secure_auth_token_secret
{{- if .Values.apiserver.prepopulateEnabled }}
- name : CLEARML__APISERVER__PRE_POPULATE__ENABLED
value : "true"
- name : CLEARML__APISERVER__PRE_POPULATE__ZIP_FILES
value : "/opt/clearml/db-pre-populate"
{{- end }}
- name : CLEARML__SECURE__CREDENTIALS__TESTS__USER_KEY
valueFrom :
secretKeyRef :
2023-06-14 13:43:23 +00:00
name : {{ include "clearml.confSecretName" .}}
2023-01-04 08:32:01 +00:00
key : test_user_key
- name : CLEARML__SECURE__CREDENTIALS__TESTS__USER_SECRET
valueFrom :
secretKeyRef :
2023-06-14 13:43:23 +00:00
name : {{ include "clearml.confSecretName" .}}
2023-01-04 08:32:01 +00:00
key : test_user_secret
- name : CLEARML_ENV
value : "helm-cloud"
{{- if .Values.apiserver.extraEnvs }}
{{ toYaml .Values.apiserver.extraEnvs | nindent 10 }}
{{- end }}
args :
- apiserver
livenessProbe :
initialDelaySeconds : 60
httpGet :
path : /debug.ping
port : 8008
readinessProbe :
initialDelaySeconds : 60
failureThreshold : 8
httpGet :
path : /debug.ping
port : 8008
httpHeaders :
- name : Authorization
value : Basic {{ include "readinessProbeAuth" . }}
2024-06-04 09:34:41 +00:00
{{- if or .Values.apiserver.additionalConfigs .Values.apiserver.existingAdditionalConfigsConfigMap .Values.apiserver.existingAdditionalConfigsSecret .Values.apiserver.additionalVolumeMounts }}
2023-01-04 08:32:01 +00:00
volumeMounts :
2024-06-04 09:34:41 +00:00
{{- if or .Values.apiserver.additionalConfigs .Values.apiserver.existingAdditionalConfigsConfigMap .Values.apiserver.existingAdditionalConfigsSecret }}
2023-01-04 08:32:01 +00:00
- name : apiserver-config
2023-01-05 10:52:53 +00:00
mountPath : /opt/clearml/config
2024-06-04 09:34:41 +00:00
{{- end }}
{{- if .Values.apiserver.additionalVolumeMounts }}
2024-06-06 07:31:52 +00:00
{{- toYaml .Values.apiserver.additionalVolumeMounts | nindent 12 }}
2024-06-04 09:34:41 +00:00
{{- end }}
2023-01-04 08:32:01 +00:00
{{- end }}
resources :
{{- toYaml .Values.apiserver.resources | nindent 12 }}
2023-03-16 07:42:27 +00:00
securityContext :
{{ toYaml .Values.apiserver.containerSecurityContext | nindent 12 }}
2023-01-04 08:32:01 +00:00
{{- with .Values.apiserver.nodeSelector }}
nodeSelector :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.apiserver.affinity }}
affinity :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.apiserver.tolerations }}
tolerations :
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}