# Kubernetes API version apiVersion: apps/v1 # Deployment object kind: Deployment metadata: # The name of the Deployment name: postgresdb namespace: kore labels: app: postgresdb component: dply tier: data-db group: core spec: # Replicas for this Deployment replicas: 1 selector: # labels the pods matchLabels: app: postgresdb component: dply tier: data-db group: core template: metadata: labels: # The label the pods created from the pod template should have app: postgresdb component: dply tier: data-db group: core spec: containers: # The container name to execute pods - name: postgresdb # pull postgresimage from docker hub #image: postgres:16.0 image: postgres:latest #command: ['sh', '-c', 'while true; do sleep 20; done;'] ports: # Assign ports to expose container - containerPort: 5432 envFrom: # Load the environment variables/PostgresSQL credentials - configMapRef: # This should be the ConfigMap name created ealier name: db-secret-credentials volumeMounts: # The volume mounts for the container - mountPath: /var/lib/postgresql/data name: db-data - mountPath: /etc/postgresql name: db-root imagePullPolicy: IfNotPresent #priorityClassName: wuji-high-priority-nonpreempting nodeSelector: #rolenode: storage kubernetes.io/hostname: wuji-strg-1 #kubernetes.io/hostname: wuji-cp-1 imagePullSecrets: - name: lco-sql-mariadb-termasreg terminationGracePeriodSeconds: 30 # Volumes attached to the pod volumes: - name: db-data persistentVolumeClaim: # reference the PersistentVolumeClaim claimName: postgresdb-data-pv-claim - name: db-root persistentVolumeClaim: # reference the PersistentVolumeClaim claimName: postgresdb-root-pv-claim