Experimental version. The functionality may undergo significant changes. Compatibility with future versions is not guaranteed.

Basic usage

  1. Create a namespace called pg-test.

  2. Create a Postgres custom resource:

    apiVersion: managed-services.deckhouse.io/v1alpha1
    kind: Postgres
    metadata:
      name: pg-test
      namespace: pg-test
    spec:
      postgresClassName: default
      instance:
        memory:
          size: 1Gi
        cpu:
          cores: 1
          coreFraction: 100
        persistentVolumeClaim:
          size: 1Gi
      # configuration:
        # max_connections: "100"
      instances: 1
      postgresVersion:
        version: "17.4"
    
  3. Wait for the cluster to be ready:

    kubectl wait -n pg-test --for='jsonpath={.status.phase}="Cluster in healthy state"' postgres/pg-test
    
  4. Obtain the database credentials from the secret <cluster-name>-<database-name>:

    kubectl get secret -n pg-test pg-test-app --template={{.data.uri}} | base64 -d