Piped-Kubernetes/charts/apps/piped/templates/ytproxy/deployment.yaml
Skyler Mäntysaari 52ed0d9374 Progress
2023-02-15 03:25:36 +02:00

49 lines
No EOL
1.6 KiB
YAML

---
{{- if .Values.ytproxy.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ytproxy.names.fullname" . }}
{{- with (merge (.Values.ytproxy.labels | default dict) (include "common.labels" $ | fromYaml)) }}
labels: {{- toYaml . | nindent 4 }}
{{- end }}
{{- with (merge (.Values.ytproxy.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
revisionHistoryLimit: {{ .Values.ytproxy.revisionHistoryLimit }}
replicas: {{ .Values.ytproxy.replicas }}
{{- $strategy := default "Recreate" .Values.ytproxy.strategy }}
{{- if and (ne $strategy "Recreate") (ne $strategy "RollingUpdate") }}
{{- fail (printf "Not a valid strategy type for Deployment (%s)" $strategy) }}
{{- end }}
strategy:
type: {{ $strategy }}
{{- with .Values.ytproxy.rollingUpdate }}
{{- if and (eq $strategy "RollingUpdate") (or .surge .unavailable) }}
rollingUpdate:
{{- with .unavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- with .surge }}
maxSurge: {{ . }}
{{- end }}
{{- end }}
{{- end }}
selector:
matchLabels:
{{- include "ytproxy.labels.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with include ("ytproxy.podAnnotations") . }}
annotations:
{{- . | nindent 8 }}
{{- end }}
labels:
{{- include "ytproxy.labels.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- include "ytproxy.controller.pod" . | nindent 6 }}
{{- end }}