Skip to content

Commit

Permalink
update crunchy chart
Browse files Browse the repository at this point in the history
  • Loading branch information
strangiato committed Jun 26, 2024
1 parent 33ed892 commit 7400d0d
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 36 deletions.
7 changes: 4 additions & 3 deletions charts/crunchy-postgres/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v2
name: postgrescluster
description: A Helm chart for deploying Postgres using the Crunchy Operator
description: A Helm chart for Kubernetes
type: application
version: 0.2.2
appVersion: 5.0.5
# The version below should match the version on the PostgresCluster CRD
version: 5.6.0
appVersion: 5.6.0
44 changes: 44 additions & 0 deletions charts/crunchy-postgres/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

This chart is a fork of the upstream Crunchy examples chart found here:

https://github.com/CrunchyData/postgres-operator-examples/tree/main/helm/postgres

## Installing the Chart

To access charts from this from the cli repository add it:

```sh
helm repo add strangiato https://strangiato.github.io/helm-charts/
helm repo update
helm upgrade -i [release-name] strangiato/{{ template "chart.name" . }}
```

To include a chart from this repository in an umbrella chart, include it in your dependencies in your `Chart.yaml` file.

```yaml
apiVersion: v2
name: example-chart
description: A Helm chart for Kubernetes
type: application

version: 0.1.0

appVersion: "1.16.0"

dependencies:
- name: "{{ template "chart.name" . }}"
version: "{{ template "chart.version" . }}"
repository: "https://strangiato.github.io/helm-charts/"
```

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
3 changes: 3 additions & 0 deletions charts/crunchy-postgres/templates/_s3.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ repo{{ add .index 1 }}-s3-key={{ .s3.key }}
{{- end }}
{{- if .s3.keySecret }}
repo{{ add .index 1 }}-s3-key-secret={{ .s3.keySecret }}
{{- end }}
{{- if .s3.keyType }}
repo{{ add .index 1 }}-s3-key-type={{ .s3.keyType }}
{{- end }}
{{- if .s3.encryptionPassphrase }}
repo{{ add .index 1 }}-cipher-pass={{ .s3.encryptionPassphrase }}
Expand Down
17 changes: 14 additions & 3 deletions charts/crunchy-postgres/templates/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: PostgresCluster
metadata:
name: {{ default .Release.Name .Values.name }}
spec:
postgresVersion: {{ default 13 .Values.postgresVersion }}
postgresVersion: {{ required "You must set the version of Postgres to deploy." .Values.postgresVersion }}
{{- if .Values.postGISVersion }}
postGISVersion: {{ quote .Values.postGISVersion }}
{{- end }}
Expand All @@ -21,6 +21,9 @@ spec:
- name: {{ default "instance1" .Values.instanceName | quote }}
replicas: {{ default 1 .Values.instanceReplicas }}
dataVolumeClaimSpec:
{{- if .Values.instanceStorageClassName }}
storageClassName: {{ .Values.instanceStorageClassName | quote }}
{{- end }}
accessModes:
- "ReadWriteOnce"
resources:
Expand Down Expand Up @@ -56,6 +59,9 @@ spec:
{{- if $repo.volume }}
volume:
volumeClaimSpec:
{{- if $repo.volume.backupsStorageClassName }}
storageClassName: {{ .Values.backupsStorageClassName | quote }}
{{- end }}
accessModes:
- "ReadWriteOnce"
resources:
Expand Down Expand Up @@ -114,6 +120,9 @@ spec:
- name: repo1
volume:
volumeClaimSpec:
{{- if .Values.backupsStorageClassName }}
storageClassName: {{ .Values.backupsStorageClassName | quote }}
{{- end }}
accessModes:
- "ReadWriteOnce"
resources:
Expand Down Expand Up @@ -145,7 +154,7 @@ spec:
{{ toYaml .Values.service | indent 4 }}
{{- end }}
{{- if .Values.dataSource }}
service:
dataSource:
{{ toYaml .Values.dataSource | indent 4 }}
{{- end }}
{{- if .Values.databaseInitSQL }}
Expand Down Expand Up @@ -182,7 +191,9 @@ spec:
{{- if .Values.standby }}
standby:
enabled: {{ .Values.standby.enabled }}
repoName: {{ required "repoName must be set when enabling standby mode." .Values.standby.repoName }}
repoName: {{ .Values.standby.repoName }}
host: {{ .Values.standby.host }}
port: {{ .Values.standby.port }}
{{- end }}
{{- if .Values.supplementalGroups }}
supplementalGroups:
Expand Down
77 changes: 47 additions & 30 deletions charts/crunchy-postgres/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# postgresVersion sets the version to deploy. This version number needs to be
# available as one of the "RELATED_IMAGE_POSTGRES_..." images as part of the PGO
# installation if you want to deploy the image without setting the "postgres"
# image variable. This defaults to the below value.
postgresVersion: 14
# image variable. This value is required.
postgresVersion: 16

