github.com/codefresh-io/kcfi@v0.0.0-20230301195427-c1578715cc46/charts/codefresh-db-infra/templates/mongodb-deployment.yaml (about) 1 apiVersion: apps/v1 2 kind: Deployment 3 metadata: 4 name: mongodb 5 labels: {{ include "labels" . | indent 4 }} 6 spec: 7 replicas: 1 8 selector: 9 matchLabels: 10 component: codefresh-mongodb 11 strategy: 12 type: Recreate 13 template: 14 metadata: 15 labels: 16 component: codefresh-mongodb 17 spec: 18 {{- $podSecurityContext := (kindIs "invalid" .Values.podSecurityContextOverride) | ternary .Values.mongodb.podSecurityContext .Values.podSecurityContextOverride }} 19 {{- if and (kindIs "invalid" $podSecurityContext) (not (.Capabilities.APIVersions.Has "apps.openshift.io/v1"))}} 20 securityContext: 21 fsGroup: 0 22 {{- else }} 23 {{- with $podSecurityContext }} 24 securityContext: 25 {{ toYaml . | indent 8}} 26 {{- end }} 27 {{- end }} 28 restartPolicy: Always 29 containers: 30 - env: 31 {{- range $key, $value := .Values.mongodb.env }} 32 - name: {{ $key }} 33 value: {{ $value | quote }} 34 {{- end}} 35 name: mongodb 36 image: "{{ .Values.mongodb.repository }}:{{ .Values.mongodb.tag }}" 37 imagePullPolicy: "{{ .Values.mongodb.pullPolicy }}" 38 resources: 39 {{ toYaml $.Values.mongodb.resources | indent 10 }} 40 ports: 41 - containerPort: 27017 42 protocol: TCP 43 {{- if $.Values.persistence }} 44 volumeMounts: 45 - mountPath: /bitnami/mongodb 46 name: data 47 volumes: 48 - name: data 49 persistentVolumeClaim: 50 claimName: mongodb 51 {{- end }} 52 {{ include "nodeSelector" . | indent 8 }}