# Ref:- /kra-data/setup/downloads/services # cd /kra-data/ndml-kra.devops/setup/services/dev/postgresql # container image download url - postgres:16 - https://hub.docker.com/layers/library/postgres/16/images/sha256-06176e3fc141cc2fa178a0c9038453300738cce657c3844f1bd9478d282e28e4?context=explore # push docker image to container image docker pull postgres:16 docker tag postgres:16 private-repo:5000/postgres:16 docker push private-repo:5000/postgres:16 # confirmed required docker images pushed on private registries. private-repo:5000/postgres:16 # check namespaces kubectl get ns # create namespace redmine kubectl create ns postgresql # open the postgresql-deployment.yaml file and check the mount path inside container, replicas, nodeSelector, container images, container port. # open the postgresql-deployment.yaml file and update storage section and host path to mount persistent volume. # deploy the file by below command kubectl apply -f '*.yaml' -n postgresql # output service/postgres-svc configured deployment.apps/postgres-db configured persistentvolume/postgres-pv-volume configured persistentvolumeclaim/postgres-pv-claim configured # confirmed deployment by running below command kubectl get all -n postgresql --------------------- (will give pods, deployment and service data) # check whether pods are in running state or not NAME READY STATUS RESTARTS AGE pod/postgresql-c8b4ffd7b-r57ks 1/1 Running 0 5h5m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/postgres ClusterIP 10.108.120.116 5432/TCP 4d1h NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/postgres 1/1 1 1 4d1h NAME DESIRED CURRENT READY AGE replicaset.apps/postgres-c8b4ffd7b 1 1 1 4d1h # check logs using below command kubectl logs -n postgresql # check description of pod using below command kubectl describe pod -n postgresql # exec into pod kubectl exec -it -n postgresql -- /bin/bash