2024-11-14 08:13:40 +01:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ .Release.Name }}
|
2024-11-20 10:36:59 +01:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2024-11-14 08:13:40 +01:00
|
|
|
labels:
|
|
|
|
{{- include "basic-app.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "basic-app.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "basic-app.selectorLabels" . | nindent 8 }}
|
|
|
|
spec:
|
2024-11-20 10:32:53 +01:00
|
|
|
initContainers:
|
|
|
|
- name: git-cloner
|
|
|
|
image: "{{ .Values.updater.image.repository }}:{{ .Values.updater.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.updater.image.pullPolicy }}
|
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
|
|
|
mountPath: "/web"
|
|
|
|
command:
|
|
|
|
- /bin/sh
|
|
|
|
- -ec
|
|
|
|
- |
|
|
|
|
cd /web
|
|
|
|
test -d .git && exit 0
|
|
|
|
git clone ${GIT_URL} .
|
|
|
|
mkdir lib/config
|
|
|
|
git lfs install
|
|
|
|
git lfs pull
|
|
|
|
env:
|
|
|
|
- name: GIT_URL
|
|
|
|
value: "{{ .Values.updater.url }}"
|
2024-11-14 08:13:40 +01:00
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
protocol: TCP
|
2024-11-20 10:32:53 +01:00
|
|
|
name: http-svc
|
2024-11-14 08:13:40 +01:00
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
2024-11-20 10:32:53 +01:00
|
|
|
mountPath: /var/www/html
|
2024-11-14 08:25:23 +01:00
|
|
|
env:
|
|
|
|
{{- with .Values.env.plain }}
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range .Values.env.configMapKeys }}
|
|
|
|
- name: {{ .name }}
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
name: {{ .configMapName }}
|
|
|
|
key: {{ .key }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range .Values.env.secretKeys }}
|
|
|
|
- name: {{ .name }}
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .secretName }}
|
|
|
|
key: {{ .key }}
|
|
|
|
{{- end }}
|
|
|
|
envFrom:
|
|
|
|
{{- range .Values.env.configMapRefs }}
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ .name }}
|
|
|
|
optional: {{ .optional | default false }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range .Values.env.secretRefs }}
|
|
|
|
- secretRef:
|
|
|
|
name: {{ .name }}
|
|
|
|
optional: {{ .optional | default false }}
|
|
|
|
{{- end }}
|
2024-11-18 10:12:41 +01:00
|
|
|
- name: {{ .Chart.PullName }}
|
2024-11-20 10:32:53 +01:00
|
|
|
image: "{{ .Values.updater.image.repository }}:{{ .Values.updater.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.updater.image.pullPolicy }}
|
2024-11-18 10:12:41 +01:00
|
|
|
ports:
|
2024-11-20 10:32:53 +01:00
|
|
|
- containerPort: 8000
|
2024-11-18 10:12:41 +01:00
|
|
|
protocol: TCP
|
2024-11-20 10:32:53 +01:00
|
|
|
name: webhook-svc
|
2024-11-18 10:12:41 +01:00
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
2024-11-20 10:32:53 +01:00
|
|
|
mountPath: /web
|
2024-11-18 10:15:00 +01:00
|
|
|
env:
|
2024-11-20 10:32:53 +01:00
|
|
|
- name: "DATA_DIR"
|
|
|
|
value: "/web"
|
|
|
|
{{- with .Values.updater.env.plain }}
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2024-11-18 10:15:00 +01:00
|
|
|
{{- with .Values.env.plain }}
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range .Values.env.configMapKeys }}
|
|
|
|
- name: {{ .name }}
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
name: {{ .configMapName }}
|
|
|
|
key: {{ .key }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range .Values.env.secretKeys }}
|
|
|
|
- name: {{ .name }}
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .secretName }}
|
|
|
|
key: {{ .key }}
|
|
|
|
{{- end }}
|
|
|
|
envFrom:
|
|
|
|
{{- range .Values.env.configMapRefs }}
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ .name }}
|
|
|
|
optional: {{ .optional | default false }}
|
|
|
|
{{- end }}
|
2024-11-20 10:32:53 +01:00
|
|
|
- secretRef:
|
|
|
|
name: {{ .Release.Name }}-webhook-secret
|
2024-11-18 10:15:00 +01:00
|
|
|
{{- range .Values.env.secretRefs }}
|
|
|
|
- secretRef:
|
|
|
|
name: {{ .name }}
|
|
|
|
optional: {{ .optional | default false }}
|
|
|
|
{{- end }}
|
2024-11-14 08:13:40 +01:00
|
|
|
volumes:
|
|
|
|
- name: data
|
|
|
|
persistentVolumeClaim:
|
2024-11-20 10:32:53 +01:00
|
|
|
claimName: {{ .Release.Name }}-pvc
|