apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "rdpbroker.fullname" . }} labels: {{- include "rdpbroker.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "rdpbroker.selectorLabels" . | nindent 6 }} template: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "rdpbroker.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "rdpbroker.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: SAMBA_AD_SERVER value: {{ .Values.config.sambaAD.server | quote }} - name: SAMBA_AD_PORT value: {{ .Values.config.sambaAD.port | quote }} - name: SAMBA_AD_BASE_DN value: {{ .Values.config.sambaAD.baseDN | quote }} - name: RDP_LISTEN_PORT value: {{ .Values.config.rdp.listenPort | quote }} - name: TARGETS_CONFIG_PATH value: "/etc/rdpbroker/targets.yaml" - name: LOG_LEVEL value: {{ .Values.config.logging.level | quote }} ports: - name: rdp containerPort: {{ .Values.config.rdp.listenPort }} protocol: TCP volumeMounts: - name: targets-config mountPath: /etc/rdpbroker readOnly: true {{- if .Values.persistence.enabled }} - name: logs mountPath: {{ .Values.persistence.mountPath }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - name: targets-config configMap: name: {{ .Values.targets.existingConfigMap | default (printf "%s-targets" (include "rdpbroker.fullname" .)) }} {{- if .Values.persistence.enabled }} - name: logs persistentVolumeClaim: claimName: {{ include "rdpbroker.fullname" . }}-logs {{- 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 }}