charts/devlake/templates/deployments.yaml (220 lines of code) (raw):

# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # --- # devlake-ui apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "devlake.fullname" . }}-ui labels: {{- include "devlake.labels" . | nindent 4 }} {{- with .Values.ui.deployment.extraLabels }} {{- toYaml . | nindent 4 }} {{- end }} spec: replicas: 1 {{- with .Values.ui.strategy }} strategy: {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: {{- include "devlake.selectorLabels" . | nindent 6 }} devlakeComponent: ui template: metadata: labels: {{- include "devlake.selectorLabels" . | nindent 8 }} devlakeComponent: ui {{- with .Values.ui.extraLabels }} {{- toYaml . | nindent 8 }} {{- end }} annotations: {{- toYaml .Values.ui.podAnnotations | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.ui.securityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} containers: {{- with .Values.ui.extraContainers }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} - name: config-ui {{- if .Values.ui.image.tag }} image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}" {{- else }} image: "{{ .Values.ui.image.repository }}:{{ .Values.imageTag }}" {{- end }} imagePullPolicy: {{ .Values.ui.image.pullPolicy }} ports: - containerPort: 4000 {{- with .Values.ui.livenessProbe }} livenessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ui.readinessProbe }} readinessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.ui.basicAuth.enabled }} envFrom: - secretRef: name: {{ include "devlake.ui.auth.secret" . }} {{- end }} env: - name: DEVLAKE_ENDPOINT value: {{ include "devlake.fullname" . }}-lake.{{ .Release.Namespace }}.svc.cluster.local:8080 {{- if not .Values.grafana.enabled }} - name: GRAFANA_ENDPOINT value: {{ .Values.grafana.external.url }} - name: USE_EXTERNAL_GRAFANA value: "true" {{- else }} - name: GRAFANA_ENDPOINT value: {{ .Release.Name }}-grafana.{{ .Release.Namespace }}.svc.cluster.local:80 {{- end }} {{- range $key, $value := .Values.commonEnvs }} - name: "{{ tpl $key $ }}" value: "{{ tpl (print $value) $ }}" {{- end }} {{- with .Values.ui.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ui.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ui.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.ui.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.ui.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} --- # devlake apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "devlake.fullname" . }}-lake labels: {{- include "devlake.labels" . | nindent 4 }} {{- with .Values.lake.deployment.extraLabels }} {{- toYaml . | nindent 4 }} {{- end }} spec: replicas: 1 {{- with .Values.lake.strategy }} strategy: {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: {{- include "devlake.selectorLabels" . | nindent 6 }} devlakeComponent: lake template: metadata: labels: {{- include "devlake.selectorLabels" . | nindent 8 }} devlakeComponent: lake {{- with .Values.lake.extraLabels }} {{- toYaml . | nindent 8 }} {{- end }} annotations: {{- toYaml .Values.lake.podAnnotations | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.lake.securityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} initContainers: {{- include "common.initContainerWaitDatabase" . | nindent 8 }} {{- with .Values.lake.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} containers: - name: lake {{- if .Values.lake.image.tag }} image: "{{ .Values.lake.image.repository }}:{{ .Values.lake.image.tag }}" {{- else }} image: "{{ .Values.lake.image.repository }}:{{ .Values.imageTag }}" {{- end }} imagePullPolicy: {{ .Values.lake.image.pullPolicy }} ports: - containerPort: {{ .Values.lake.port }} {{- with .Values.lake.livenessProbe }} livenessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.lake.readinessProbe }} readinessProbe: {{- toYaml . | nindent 12 }} {{- end }} envFrom: - secretRef: name: {{ include "devlake.mysql.secret" . }} - secretRef: name: {{ include "devlake.lake.encryption.secret" . }} {{- if .Values.lake.extraEnvsFromSecret }} - secretRef: name: {{ .Values.lake.extraEnvsFromSecret }} {{- end }} env: - name: PORT value: "{{ .Values.lake.port }}" {{- range $key1, $value1 := .Values.lake.envs }} - name: "{{ tpl $key1 $ }}" value: "{{ tpl (print $value1) $ }}" {{- end }} {{- range $key2, $value2 := .Values.commonEnvs }} - name: "{{ tpl $key2 $ }}" value: "{{ tpl (print $value2) $ }}" {{- end }} {{- with .Values.lake.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.lake.volumeMounts }} volumeMounts: {{- range $volumeMount := .Values.lake.volumeMounts }} - {{- $volumeMount | toYaml | nindent 14 }} {{- end }} {{- end }} {{- with .Values.lake.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.lake.volumes }} volumes: {{- range $volume := .Values.lake.volumes }} - {{- $volume | toYaml | nindent 10 }} {{- end }} {{- end }} {{- if .Values.lake.hostNetwork }} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet {{- end }} {{- with .Values.lake.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.lake.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.lake.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}