copy from wekan

This commit is contained in:
titver968
2025-03-04 13:13:27 +01:00
parent 4b6e92761b
commit 9a4120c4be
4 changed files with 185 additions and 45 deletions

View File

@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tatort.fullname" . }}
labels:
{{- include "tatort.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "tatort,selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "tatort,labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "tatort,serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -1,68 +1,114 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "tatort.fullname" . }} name: {{ template "tatort.fullname" . }}
labels: labels:
{{- include "tatort.labels" . | nindent 4 }} app: {{ template "tatort.name" . }}
spec: chart: {{ template "tatort.chart" . }}
{{- if not .Values.autoscaling.enabled }} component: tatort
replicas: {{ .Values.replicaCount }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.deploymentLabels }}
{{- toYaml .Values.deploymentLabels | nindent 4 }}
{{- end }} {{- end }}
spec:
strategy:
{{ toYaml .Values.updateStrategy | nindent 4 }}
replicas: {{ .Values.replicaCount }}
selector: selector:
matchLabels: matchLabels:
{{- include "tatort,selectorLabels" . | nindent 6 }} app: {{ template "tatort.name" . }}
component: tatort
release: {{ .Release.Name }}
template: template:
metadata: metadata:
{{- with .Values.podAnnotations }}
annotations: annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels: labels:
{{- include "tatort,labels" . | nindent 8 }} app: {{ template "tatort.name" . }}
{{- with .Values.podLabels }} component: tatort
{{- toYaml . | nindent 8 }} release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "tatort,serviceAccountName" . }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "tatort.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccounts.automount }}
{{- if ne .Values.platform "openshift" }}
initContainers:
- name: volume-permissions
image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}"
imagePullPolicy: {{ .Values.init.image.pullPolicy }}
command: ['sh', '-c', 'chown -R 999:999 /data']
volumeMounts:
- name: shared-data-volume
mountPath: /data
resources:
{{- toYaml .Values.init.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.init.podSecurityContext | nindent 12 }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
terminationMessagePolicy: FallbackToLogsOnError
ports: ports:
- name: http - name: http
containerPort: {{ .Values.service.port }} containerPort: {{ .Values.service.port }}
protocol: TCP env:
livenessProbe: {{- if .value }}
{{- toYaml .Values.livenessProbe | nindent 12 }} - name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- range $key := .Values.secretEnv }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: {{ template "tatort.fullname" $ }}-secret
key: {{ .name }}
{{- end }}
envFrom:
{{- with .Values.extraEnvFrom }}
{{- tpl . $ | nindent 10 }}
{{- end }}
readinessProbe: readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }} httpGet:
resources: path: /
{{- toYaml .Values.resources | nindent 12 }} port: {{ .Values.service.port }}
{{- with .Values.volumeMounts }} initialDelaySeconds: 20
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.port }}
initialDelaySeconds: 60
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{ if .Values.sharedDataFolder.enabled }}
volumeMounts: volumeMounts:
{{- toYaml . | nindent 12 }} - name: shared-data-volume
{{- end }} mountPath: /data
{{- with .Values.volumes }} {{ end }}
volumes: resources:
{{- toYaml . | nindent 8 }} {{ toYaml .Values.resources | indent 12 }}
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- with .Values.affinity }} {{- if .Values.affinity }}
affinity: affinity:
{{- toYaml . | nindent 8 }} {{ toYaml .Values.affinity | indent 8 }}
{{- end }} {{- end }}
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{ if .Values.sharedDataFolder.enabled }}
volumes:
- name: shared-data-volume
persistentVolumeClaim:
claimName: {{ template "tatort.fullname" . }}-shared-data
{{ end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "tatort.fullname" . }}
labels:
{{- include "tatort.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "tatort.selectorLabels" . | nindent 4 }}

View File

@@ -1,9 +1,17 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "tatort.fullname" . }} {{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
name: {{ template "tatort.fullname" . }}
labels: labels:
{{- include "tatort.labels" . | nindent 4 }} app: {{ template "tatort.name" . }}
chart: {{ template "tatort.chart" . }}
component: tatort
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
@@ -12,4 +20,7 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
{{- include "tatort.selectorLabels" . | nindent 4 }} app: {{ template "tatort.name" . }}
component: tatort
release: {{ .Release.Name }}