2021-07-07 07:04:15 +00:00
apiVersion : apps/v1
kind : Deployment
metadata :
name : {{ include "clearml.fullname" . }}-apiserver
labels :
{{- include "clearml.labels" . | nindent 4 }}
spec :
replicas : {{ .Values.apiserver.replicaCount }}
selector :
matchLabels :
{{- include "clearml.selectorLabelsApiServer" . | nindent 6 }}
template :
metadata :
annotations :
2021-11-04 19:36:21 +00:00
checksum/secret : {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.apiserver.podAnnotations }}
2021-07-07 07:04:15 +00:00
{{- toYaml . | nindent 8 }}
{{- end }}
labels :
{{- include "clearml.selectorLabelsApiServer" . | nindent 8 }}
spec :
2022-06-23 05:49:45 +00:00
{{- if .Values.imageCredentials.enabled }}
imagePullSecrets :
{{- if .Values.imageCredentials.existingSecret }}
2022-07-13 08:14:16 +00:00
- name : {{ .Values.imageCredentials.existingSecret }}
2022-06-23 05:49:45 +00:00
{{- else }}
- name : clearml-agent-registry-key
{{- end }}
{{- end }}
2021-07-07 07:04:15 +00:00
containers :
- name : {{ .Chart.Name }}
image : "{{ .Values.apiserver.image.repository }}:{{ .Values.apiserver.image.tag | default .Chart.AppVersion }}"
imagePullPolicy : {{ .Values.apiserver.image.pullPolicy }}
ports :
- name : http
containerPort : 8008
protocol : TCP
env :
- name : CLEARML_ELASTIC_SERVICE_HOST
2021-11-26 07:11:55 +00:00
{{- if .Values.elasticsearch.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ .Values.elasticsearch.clusterName }}-master"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.elasticsearchHost }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML_ELASTIC_SERVICE_PORT
2021-11-26 07:11:55 +00:00
{{- if .Values.elasticsearch.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ .Values.elasticsearch.httpPort }}"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.elasticsearchPort }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML_MONGODB_SERVICE_HOST
2021-11-26 07:11:55 +00:00
{{- if .Values.mongodb.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ tpl .Values.mongodb.service.name . }}"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.mongodbHost }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML_MONGODB_SERVICE_PORT
2021-11-26 07:11:55 +00:00
{{- if .Values.mongodb.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ .Values.mongodb.service.port }}"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.mongodbPort }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML_REDIS_SERVICE_HOST
2021-11-26 07:11:55 +00:00
{{- if .Values.redis.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ tpl .Values.redis.master.name . }}"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.redisHost }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML_REDIS_SERVICE_PORT
2021-11-26 07:11:55 +00:00
{{- if .Values.redis.enabled }}
2021-07-07 07:04:15 +00:00
value : "{{ .Values.redis.master.port }}"
2021-11-26 07:11:55 +00:00
{{- else }}
value : "{{ .Values.externalServices.redisPort }}"
{{- end }}
2021-07-07 07:04:15 +00:00
- name : CLEARML__APISERVER__PRE_POPULATE__ENABLED
value : "{{ .Values.apiserver.prepopulateEnabled }}"
- name : CLEARML__APISERVER__PRE_POPULATE__ZIP_FILES
value : "{{ .Values.apiserver.prepopulateZipFiles }}"
- name : CLEARML_SERVER_DEPLOYMENT_TYPE
value : "helm-cloud"
2021-12-09 07:14:09 +00:00
- name : CLEARML__APISERVER__AUTH__COOKIES__MAX_AGE
2021-12-09 10:39:04 +00:00
value : "{{ .Values.apiserver.authCookiesMaxAge }}"
2021-07-07 07:04:15 +00:00
- name : CLEARML_CONFIG_DIR
value : /opt/clearml/config
- name : CLEARML__APISERVER__DEFAULT_COMPANY
value : {{ .Values.clearml.defaultCompany }}
- name : CLEARML__SECURE__HTTP__SESSION_SECRET__APISERVER
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : http_session
- name : CLEARML__SECURE__AUTH__TOKEN_SECRET
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : auth_token
- name : CLEARML__SECURE__CREDENTIALS__APISERVER__USER_KEY
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : apiserver_key
- name : CLEARML__SECURE__CREDENTIALS__APISERVER__USER_SECRET
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : apiserver_secret
- name : CLEARML__SECURE__CREDENTIALS__TESTS__USER_KEY
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : tests_user_key
- name : CLEARML__SECURE__CREDENTIALS__TESTS__USER_SECRET
valueFrom :
secretKeyRef :
2022-08-22 08:35:47 +00:00
name : {{ default "clearml-conf" .Values.secret.existingSecret }}
2021-07-07 07:04:15 +00:00
key : tests_user_secret
{{- if .Values.apiserver.extraEnvs }}
{{ toYaml .Values.apiserver.extraEnvs | nindent 10 }}
{{- end }}
args :
- apiserver
livenessProbe :
initialDelaySeconds : {{ .Values.apiserver.livenessDelay }}
httpGet :
path : /debug.ping
port : 8008
readinessProbe :
initialDelaySeconds : {{ .Values.apiserver.readinessDelay }}
failureThreshold : 8
httpGet :
path : /debug.ping
port : 8008
2022-08-09 05:08:12 +00:00
{{- if or .Values.apiserver.configuration.additionalConfigs .Values.apiserver.configuration.configRefName .Values.apiserver.configuration.secretRefName }}
2021-07-07 07:04:15 +00:00
volumeMounts :
- name : apiserver-config
mountPath : /opt/clearml/config
{{- end }}
resources :
{{- toYaml .Values.apiserver.resources | nindent 12 }}
2022-08-09 05:08:12 +00:00
{{- if or .Values.apiserver.configuration.additionalConfigs .Values.apiserver.configuration.configRefName .Values.apiserver.configuration.secretRefName }}
2021-09-14 13:43:10 +00:00
volumes :
- name : apiserver-config
2022-08-09 05:08:12 +00:00
{{- if or .Values.apiserver.configuration.configRefName }}
configMap :
name : {{ .Values.apiserver.configuration.configRefName }}
{{- else if or .Values.apiserver.configuration.secretRefName }}
secret :
secretName : {{ .Values.apiserver.configuration.secretRefName }}
{{- else if or .Values.apiserver.configuration.additionalConfigs }}
2021-09-14 13:43:10 +00:00
configMap :
name : "{{ include " clearml.fullname" . }}-apiserver-configmap"
2022-08-09 05:08:12 +00:00
{{- end }}
2021-09-14 13:43:10 +00:00
{{- end }}
2021-07-07 07:04:15 +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 }}