github.com/codefresh-io/kcfi@v0.0.0-20230301195427-c1578715cc46/charts/codefresh-db-infra/templates/postgresql-deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: postgresql
     5    labels: {{ include "labels" . | indent 4 }}
     6  spec:
     7    replicas: 1
     8    selector:
     9      matchLabels:
    10        component: codefresh-postgresql
    11    strategy:
    12      type: Recreate
    13    template:
    14      metadata:
    15        labels:
    16          component: codefresh-postgresql
    17      spec:
    18        {{- $podSecurityContext := (kindIs "invalid" .Values.podSecurityContextOverride) | ternary .Values.postgresql.podSecurityContext .Values.podSecurityContextOverride }}
    19        {{- if and (kindIs "invalid" $podSecurityContext) (not (.Capabilities.APIVersions.Has "apps.openshift.io/v1"))}}
    20        securityContext:
    21          fsGroup: 0
    22          runAsGroup: 0
    23          runAsUser: 26
    24        {{- else }}
    25        {{- with $podSecurityContext }}
    26        securityContext:
    27  {{ toYaml . | indent 8}}
    28        {{- end }}
    29        {{- end }}
    30        restartPolicy: Always
    31        containers:
    32        - env:
    33          {{- range $key, $value := .Values.postgresql.env }}
    34          - name: {{ $key }}
    35            value: {{ $value | quote }}
    36          {{- end}}
    37          name: postgresql
    38          command: ['sh', '-c', '/tmp/entry.sh']
    39          #command: ['sleep', '2d']
    40          image: "{{ .Values.postgresql.repository }}:{{ .Values.postgresql.tag }}"
    41          imagePullPolicy: "{{ .Values.postgresql.pullPolicy }}"
    42          resources:
    43  {{ toYaml $.Values.postgresql.resources | indent 10 }}
    44          ports:
    45          - containerPort: 5432
    46            protocol: TCP
    47        {{- if $.Values.persistence }}
    48          volumeMounts:
    49              - mountPath: /var/lib/postgresql/data
    50                name: data
    51        volumes:
    52          - name: data
    53            persistentVolumeClaim:
    54              claimName: postgresql
    55        {{- end }}
    56  {{ include "nodeSelector" . | indent 8 }}