mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
4.8 KiB
135 lines
4.8 KiB
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "squidex.fullname" . }}
|
|
labels:
|
|
{{- include "squidex.labels" . | indent 4 }}
|
|
app.kubernetes.io/role: api
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.deployment.replicaCount }}
|
|
{{- end }}
|
|
revisionHistoryLimit: {{ .Values.deployment.revisionHistoryLimit }}
|
|
strategy:
|
|
{{- toYaml .Values.deployment.strategy | nindent 4 }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "squidex.selectors" . | indent 6 }}
|
|
app.kubernetes.io/role: api
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "squidex.selectors" . | indent 8 }}
|
|
app.kubernetes.io/role: api
|
|
{{- if .Values.deployment.annotations }}
|
|
annotations:
|
|
{{- toYaml .Values.deployment.annotations | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.runAsNonRoot }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- end }}
|
|
restartPolicy: {{ .Values.deployment.restartPolicy }}
|
|
{{- if .Values.priorityClassName }}
|
|
priorityClassName: {{ .Values.priorityClassName }}
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if .Values.runAsNonRoot }}
|
|
securityContext:
|
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.deployment.command }}
|
|
command:
|
|
{{- toYaml .Values.deployment.command | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.deployment.args }}
|
|
args:
|
|
{{- toYaml .Values.deployment.args | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: http
|
|
initialDelaySeconds: 300
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /readiness
|
|
port: http
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
env:
|
|
{{- range $key, $val := .Values.env }}
|
|
{{- if (eq $key "URLS__BASEURL") }}
|
|
- name: {{ $key | quote }}
|
|
value: {{ required (printf "The value .Values.env.%s is required" $key) $val | quote }}
|
|
{{- else }}
|
|
- name: {{ $key | quote }}
|
|
value: {{ $val | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
- name: CLUSTERING__WORKER
|
|
value: "false"
|
|
|
|
{{- if (.Values.mongodb.enabled) }}
|
|
{{- $mongoDefaultConnectionString := printf "mongodb://%s" (include "squidex.mongoDefaultHostname" .) }}
|
|
{{- if (not .Values.env.EVENTSTORE__MONGODB__CONFIGURATION) }}
|
|
- name: "EVENTSTORE__MONGODB__CONFIGURATION"
|
|
value: {{ $mongoDefaultConnectionString | quote }}
|
|
{{- end }}
|
|
|
|
{{- if (not .Values.env.STORE__MONGODB__CONFIGURATION) }}
|
|
- name: "STORE__MONGODB__CONFIGURATION"
|
|
value: {{ $mongoDefaultConnectionString | quote }}
|
|
{{- end }}
|
|
|
|
{{- if (not .Values.env.ASSETSTORE__MONGODB__CONFIGURATION) }}
|
|
- name: "ASSETSTORE__MONGODB__CONFIGURATION"
|
|
value: {{ $mongoDefaultConnectionString | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.extraConfigMaps | or .Values.extraSecrets }}
|
|
envFrom:
|
|
{{- range $configMap := .Values.extraConfigMaps }}
|
|
- configMapRef:
|
|
name: {{ $configMap }}
|
|
{{- end }}
|
|
{{- range $secret := .Values.extraSecrets }}
|
|
- secretRef:
|
|
name: {{ $secret }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
volumeMounts:
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.extraVolumes }}
|
|
volumes:
|
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
{{- end }}
|
|
nodeSelector:
|
|
{{- toYaml .Values.nodeSelector | nindent 8 }}
|
|
affinity:
|
|
{{- toYaml .Values.affinity | nindent 8 }}
|
|
{{- if .Values.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
|
|
{{- end }}
|
|
tolerations:
|
|
{{- toYaml .Values.tolerations | nindent 8 }}
|
|
{{- if (.Values.deployment.serviceAccountName) }}
|
|
serviceAccountName: {{ .Values.deployment.serviceAccountName}}
|
|
{{- end }}
|
|
|