# postGISVersion if sets and coupled with a PostGIS enabled container, enables
# postGISVersion if set and coupled with a PostGIS enabled container, enables
# PostGIS. This version number needs to be available as one of the
# "RELATED_IMAGE_POSTGRES_..." images as part of the PGO installation if you
# want to deploy the image without setting the "postgres" image variable.
Expand All @@ -32,10 +32,10 @@ postgresVersion: 14
# "pgBouncerConfig". Setting "pgBouncerConfig" will override the value of
# pgBouncerReplicas. The "RELATED_IMAGE_PGBOUNCER" in the PGO deployment must be
# set if you want to enable this without explicitly setting "pgBouncer".
pgBouncerReplicas: 2
# pgBouncerReplicas: 1

# monitoring enables the ability to monitor the Postgres cluster through a
# metrics exporter than can be scraped by Prometheus. This defaults to the value
# metrics exporter that can be scraped by Prometheus. This defaults to the value
# below.
# monitoring: false

Expand All @@ -47,19 +47,19 @@ pgBouncerReplicas: 2
# below value. "postgresVersion" needs to match the version of Postgres that is
# used here. If using the GIS-enabled Postgres image, you need to ensure
# "postGISVersion" matches the version of PostGIS used.
# imagePostgres: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.6-0
# imagePostgres: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1

# imagePgBackRest is the pgBackRest backup utility image. This defaults to the
# below value.
# imagePgBackRest: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-1
# imagePgBackRest: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1

# imagePgBouncer is the image for the PgBouncer connection pooler. This defaults
# to the below value.
# imagePgBouncer: registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:centos8-1.16-1
# imagePgBouncer: registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1

# imageExporter is the image name for the exporter used as a part of monitoring.
# This defaults to the value below.
# imageExporter: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-5.0.5-0
# imageExporter: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-0.15.0-7

###########################
# Basic Postgres Settings #
Expand All @@ -73,6 +73,12 @@ pgBouncerReplicas: 2
# to the value below. Settings "instances" overrides this value.
# instanceSize: 1Gi

# instanceStorageClassName sets the storage class for the volume that contains the data.
# This defaults to the "default" storage class defined in the cluster.
# See: 'kubectl get storageclasses.storage.k8s.io | grep default'
# Settings "instances" overrides this value.
# instanceStorageClassName: "hostpath"

# instanceMemory sets the memory limit for the Postgres instances. This defaults
# to no limit being set, but an example value is set below. Settings "instances"
# overrides this value.
Expand All @@ -86,7 +92,7 @@ pgBouncerReplicas: 2
# instanceReplicas lets you set the total number of Postgres replicas. This
# defaults to the value below. More than on replica enables high availability
# (HA). Settings "instances" overrides this value.
instanceReplicas: 2
# instanceReplicas: 1

##############################
# Advanced Postgres Settings #
Expand Down Expand Up @@ -127,7 +133,7 @@ instanceReplicas: 2
# patroni: {}

# users sets any custom Postgres users and databases that they have access to
# as well as any permossions assoicated with the user account.
# as well as any permissions associated with the user account.
# users: {}

# dataSource specifies a data source for bootstrapping a Postgres cluster.
Expand All @@ -143,21 +149,23 @@ instanceReplicas: 2
# provides the information for the replication user.
# customReplicationTLSSecret: {}

# databaseInitSQL referencs a ConfigMap that contains a SQL file that should be
# databaseInitSQL references a ConfigMap that contains a SQL file that should be
# run a cluster bootstrap.
# databaseInitSQL:
# name: bootstrap-sql
# key: bootstrap.sql

# standby sets whether or not to run this as a standby cluster. Both of the
# values below are required to enable a standby cluster. Setting "enabled" to
# "true" eunables the standby cluster while "repoName" points to a pgBackRest
# archive to replay WAL files from.
# standby sets whether to run this as a standby cluster. Setting "enabled" to
# "true" enables the standby cluster while "repoName" points to a pgBackRest
# archive to replay WAL files from, and "host" and "port" point to a primary
# cluster from which to stream data.
# standby:
# enabled: false
# repoName: repo1
# host: "192.0.2.2"
# port: 5432

# shutdown when set scales the entire workload to zero. By default this is not
# shutdown when set scales the entire workload to zero. By default, this is not
# set.
# shutdown: true

