Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Code Block
    languagebash
    kubectl ns create <namespace name>
  2. Code Block
    languagebash
    kubectl ns <namespace name created by you in step 1>
  3. Code Block
    languagebash
    helm repo add bitnami https://charts.bitnami.com/bitnami
  4. create postgres_values.yaml to deploy Postgres

    1. Code Block
      languageyaml
      global:
        storageClass: "rook-ceph-block"
        postgresql:
          auth:
            password: password
            postgresPassword: password
            username: admin
      image:
        registry: docker.io
        repository: bitnami/postgresql
        tag: 11.13.0-debian-10-r40
        debug: true
        
      primary:
        initdb:
          scriptsConfigMap: ese-db-init
      postgresqlConfiguration:
        hugePages: "off"
        hugePages: off
        listenAddresses: "*"
      
      resources:
        limits:
          hugepages-2Mi: 500Mi
        requests:
          memory: 256Mi
          cpu: 250m
      
      extraVolumeMounts:
      - mountPath: /hugepages-2Mi
        name: hugepage-2mi
      
      extraVolumes:
      - name: hugepage-2mi
        emptyDir:
          medium: HugePages-2M
      
      networkPolicy:
        enabled: true
      

  5. Create the configMap ese-db-init (containing it will contain the ese-db-init.sql script, that should create tables in the database and insert necessary data for the test)

    Code Block
    languagebash
    kubectl create configmap ese-db-init --from-file ese-db-init.sql
  6. Code Block
    languagebash
    helm install postgres -f postgres_values.yaml bitnami/postgresql
  7. kubectl get pods (check the status of the pod it should be running)

    1. if the error is observed then check the pod logs

  8. connect Postgres pod using the following command to verify the connectio

    1. Code Block
      psql --host 127.0.0.1 -U postgres -d postgres -p 5432
    2. execute \l to list down the databases, \c <db name> to connect database, and \dt for listing down the tables;

...