Abstract

Helm PostgreSQL documentation master file, created by sphinx-quickstart on Sun Apr 28 15:35:08 2024. You can adapt this file completely to your liking, but it should at least contain the root toctree directive.

Postgres Helm Chart#

Repository Contents#

Indices and tables#

wakatime

This chart deploys PostgreSQL in either a single-node or cluster configuration.

Usage#

Usage for this follows the usual pattern for Helm charts with the exception that secret values are expected to be passed in via the cli or stored in files under the secrets/ directory.

Install#

To install this chart follow these steps.

  1. Create a namespace.

    kubectl create ns postgresql
    
    1. (Optional) Install the unittest Helm plugin.

      helm plugin install https://github.com/helm-unittest/helm-unittest
      
    2. Run the unit tests.

      helm unittest -f 'tests/*.yaml' .
      

      You should see output similar to this.

      ### Chart [ postgresql ] .
      
      PASS  PostgreSQL Service Test Suite    tests/service_test.yaml
      PASS  PostgreSQL ServiceAccount Test Suite     tests/serviceaccount_test.yaml
      PASS  PostgreSQL StatefulSet Test Suite        tests/statefulset_test.yaml
      
      Charts:      1 passed, 1 total
      Test Suites: 3 passed, 3 total
      Tests:       9 passed, 9 total
      Snapshot:    0 passed, 0 total
      Time:        92.722398ms
      
  2. Install the chart with Helm.

    helm -n postgresql install postgresql .
    
  3. Run the tests included with Helm.

    helm -n postgresql test postgresql
    

Uninstall#

This can be done in the usual way.

helm -n postgresql uninstall postgresql

Q&D Install#

h upgrade --install postgres . -f secrets/$cluster.values.yaml -f $cluster.values.yaml

Notes#

In order to enable proper persistence, you must make sure to mount the /var/lib/postgresql/data directory as opposed to the /var/lib/postgresql directory as described in the Postgres docker image docs