charts icon indicating copy to clipboard operation
charts copied to clipboard

Add PostgresConfiguration fields pg_ident and pg_hba to cluster.yaml

Open nealcm opened this issue 1 year ago • 1 comments

Currently the cluster.yaml doesn't have several of the PostgresConfiguration fields exposed, even though they're available in the operator code.

https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration

It was added in November, but hasn't been exposed to be overridden in the charts: https://github.com/cloudnative-pg/cloudnative-pg/pull/3534/files#diff-f9048fd2dc7c8ebfb52c2c4156549537ce2a57009e3ffa2e852d28dda9015ebdR2809

pg_hba and pg_ident are supposed to be exposed here, but the cluster.yaml has to be entirely overridden to use them:

https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/templates/cluster.yaml#L54

Suggest adding templating to look at the values.yaml below the parameters.

  postgresql:
    shared_preload_libraries:
      {{- if eq .Values.type "timescaledb" }}
      - timescaledb
      {{- end }}
    {{- with .Values.cluster.postgresql }}
    parameters:
      {{- toYaml . | nindent 6 }}
    {{- end }}
    {{- with .Values.cluster.pg_ident }}
    pg_ident:
      {{- toYaml . | nindent 6 }}
    {{- end }}
    {{- with .Values.cluster.pg_hba }}
    pg_hba:
      {{- toYaml . | nindent 6 }}
    {{- end }}

nealcm avatar Jul 30 '24 17:07 nealcm

https://github.com/cloudnative-pg/charts/pull/343

nealcm avatar Jul 30 '24 17:07 nealcm

The MR was closed as a larger solution will be created https://github.com/cloudnative-pg/charts/pull/343#issuecomment-2259202144

Is there any ETA on this?

Stevenpc3 avatar Aug 09 '24 13:08 Stevenpc3

@Stevenpc3 I just merged #321 which adds pg_hba. It's on main but not yet released. I plan to release it along with several other breaking changes.

Would you mind creating a PR that adds pg_ident and shared_preload_libraries?

itay-grudev avatar Sep 04 '24 01:09 itay-grudev

yes we can add that. Thanks for the update 😄

Stevenpc3 avatar Sep 04 '24 12:09 Stevenpc3

https://github.com/cloudnative-pg/charts/pull/377

Stevenpc3 avatar Sep 05 '24 20:09 Stevenpc3