Expand All @@ -169,6 +177,11 @@ instanceReplicas: 2
# can be overridden by "pgBackRestConfig", if set. Defaults to the value below.
# backupsSize: 1Gi

# backupsStorageClassName sets the storage class to a class existing in Kubernetes.
# Defaults to the "default" storage class defined in the cluster.
# Can be overridden by "pgBackRestConfig", if set.
# backupsStorageClassName: "hostpath"

# s3 allows for AWS S3 or an S3 compatible storage system to be used for
# backups. This allows for a quick setup with S3; if you need more advanced
# setup, use pgBackRestConfig.
Expand All @@ -178,15 +191,18 @@ instanceReplicas: 2
# # endpoint specifies the S3 endpoint to use.
# endpoint: ""
# # region specifies the S3 region to use. If your S3 storage system does not
# # use "region", fill this in with a random vaule.
# # use "region", fill this in with a random value.
# region: ""
# # key is the S3 key. This is stored in a Secret.
# key: ""
# # keySecret is the S3 key secret. This is tored in a Secret.
# # keySecret is the S3 key secret. This is stored in a Secret.
# keySecret: ""
# # keyType can be configured to enable IAM integration via AssumeRole
# # For more info, see the documentation at https://access.crunchydata.com/documentation/postgres-operator/v5/tutorial/backups/#using-an-aws-integrated-identity-provider-and-role
# keyType: ""
# # encryptionPassphrase is an optional parameter to enable encrypted backups
# # with pgBackRest. This is encrypted by pgBackRest and does not use S3's
# # built-in encrpytion system.
# # built-in encryption system.
# encryptionPassphrase: ""

# gcs allows for Google Cloud Storage (GCS) to be used for backups. This allows
Expand All @@ -206,7 +222,7 @@ instanceReplicas: 2
# azure:
# # account is the name of the Azure account to be used.
# account: ""
# # key is the Secret key used associated with the Azure acount.
# # key is the Secret key used associated with the Azure account.
# key: ""
# # container is the Azure container that the backups will be stored in.
# container: ""
Expand All @@ -219,8 +235,8 @@ instanceReplicas: 2
# You can't set "multiBackupRepos" and any of the individual quickstarts at the
# same time. "multiBackupRepos" will take precedence.
#
# Below is an example that enables one of each backup type. Note all of the
# available quickstart options are presented below; please see the backup types
# Below is an example that enables one of each backup type.
# All available quickstart options are presented below; please see the backup types
# if you want to see how each option works.
# multiBackupRepos:
# - volume:
Expand All @@ -231,6 +247,7 @@ instanceReplicas: 2
# region: ""
# key: ""
# keySecret: ""
# keyType: ""
# - gcs:
# bucket: ""
# key: |
Expand All @@ -248,15 +265,15 @@ instanceReplicas: 2
# Pooling / pgBouncer Settings #
################################

# pgBouncerConfig sets all of the pgBouncer portion of the spec except for
# pgBouncerConfig sets all of the pgBouncer portions of the spec except for
# image. To set image, you need to set the "pgBouncer" setting.
# pgBouncerConfig: {}

#######################
# Monitoring Settings #
#######################

# monitoringConfig sets all of the monitoring portion of the spec except for the
# monitoringConfig sets all of the monitoring portions of the spec except for the
# image. To set the image, which also enables monitoring, you need to set the
# "monitoring" setting.
# monitoringConfig: {}
Expand All @@ -267,7 +284,7 @@ instanceReplicas: 2

# metadata contains any metadata that should be applied to all PGO managed
# objects in this Postgres cluster. This includes "annotations" and "labels" as
# subkeys.
# sub-keys.
# metadata: {}

# service customizes the Service that exposes the Postgres primary.
Expand All @@ -283,7 +300,7 @@ instanceReplicas: 2
# imagePullSecrets: []

# supplementalGroups sets any group IDs that should be assigned to
# Pods, particularly around file system contraints within a system
# Pods, particularly around file system constraints within a system
# supplementalGroups: []

# disableDefaultPodScheduling if set to true, will disable any of the default
Expand All @@ -292,8 +309,8 @@ instanceReplicas: 2
# be used in addition to any customizations that are added in.
# disableDefaultPodScheduling: false

# openshift can set explicitly if this is an OpenShift cluster, or a cluster
# openshift can be set explicitly if this is an OpenShift cluster or a cluster
# that uses a SecurityContextConstraint. This usually does not need to be set,
# but you may want to explicitly set it to "false" when using a SCC like
# but you may want to explicitly set it to "false" when using an SCC like
# "anyuid"
openshift: true
# openshift: false

0 comments on commit 7400d0d

Please sign in to comment.