clearml-helm-charts/charts/clearml/templates/fileserver-deployment.yaml
Tino Tap 2080cae5e8
Issue #218 (#219)
* Update values.yaml

added existingAdditionalSecret

* add existingSecret

* Update values.yaml

* better implemented

* Update Chart.yaml

to version 7.2.1

* Update values.yaml

added documentation to values.yaml

* artifact hub annotations

* Changed: moved to helper function

* Changed: helm-docs update

* changed the key to exstingSecret om _helpers

---------

Co-authored-by: Valeriano Manassero <14011549+valeriano-manassero@users.noreply.github.com>
2023-06-14 15:43:23 +02:00

129 lines
4.8 KiB
YAML

{{- if .Values.fileserver.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "fileserver.referenceName" . }}
labels:
{{- include "clearml.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.fileserver.replicaCount }}
selector:
matchLabels:
{{- include "fileserver.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.fileserver.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "fileserver.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:
{{- if .Values.fileserver.storage.enabled }}
{{- if .Values.fileserver.storage.data.existingPVC }}
- name: fileserver-data
persistentVolumeClaim:
claimName: {{ .Values.fileserver.storage.data.existingPVC | quote }}
{{- else }}
- name: fileserver-data
persistentVolumeClaim:
claimName: {{ include "fileserver.referenceName" . }}-data
{{- end }}
{{- else }}
- name: fileserver-data
emptyDir: {}
{{- end }}
securityContext:
{{ toYaml .Values.fileserver.podSecurityContext | nindent 8 }}
initContainers:
- name: init-fileserver
image: "{{ include "registryNamePrefix" (dict "globalValues" .Values.global "imageRegistryValue" .Values.fileserver.image.registry) }}{{ .Values.fileserver.image.repository }}:{{ .Values.fileserver.image.tag }}"
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
securityContext:
{{ toYaml .Values.fileserver.containerSecurityContext | nindent 12 }}
resources:
{{- toYaml .Values.fileserver.initContainers.resources | nindent 12 }}
containers:
- name: clearml-fileserver
image: "{{ include "registryNamePrefix" (dict "globalValues" .Values.global "imageRegistryValue" .Values.fileserver.image.registry) }}{{ .Values.fileserver.image.repository }}:{{ .Values.fileserver.image.tag }}"
imagePullPolicy: {{ .Values.fileserver.image.pullPolicy }}
ports:
- name: http
containerPort: 8081
protocol: TCP
env:
- name: CLEARML__HOSTS__API_SERVER
value: "http://{{ include "apiserver.referenceName" . }}:{{ .Values.apiserver.service.port }}"
- name: CLEARML_REDIS_SERVICE_HOST
value: {{ include "redis.servicename" . }}
- name: CLEARML_REDIS_SERVICE_PORT
value: "{{ include "redis.serviceport" . }}"
{{- if not (eq .Values.clearml.cookieDomain "") }}
- name: CLEARML__FILESERVER__AUTH__COOKIE_NAMES
value: "[ {{ .Values.clearml.cookieName }} ]"
{{- end }}
- name: USER_KEY
valueFrom:
secretKeyRef:
name: {{ include "clearml.confSecretName" .}}
key: fileserver_key
- name: USER_SECRET
valueFrom:
secretKeyRef:
name: {{ include "clearml.confSecretName" .}}
key: fileserver_secret
{{- if .Values.fileserver.extraEnvs }}
{{ toYaml .Values.fileserver.extraEnvs | nindent 10 }}
{{- end }}
args:
- fileserver
livenessProbe:
exec:
command:
- curl
- -X OPTIONS
- http://localhost:8081/
readinessProbe:
exec:
command:
- curl
- -X OPTIONS
- http://localhost:8081/
volumeMounts:
- name: fileserver-data
mountPath: /mnt/fileserver
resources:
{{- toYaml .Values.fileserver.resources | nindent 12 }}
securityContext:
{{ toYaml .Values.fileserver.containerSecurityContext | nindent 12 }}
{{- with .Values.fileserver.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.fileserver.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.fileserver.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}