mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-11-26 19:30:47 +00:00
129 lines
3.8 KiB
YAML
129 lines
3.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
app.kubernetes.io/component: proxy
|
|
annotations:
|
|
version-source: {{ index .Chart.Annotations "version-source" }}
|
|
version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }}
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Release.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ .Release.Name }}
|
|
annotations:
|
|
checksum/config: {{ .Values.config | sha256sum }}
|
|
spec:
|
|
{{- if .Values.hostNetwork }}
|
|
hostNetwork: true
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.enabled }}
|
|
initContainers:
|
|
- name: init-state
|
|
image: busybox:1.37
|
|
command:
|
|
- /bin/sh
|
|
- -ec
|
|
- |
|
|
[ -f /data/state.yaml ] || echo "{}" > /data/state.yaml
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if .Values.persistence.enabled }}
|
|
args:
|
|
- -c
|
|
- /data/state.yaml
|
|
- -c
|
|
- /config/go2rtc.yaml
|
|
- -c
|
|
- /data/state.yaml
|
|
{{- else }}
|
|
args:
|
|
- -c
|
|
- /config/go2rtc.yaml
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.apiPort }}
|
|
protocol: TCP
|
|
- name: rtsp
|
|
containerPort: {{ .Values.rtspPort }}
|
|
protocol: TCP
|
|
- name: webrtc
|
|
containerPort: {{ .Values.webrtcPort }}
|
|
protocol: TCP
|
|
- name: webrtc-udp
|
|
containerPort: {{ .Values.webrtcPort }}
|
|
protocol: UDP
|
|
env:
|
|
- name: TZ
|
|
value: {{ .Values.timezone | quote }}
|
|
{{- if .Values.existingSecret }}
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.existingSecret }}
|
|
{{- end }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api
|
|
port: http
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
timeoutSeconds: 10
|
|
failureThreshold: 3
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
readOnly: true
|
|
{{- if .Values.persistence.enabled }}
|
|
- name: data
|
|
mountPath: /data
|
|
{{- end }}
|
|
volumes:
|
|
- name: config
|
|
configMap:
|
|
name: {{ .Release.Name }}-config
|
|
{{- if .Values.persistence.enabled }}
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Values.persistence.existingClaim | default (printf "%s-data" .Release.Name) }}
|
|
{{- end }}
|