{{/* # # SPDX-License-Identifier: Apache-2.0 # */}} {{- if .Values.manifests.deployment_fm_rest_api }} {{- $envAll := . }} {{- $mounts_fm_rest_api := .Values.pod.mounts.fm_rest_api.fm_rest_api }} {{- $mounts_fm_rest_api_init := .Values.pod.mounts.fm_rest_api.init_container }} {{- $serviceAccountName := "fm" }} {{ tuple $envAll "fmapi" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: apps/v1 kind: Deployment metadata: name: fm-rest-api labels: {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.api }} selector: matchLabels: {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} spec: serviceAccountName: {{ $serviceAccountName }} initContainers: {{ tuple $envAll "fmapi" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fm-rest-api volumeMounts: - name: fm-bin mountPath: /tmp/fm-rest-api.sh subPath: fm-rest-api.sh readOnly: true - name: fm-etc mountPath: /etc/fm/api-paste.ini subPath: api-paste.ini readOnly: true - name: fm-etc mountPath: /etc/fm/fm.conf subPath: fm.conf readOnly: true - name: fm-etc mountPath: /etc/fm/logging.conf subPath: logging.conf readOnly: true - name: fm-etc-event mountPath: /etc/fm/events.yaml readOnly: true command: - /tmp/fm-rest-api.sh image: "{{ .Values.images.tags.fm_rest_api }}" imagePullPolicy: {{ .Values.images.pullPolicy }} ports: - name: http containerPort: 18003 protocol: TCP resources: {{ toYaml .Values.resources | indent 12 }} nodeSelector: {{ .Values.labels.fm_api.node_selector_key }}: {{ .Values.labels.fm_api.node_selector_value }} affinity: {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }} volumes: - name: fm-etc secret: secretName: fm-etc defaultMode: 0644 - name: fm-bin configMap: name: fm-bin defaultMode: 0755 - name: fm-etc-event hostPath: path: /etc/fm/events.yaml type: File {{- end }}