apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "rsyncd.fullname" . }} labels: {{- include "rsyncd.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "rsyncd.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "rsyncd.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "rsyncd.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 }} env: name: ALLOW value: {{ .Values.allowNetwork | quote }} ports: - name: rsync containerPort: 873 protocol: TCP - name: ssh containerPort: 22 protocol: TCP livenessProbe: tcpSocket: port: 873 readinessProbe: tcpSocket: port: 873 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: rsync mountPath: /data volumes: - name: rsync {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ include "rsyncd.fullname" . }} {{- else }} emptyDir: {} {{- 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 }} {{- if .Values.hostNetwork }} hostNetwork: {{ .Values.hostNetwork }} {{- end }}