Code Monkey home page Code Monkey logo

Comments (2)

kometen avatar kometen commented on July 24, 2024

If I move the settings to the file conf/pg_config.yaml:

primary:
  pgHbaConfiguration: |-
    # TYPE  DATABASE        USER             ADDRESS                METHOD

    # "local" is for Unix domain socket connections only
    local   all             all                                     trust
    # IPv4 local connections:
    #host    all             all              127.0.0.1/32           trust
    # IPv6 local connections:
    #host    all             all              ::1/128                trust
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    local   replication     all                                     trust
    host    replication     all              127.0.0.1/32           trust
    host    replication     all              ::1/128                trust

    host    {{ .Values.global.postgresql.auth.database }}            read_only_user ::0/0                  trust
    host    {{ .Values.global.postgresql.auth.database }}            read_only_user 0.0.0.0/0              trust
    host    {{ .Values.global.postgresql.auth.database }}            {{ .Values.global.postgresql.auth.username }}        ::0/0                  scram-sha-256
    host    {{ .Values.global.postgresql.auth.database }}            {{ .Values.global.postgresql.auth.username }}        0.0.0.0/0              scram-sha-256

    host    all             all              0.0.0.0/0              reject
    host    all             all              ::0/0                  reject

    # IPv4 local connections:
    # IPv6 local connections:
    # Unix socket connections:
    local   all             postgres                                trust
    # Enable streaming replication with wal2json:
    host    replication     all             127.0.0.1/32            trust

  initdb:
    scripts:
      local_init_script.sql: |
        create role read_only_user login;

And change helm install from . to bitnami/postgresql

microk8s helm install postgresql bitnami/postgresql --namespace foo -f values.yaml -f conf/pg_config.yaml

it installs the custom pg_hba.conf.

from charts.

kometen avatar kometen commented on July 24, 2024

I believe I can close this. Being fairly new to helm some implicit "mechanics" takes place beyond my knowledge. I initally created a helm create project when diving into helm and I modified Chart.yaml, values.yaml etc. for this helm chart. Using bitnami/postgresql later makes it work as expected.

microk8s helm install postgresql . --namespace foo
microk8s helm install postgresql bitnami/postgresql --namespace foo -f values.yaml -f conf/pg_conf.yaml

What confused me was that I could change default database and user with

global:
  postgresql:
    auth:
      username: "write_user"
      database: "marketing"

So I assumed it also would work with a custom pg_hba.conf.

from charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.