update lakekeeper/0.11.0
- chart 0.8.1 → 0.11.0 (appVersion 0.10.4 → 0.12.2) - deps: postgres 1.5.8 → 1.5.13, openfga 0.2.44 → 0.2.62 - ingress: Kong → APISIX (use-regex + path /.*, cluster-issuer) - openfga.playground 비활성화 (preshared 인증 패닉 방지) - breaking=false, custom-values 키 전부 호환 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v2
|
||||
appVersion: "17.9"
|
||||
description: A Helm chart for PostgreSQL on Kubernetes
|
||||
icon: https://www.postgresql.org/media/img/about/press/elephant64.png
|
||||
keywords:
|
||||
- database
|
||||
- postgres
|
||||
maintainers:
|
||||
- name: groundhog2k
|
||||
url: https://github.com/groundhog2k/helm-charts
|
||||
name: postgres
|
||||
type: application
|
||||
version: 1.5.13
|
||||
@@ -0,0 +1,170 @@
|
||||
# PostgreSQL
|
||||
|
||||
  
|
||||
|
||||
## Changelog
|
||||
|
||||
see [RELEASENOTES.md](RELEASENOTES.md)
|
||||
|
||||
A Helm chart for PostgreSQL on Kubernetes
|
||||
|
||||
## ⚠️ Warning
|
||||
|
||||
There is no automatic database upgrade from PostgreSQL 13.x (Chart version 0.2.x) to PostgreSQL 14.x (Chart version 0.3.x) or Postgres 14.x to Postgres 15.x (Chart version 0.4.x) etc. Upgrade deployment will fail in case of a major version change.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```bash
|
||||
helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
|
||||
helm install my-release groundhog2k/postgres
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart uses the original [PostgreSQL image from Docker Hub](https://hub.docker.com/_/postgres/) to deploy a stateful PostgreSQL instance in a Kubernetes cluster.
|
||||
|
||||
It fully supports deployment of the multi-architecture docker image.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.12+
|
||||
- Helm 3.x
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```bash
|
||||
helm install my-release groundhog2k/postgres
|
||||
```
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```bash
|
||||
helm uninstall my-release
|
||||
```
|
||||
|
||||
## Common parameters
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| fullnameOverride | string | `""` | Fully override the deployment name |
|
||||
| nameOverride | string | `""` | Partially override the deployment name |
|
||||
|
||||
## Deployment parameters
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
|
||||
| image.registry | string | `"docker.io"` | Image registry |
|
||||
| image.repository | string | `"postgres"` | Image name |
|
||||
| image.tag | string | `""` | Image tag |
|
||||
| imagePullSecrets | list | `[]` | Image pull secrets |
|
||||
| extraInitContainers | list | `[]` | Extra init containers |
|
||||
| extaContainers | list | `[]` | Extra containers for usage as sidecars |
|
||||
| startupProbe | object | `see values.yaml` | Startup probe configuration |
|
||||
| livenessProbe | object | `see values.yaml` | Liveness probe configuration |
|
||||
| readinessProbe | object | `see values.yaml` | Readiness probe configuration |
|
||||
| customStartupProbe | object | `{}` | Custom startup probe (overwrites default startup probe configuration) |
|
||||
| customLivenessProbe | object | `{}` | Custom liveness probe (overwrites default liveness probe configuration) |
|
||||
| customReadinessProbe | object | `{}` | Custom readiness probe (overwrites default readiness probe configuration) |
|
||||
| initResources | object | `{}` | Resource limits and requests for the default init container |
|
||||
| resources | object | `{}` | Resource limits and requests |
|
||||
| priorityClassName | string | `""` | Deployment priority class name |
|
||||
| nodeSelector | object | `{}` | Deployment node selector |
|
||||
| customLabels | object | `{}` | Additional labels for Deployment or StatefulSet |
|
||||
| customAnnotations | object | `{}` | Additional annotations for Deployment or StatefulSet |
|
||||
| podAnnotations | object | `{}` | Additional pod annotations |
|
||||
| podLabels | object | `{}` | Additional pod labels |
|
||||
| podSecurityContext | object | `see values.yaml` | Pod security context |
|
||||
| securityContext | object | `see values.yaml` | Container security context |
|
||||
| env | list | `[]` | Additional container environmment variables |
|
||||
| args | list | `[]` | Arguments for the container entrypoint process |
|
||||
| serviceAccount.annotations | object | `{}` | Additional service account annotations |
|
||||
| serviceAccount.create | bool | `false` | Enable service account creation |
|
||||
| serviceAccount.name | string | `""` | Name of the service account |
|
||||
| affinity | object | `{}` | Affinity for pod assignment |
|
||||
| tolerations | list | `[]` | Tolerations for pod assignment |
|
||||
| topologySpreadConstraints | object | `{}` | Topology spread constraints for pods |
|
||||
| podManagementPolicy | string | `"OrderedReady"` | Pod management policy |
|
||||
| updateStrategyType | string | `"RollingUpdate"` | Pod update strategy |
|
||||
| revisionHistoryLimit | int | `nil` | Maximum number of revisions maintained in revision history
|
||||
|
||||
## Service paramters
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| service.type | string | `"ClusterIP"` | Service type |
|
||||
| service.port | int | `5432` | PostreSQL service port |
|
||||
| service.nodePort | int | `nil` | The node port (only relevant for type LoadBalancer or NodePort) |
|
||||
| service.clusterIP | string | `nil` | The cluster ip address (only relevant for type LoadBalancer or NodePort) |
|
||||
| service.loadBalancerIP | string | `nil` | The load balancer ip address (only relevant for type LoadBalancer) |
|
||||
| service.loadBalancerSourceRanges | list | `[]` | The list of IP CIDR ranges that are allowed to access the load balancer (only relevent for type LoadBalancer) |
|
||||
| service.annotations | object | `{}` | Additional service annotations |
|
||||
| service.labels | object | `{}` | Additional service labels |
|
||||
|
||||
## Network policies
|
||||
|
||||
Allows to define optional network policies for [ingress and egress](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
||||
The policyTypes will be automatically set
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| networkPolicy.ingress | object | `{}` | Ingress network policies |
|
||||
| networkPolicy.egress | object | `{}` | Egress network policies |
|
||||
|
||||
## Storage parameters
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| storage.accessModes[0] | string | `"ReadWriteOnce"` | Storage access mode |
|
||||
| storage.persistentVolumeClaimName | string | `nil` | PVC name when existing storage volume should be used |
|
||||
| storage.volumeName | string | `"postgres-data"` | Internal volume name and prefix of a created PVC |
|
||||
| storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used |
|
||||
| storage.className | string | `nil` | Storage class name |
|
||||
| storage.keepPvc | bool | `false` | Keep a created Persistent volume claim when uninstalling the helm chart (only for option `useDeployment: true`) |
|
||||
| storage.persistentVolumeClaimRetentionPolicy.whenDeleted | string | `nil` | Persistent volume claim retention policy when StatefulSet is deleted - Valid values: `Retain` or `Delete` (only applies when `useDeployment: false`) |
|
||||
| storage.persistentVolumeClaimRetentionPolicy.whenScaled | string | `nil` | Persistent volume claim retention policy when StatefulSet is scaled down - Valid values: `Retain` or `Delete` (only applies when `useDeployment: false`) |
|
||||
| storage.annotations | object | `{}` | Additional storage annotations |
|
||||
| storage.labels | object | `{}` | Additional storage labels |
|
||||
| extraStorage | list | `[]` | A list of additional existing PVC that will be mounted into the container |
|
||||
| extraStorage[].name | string | `nil` | Internal name of the volume |
|
||||
| extraStorage[].pvcName | string | `nil` | Name of the existing PVC |
|
||||
| extraStorage[].mountPath | string | `nil` | Mount path where the PVC should be mounted into the container |
|
||||
|
||||
## PostgreSQL parameters
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| useDeployment | bool | `false` | Use Kubernetes Deployment instead of StatefulSet |
|
||||
| settings.authMethod | string | `nil` | Postgres database authentication method |
|
||||
| settings.initDbArgs | string | `nil` | Optional init database arguments |
|
||||
| settings.dataDir | string | `"/var/lib/postgresql/data"` | Default data directory mountpoint |
|
||||
| settings.pgDir | string | `"pg"` | Name of the postgres directory inside data directory |
|
||||
| settings.superuser.secretKey | string | `nil` | Key of existingSecret for the Superuser name |
|
||||
| settings.superuser.value | string | `nil` | Superuser name (if no existingSecret was specified) - defaults to "postgres" |
|
||||
| settings.superuserPassword.secretKey | string | `nil` | Key of existingSecret for the Superuser password |
|
||||
| settings.superuserPassword.value | string | `nil` | Password of Superuser (if no existingSecret was specified) |
|
||||
| userDatabase.existingSecret | string | `nil` | Optional existing secret with database name, user and password |
|
||||
| userDatabase.name.secretKey | string | `""` | Key of the existingSecret with database name |
|
||||
| userDatabase.name.value | string | `""` | Name of the user database (if no existingSecret was specified) |
|
||||
| userDatabase.user.secretKey | string | `""` | Key of the existingSecret with database user |
|
||||
| userDatabase.user.value | string | `""` | User name with full access to user database (if no existingSecret was specified) |
|
||||
| userDatabase.password.secretKey | string | `""` | Key of the existingSecret with password of created user |
|
||||
| userDatabase.password.value | string | `""` | Password of created user (if no existingSecret was specified) |
|
||||
| customConfig | string | `nil` | Optional custom configuration block that will be mounted as file in `/etc/postgresql/postgresql.conf` |
|
||||
| extraEnvSecrets | list | `[]` | A list of existing secrets that will be mounted into the container as environment variables |
|
||||
| extraSecretConfigs | string | `nil` | An existing secret with files that will be added to the postgres configuration in addition to `/etc/postgresql/postgresql.conf` |
|
||||
| customScripts | object | `nil` | Optional custom scripts that can be defined inline and will be mounted as files in `/docker-entrypoint-initdb.d` |
|
||||
| extraScripts | string | `nil` | An existing configMap with files that will be mounted into the container as script files (`*.sql`, `*.sh`) in `/docker-entrypoint-initdb.d` |
|
||||
| extraSecrets | list | `[]` | A list of additional existing secrets that will be mounted into the container |
|
||||
| extraSecrets[].name | string | `nil` | Name of the existing K8s secret |
|
||||
| extraSecrets[].defaultMode | int | `0440` | Mount default access mode |
|
||||
| extraSecrets[].mountPath | string | `nil` | Mount path where the secret should be mounted into the container (f.e. /mysecretfolder) |
|
||||
| extraConfigs | list | `[]` | A list of additional existing configMaps that will be mounted into the container |
|
||||
| extraConfigs[].name | string | `nil` | Name of the existing K8s configMap |
|
||||
| extraConfigs[].defaultMode | int | `0440` | Mount default access mode |
|
||||
| extraConfigs[].mountPath | string | `nil` | Mount path where the configMap should be mounted into the container (f.e. /myconfigfolder) |
|
||||
@@ -0,0 +1,112 @@
|
||||
# Changelog
|
||||
|
||||
| Chart version | App version | Change description |
|
||||
| :------------ | :---------- | :----------------- |
|
||||
| 0.2.16 | 13.5 | Fixes bug with wrong mounted customConfig #811 |
|
||||
| 0.2.17 | 13.5 | Implemented support for extra secrets and advanced configuration capabilites |
|
||||
| 0.2.18 | 13.5 | Implemented support for extra containers |
|
||||
| 0.2.19 | 13.6 | Upgraded to Postgres 13.6 |
|
||||
| 0.2.20 | 13.7 | Upgraded to Postgres 13.7 |
|
||||
| 0.2.21 | 13.8 | Upgraded to Postgres 13.8 |
|
||||
| 0.2.22 | 13.8 | Implemented support for custom inline init scripts and image.registry option |
|
||||
| 0.2.23 | 13.9 | Upgraded to Postgres 13.9 |
|
||||
| 0.2.24 | 13.10 | Upgraded to Postgres 13.10 |
|
||||
| 0.2.25 | 13.11 | Upgraded to Postgres 13.11 |
|
||||
| 0.2.26 | 13.12 | Upgraded to Postgres 13.12 |
|
||||
| 0.2.27 | 13.13 | Upgraded to Postgres 13.13 |
|
||||
| 0.2.28 | 13.14 | Upgraded to Postgres 13.14 |
|
||||
| 0.3.4 | 14.1 | Fixes bug with wrong mounted customConfig #811 |
|
||||
| 0.3.5 | 14.1 | Updated readme and release notes |
|
||||
| 0.3.6 | 14.1 | Implemented support for extra secrets and advanced configuration capabilites |
|
||||
| 0.3.7 | 14.1 | Implemented support for extra containers |
|
||||
| 0.3.8 | 14.2 | Upgraded to Postgres 14.2 |
|
||||
| 0.3.9 | 14.3 | Upgraded to Postgres 14.3 |
|
||||
| 0.3.10 | 14.4 | Upgraded to Postgres 14.4 |
|
||||
| 0.3.11 | 14.5 | Upgraded to Postgres 14.5 |
|
||||
| 0.3.12 | 14.5 | Implemented support for custom inline init scripts |
|
||||
| 0.3.13 | 14.5 | Implemented support for image.registry option |
|
||||
| 0.3.14 | 14.6 | Upgraded to Postgres 14.6 |
|
||||
| 0.3.15 | 14.7 | Upgraded to Postgres 14.7 |
|
||||
| 0.3.16 | 14.8 | Upgraded to Postgres 14.8 |
|
||||
| 0.3.17 | 14.9 | Upgraded to Postgres 14.9 |
|
||||
| 0.3.18 | 14.10 | Upgraded to Postgres 14.10 |
|
||||
| 0.3.19 | 14.11 | Upgraded to Postgres 14.11 |
|
||||
| 0.4.0 | 15.0 | Upgraded to Postgres 15.0 |
|
||||
| 0.4.1 | 15.1 | Upgraded to Postgres 15.1 |
|
||||
| 0.4.2 | 15.2 | Upgraded to Postgres 15.2 |
|
||||
| 0.4.3 | 15.2 | Implemented alternative distribution with `Deployment` template |
|
||||
| 0.4.4 | 15.2 | Updated default security context |
|
||||
| 0.4.5 | 15.3 | Upgraded to Postgres 15.3 |
|
||||
| 0.4.6 | 15.4 | Upgraded to Postgres 15.4 |
|
||||
| 0.4.7 | 15.5 | Upgraded to Postgres 15.5 |
|
||||
| 0.4.8 | 15.6 | Upgraded to Postgres 15.6 |
|
||||
| 0.5.0 | 16.0 | Upgraded to Postgres 16.0 |
|
||||
| 0.5.1 | 16.1 | Upgraded to Postgres 16.1 |
|
||||
| 0.5.2 | 16.1 | Added support for network policies and additional labels and annotations |
|
||||
| 0.5.3 | 16.2 | Upgraded to Postgres 16.2 |
|
||||
| 1.0.0 | 12.8 | Final version with configuration secret, extra config and extra volume support |
|
||||
| 1.0.1 | 12.8 | Fixed missing envFrom |
|
||||
| 1.0.2 | 12.18 | Fixed missing envFrom |
|
||||
| 1.0.3 | 12.20 | Upgraded to Postgres 12.20 |
|
||||
| 1.0.4 | 12.22 | Upgraded to Postgres 12.22 |
|
||||
| 1.1.0 | 13.14 | Final version with configuration secret, extra config and extra volume support |
|
||||
| 1.1.1 | 13.14 | Fixed missing envFrom |
|
||||
| 1.1.2 | 13.15 | Upgraded to Postgres 13.15 |
|
||||
| 1.1.3 | 13.16 | Upgraded to Postgres 13.16 |
|
||||
| 1.1.4 | 13.18 | Upgraded to Postgres 13.18 |
|
||||
| 1.1.5 | 13.19 | Upgraded to Postgres 13.19 |
|
||||
| 1.1.6 | 13.20 | Upgraded to Postgres 13.20 |
|
||||
| 1.1.7 | 13.21 | Upgraded to Postgres 13.21 |
|
||||
| 1.1.8 | 13.22 | Upgraded to Postgres 13.22 |
|
||||
| 1.2.0 | 14.11 | Final version with configuration secret, extra config and extra volume support |
|
||||
| 1.2.1 | 14.11 | Fixed missing envFrom |
|
||||
| 1.2.2 | 14.12 | Upgraded to Postgres 14.12 |
|
||||
| 1.2.3 | 14.13 | Upgraded to Postgres 14.13 |
|
||||
| 1.2.4 | 14.15 | Upgraded to Postgres 14.15 |
|
||||
| 1.2.5 | 14.16 | Upgraded to Postgres 14.16 |
|
||||
| 1.2.6 | 14.17 | Upgraded to Postgres 14.17 |
|
||||
| 1.2.7 | 14.18 | Upgraded to Postgres 14.18 |
|
||||
| 1.2.8 | 14.19 | Upgraded to Postgres 14.19 |
|
||||
| 1.2.9 | 14.20 | Upgraded to Postgres 14.20 |
|
||||
| 1.2.10 | 14.22 | Upgraded to Postgres 14.22 |
|
||||
| 1.3.0 | 15.6 | Final version with configuration secret, extra config and extra volume support |
|
||||
| 1.3.1 | 15.6 | Fixed missing envFrom |
|
||||
| 1.3.2 | 15.7 | Upgraded to Postgres 15.7 |
|
||||
| 1.3.3 | 15.8 | Upgraded to Postgres 15.8 |
|
||||
| 1.3.2 | 15.7 | Upgraded to Postgres 15.7 |
|
||||
| 1.3.4 | 15.10 | Upgraded to Postgres 15.10 |
|
||||
| 1.3.5 | 15.11 | Upgraded to Postgres 15.11 |
|
||||
| 1.3.6 | 15.12 | Upgraded to Postgres 15.12 |
|
||||
| 1.3.7 | 15.13 | Upgraded to Postgres 15.13 |
|
||||
| 1.3.8 | 15.14 | Upgraded to Postgres 15.14 |
|
||||
| 1.3.9 | 15.15 | Upgraded to Postgres 15.15 |
|
||||
| 1.3.10 | 15.17 | Upgraded to Postgres 15.17 |
|
||||
| 1.4.0 | 16.2 | Final version with configuration secret, extra config and extra volume support |
|
||||
| 1.4.1 | 16.2 | Fixed missing envFrom |
|
||||
| 1.4.2 | 16.2 | Updated README |
|
||||
| 1.4.3 | 16.3 | Upgraded to Postgres 16.3 |
|
||||
| 1.4.4 | 16.4 | Upgraded to Postgres 16.4 |
|
||||
| 1.4.5 | 16.6 | Upgraded to Postgres 16.6 |
|
||||
| 1.4.6 | 16.7 | Upgraded to Postgres 16.7 |
|
||||
| 1.4.7 | 16.8 | Upgraded to Postgres 16.8 |
|
||||
| 1.4.8 | 16.9 | Upgraded to Postgres 16.9 |
|
||||
| 1.4.9 | 16.10 | Upgraded to Postgres 16.10 |
|
||||
| 1.4.10 | 16.11 | Upgraded to Postgres 16.11 |
|
||||
| 1.4.11 | 16.13 | Upgraded to Postgres 16.13 |
|
||||
| 1.5.0 | 17.0 | Added Postgres 17.0 |
|
||||
| 1.5.1 | 17.2 | Added Postgres 17.2 |
|
||||
| 1.5.2 | 17.3 | Upgraded to Postgres 17.3 |
|
||||
| 1.5.3 | 17.4 | Upgraded to Postgres 17.4 |
|
||||
| 1.5.4 | 17.5 | Upgraded to Postgres 17.5 |
|
||||
| 1.5.5 | 17.5 | Fixed permissions for user database - thx @zaro |
|
||||
| 1.5.6 | 17.5 | Added support for loadBalancerSourceRanges |
|
||||
| 1.5.7 | 17.5 | Added optional resources section for the initContainer |
|
||||
| 1.5.8 | 17.6 | Upgraded to Postgres 17.6 |
|
||||
| 1.5.9 | 17.6 | Added priorityClassName - thx @JimCronqvist |
|
||||
| 1.5.10 | 17.6 | Made PGDATA (postgres data directory) configurable |
|
||||
| 1.5.11 | 17.6 | Fixed script for user database creation - thx @maeln0r |
|
||||
| 1.5.12 | 17.7 | Upgraded to Postgres 17.7 |
|
||||
| 1.5.13 | 17.9 | Upgraded to Postgres 17.9 |
|
||||
| 1.6.0 | 18.1 | Upgraded to Postgres 18.1 |
|
||||
| 1.6.1 | 18.1 | Added support for persistentVolumeClaimRetentionPolicy |
|
||||
| | | |
|
||||
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "postgres.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "postgres.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "postgres.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "postgres.labels" -}}
|
||||
helm.sh/chart: {{ include "postgres.chart" . }}
|
||||
{{ include "postgres.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "postgres.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "postgres.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "postgres.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "postgres.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if .Values.customConfig }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}-customconfig
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
data:
|
||||
postgresql.conf: |
|
||||
{{- .Values.customConfig | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- if .Values.customScripts }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}-customscripts
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
data:
|
||||
{{- range $name, $value := .Values.customScripts }}
|
||||
{{- $name | nindent 2 }}: |
|
||||
{{- $value | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- with .Values.networkPolicy }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" $ }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "postgres.selectorLabels" $ | nindent 6 }}
|
||||
policyTypes:
|
||||
{{- if .ingress }}
|
||||
- Ingress
|
||||
{{- end }}
|
||||
{{- if .egress }}
|
||||
- Egress
|
||||
{{- end }}
|
||||
{{- with .ingress }}
|
||||
ingress:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .egress }}
|
||||
egress:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- if .Values.useDeployment }}
|
||||
{{- $createPvc := and (empty .Values.storage.persistentVolumeClaimName) (.Values.storage.requestedSize) }}
|
||||
{{- if $createPvc }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
{{- with .Values.storage.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.storage.keepPvc .Values.storage.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.storage.keepPvc }}
|
||||
"helm.sh/resource-policy": keep
|
||||
{{- end }}
|
||||
{{- with .Values.storage.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.storage }}
|
||||
accessModes:
|
||||
{{- toYaml .accessModes | nindent 4 }}
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .requestedSize }}
|
||||
{{- if .className }}
|
||||
storageClassName: {{ .className }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,43 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}-scripts
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
data:
|
||||
01-init-userdb.sh: |
|
||||
#!/bin/sh
|
||||
create_user()
|
||||
{
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -v USERDBNAME="$POSTGRES_DB" -v USERDBUSER="$USERDB_USER" -v USERDBPASSWORD="'$USERDB_PASSWORD'" <<-EOSQL
|
||||
CREATE USER :USERDBUSER WITH PASSWORD :USERDBPASSWORD;
|
||||
GRANT ALL PRIVILEGES ON DATABASE :USERDBNAME TO :USERDBUSER;
|
||||
ALTER DATABASE :USERDBNAME OWNER TO :USERDBUSER;
|
||||
EOSQL
|
||||
}
|
||||
set -e
|
||||
if [ ! -z "$POSTGRES_DB" ] && [ ! -z "$USERDB_USER" ] && [ ! -z "$USERDB_PASSWORD" ]; then
|
||||
create_user
|
||||
fi
|
||||
init.sh: |
|
||||
#!/bin/sh
|
||||
echo "Start initialization"
|
||||
echo "Copy init-userdb script"
|
||||
cp /initscripts/01-init-userdb.sh /scripts
|
||||
if [ -d /extrascripts ]; then
|
||||
echo "Copy extra scripts"
|
||||
cp /extrascripts/* /scripts
|
||||
fi
|
||||
if [ -d /customscripts ]; then
|
||||
echo "Copy custom scripts"
|
||||
cp /customscripts/* /scripts
|
||||
fi
|
||||
if [ -d /customconfig ]; then
|
||||
echo "Create postgres config"
|
||||
cat /customconfig/* >>/configs/postgresql.conf
|
||||
fi
|
||||
if [ -d /extraconfigs ]; then
|
||||
echo "Add extra configs to postgres config"
|
||||
cat /extraconfigs/* >>/configs/postgresql.conf
|
||||
fi
|
||||
echo "Initialization done."
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- $rootSet := and (not .Values.settings.existingSecret) ((.Values.settings.superuserPassword).value) }}
|
||||
{{- $userDatabaseSet := and (.Values.userDatabase) (not .Values.userDatabase.existingSecret) }}
|
||||
{{- if or ($rootSet) ($userDatabaseSet) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- with .Values.settings }}
|
||||
{{- if (.superuser).value }}
|
||||
POSTGRES_USER: {{ .superuser.value | b64enc }}
|
||||
{{- end }}
|
||||
{{- if (.superuserPassword).value }}
|
||||
POSTGRES_PASSWORD: {{ .superuserPassword.value | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.userDatabase }}
|
||||
{{- if not .existingSecret }}
|
||||
{{- $_ := required "Values: userDatabase.name is mandatory if userDatabase is specified without existing secret" .name }}
|
||||
POSTGRES_DB: {{ required "Values: userDatabase.name.value is mandatory if userDatabase is specified without existingSecret." .name.value | b64enc }}
|
||||
{{- if (.user).value}}
|
||||
USERDB_USER: {{ .user.value | b64enc }}
|
||||
{{- $_ := required "Values: userDatabase.password is mandatory if userDatabase is specified without existing secret" .password }}
|
||||
USERDB_PASSWORD: {{ required "Values: userDatabase.password.value is mandatory if userDatabase.user is specified without existingSecret." .password.value | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "postgres.fullname" . }}
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
{{- with .Values.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: postgres
|
||||
protocol: TCP
|
||||
name: postgres
|
||||
{{- if and ( or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") ) (.Values.service.nodePort) }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.loadBalancerIP) }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.loadBalancerSourceRanges) }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.clusterIP }}
|
||||
clusterIP: {{ .Values.service.clusterIP }}
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "postgres.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "postgres.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,379 @@
|
||||
{{- $usedeployment := .Values.useDeployment }}
|
||||
{{- $fullname := include "postgres.fullname" . }}
|
||||
apiVersion: apps/v1
|
||||
{{- if $usedeployment }}
|
||||
kind: Deployment
|
||||
{{- else }}
|
||||
kind: StatefulSet
|
||||
{{- end }}
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
labels:
|
||||
{{- include "postgres.labels" . | nindent 4 }}
|
||||
{{- with .Values.customLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.customAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
{{- if .Values.revisionHistoryLimit }}
|
||||
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
|
||||
{{- end }}
|
||||
{{- if not $usedeployment }}
|
||||
serviceName: {{ $fullname }}
|
||||
podManagementPolicy: {{ .Values.podManagementPolicy }}
|
||||
updateStrategy:
|
||||
type: {{ .Values.updateStrategyType }}
|
||||
{{- if or .Values.storage.persistentVolumeClaimRetentionPolicy.whenDeleted .Values.storage.persistentVolumeClaimRetentionPolicy.whenScaled }}
|
||||
persistentVolumeClaimRetentionPolicy:
|
||||
{{- with .Values.storage.persistentVolumeClaimRetentionPolicy.whenDeleted }}
|
||||
whenDeleted: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.storage.persistentVolumeClaimRetentionPolicy.whenScaled }}
|
||||
whenScaled: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
strategy:
|
||||
type: Recreate
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "postgres.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/customconfig: {{ include (print $.Template.BasePath "/customconfig.yaml") . | sha256sum }}
|
||||
checksum/secureconfig: {{ include (print $.Template.BasePath "/secureconfig.yaml") . | sha256sum }}
|
||||
checksum/customscripts: {{ include (print $.Template.BasePath "/customscripts.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts.yaml") . | sha256sum }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "postgres.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "postgres.serviceAccountName" . }}
|
||||
{{- with .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: {{ .Chart.Name }}-init
|
||||
{{- with .Values.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
volumeMounts:
|
||||
{{- if .Values.extraScripts }}
|
||||
- mountPath: /extrascripts
|
||||
name: extrascripts-volume
|
||||
{{- end }}
|
||||
{{- if .Values.customScripts }}
|
||||
- mountPath: /customscripts
|
||||
name: customscripts-volume
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecretConfigs }}
|
||||
- mountPath: /extraconfigs
|
||||
name: extraconfigs-volume
|
||||
{{- end }}
|
||||
{{- if .Values.customConfig }}
|
||||
- mountPath: /customconfig
|
||||
name: customconfig-volume
|
||||
{{- end }}
|
||||
- mountPath: /initscripts
|
||||
name: initscripts
|
||||
- mountPath: /scripts
|
||||
name: scripts
|
||||
- mountPath: /configs
|
||||
name: configs
|
||||
command: [ "/initscripts/init.sh" ]
|
||||
{{- with .Values.initResources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraInitContainers }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
{{- with .Values.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: postgres
|
||||
containerPort: 5432
|
||||
protocol: TCP
|
||||
env:
|
||||
{{- if or (and (.Values.settings.existingSecret) ((.Values.settings.superuser).secretKey)) ((.Values.settings.superuser).value) }}
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default (include "postgres.fullname" .) .Values.settings.existingSecret }}
|
||||
key: {{ default "POSTGRES_USER" (.Values.settings.superuser).secretKey }}
|
||||
{{- end }}
|
||||
{{- if or (.Values.settings.existingSecret) ((.Values.settings.superuserPassword).value) }}
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default (include "postgres.fullname" .) .Values.settings.existingSecret }}
|
||||
key: {{ default "POSTGRES_PASSWORD" (.Values.settings.superuserPassword).secretKey }}
|
||||
{{- end }}
|
||||
{{- with .Values.userDatabase }}
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default (include "postgres.fullname" $) .existingSecret }}
|
||||
key: {{ default "POSTGRES_DB" .name.secretKey }}
|
||||
- name: USERDB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default (include "postgres.fullname" $) .existingSecret }}
|
||||
key: {{ default "USERDB_USER" .user.secretKey }}
|
||||
- name: USERDB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default (include "postgres.fullname" $) .existingSecret }}
|
||||
key: {{ default "USERDB_PASSWORD" .password.secretKey }}
|
||||
{{- end }}
|
||||
- name: PGDATA
|
||||
value: {{ printf "%s/%s" .Values.settings.dataDir .Values.settings.pgDir | quote }}
|
||||
{{- if .Values.settings.authMethod }}
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: {{ .Values.settings.authMethod | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.settings.initDbArgs }}
|
||||
- name: POSTGRES_INITDB_ARGS
|
||||
value: {{ .Values.settings.initDbArgs | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.env }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- range .Values.extraEnvSecrets }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.customStartupProbe }}
|
||||
startupProbe:
|
||||
{{- toYaml .Values.customStartupProbe | nindent 12 }}
|
||||
{{- else }}
|
||||
{{- if .Values.startupProbe.enabled }}
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- pg_isready -h localhost
|
||||
{{- with .Values.startupProbe }}
|
||||
initialDelaySeconds: {{ .initialDelaySeconds }}
|
||||
timeoutSeconds: {{ .timeoutSeconds }}
|
||||
failureThreshold: {{ .failureThreshold }}
|
||||
successThreshold: {{ .successThreshold }}
|
||||
periodSeconds: {{ .periodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.customLivenessProbe }}
|
||||
livenessProbe:
|
||||
{{- toYaml .Values.customLivenessProbe | nindent 12 }}
|
||||
{{- else }}
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- pg_isready -h localhost
|
||||
{{- with .Values.livenessProbe }}
|
||||
initialDelaySeconds: {{ .initialDelaySeconds }}
|
||||
timeoutSeconds: {{ .timeoutSeconds }}
|
||||
failureThreshold: {{ .failureThreshold }}
|
||||
successThreshold: {{ .successThreshold }}
|
||||
periodSeconds: {{ .periodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.customReadinessProbe }}
|
||||
readinessProbe:
|
||||
{{- toYaml .Values.customReadinessProbe | nindent 12 }}
|
||||
{{- else }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- pg_isready -h localhost
|
||||
{{- with .Values.readinessProbe }}
|
||||
initialDelaySeconds: {{ .initialDelaySeconds }}
|
||||
timeoutSeconds: {{ .timeoutSeconds }}
|
||||
failureThreshold: {{ .failureThreshold }}
|
||||
successThreshold: {{ .successThreshold }}
|
||||
periodSeconds: {{ .periodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.args }}
|
||||
args:
|
||||
{{- range .Values.args }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- mountPath: /var/run
|
||||
name: run
|
||||
- mountPath: /tmp
|
||||
name: tmp
|
||||
- mountPath: {{ .Values.settings.dataDir }}
|
||||
name: {{ .Values.storage.volumeName }}
|
||||
- mountPath: /docker-entrypoint-initdb.d
|
||||
name: scripts
|
||||
- mountPath: /etc/postgresql
|
||||
name: configs
|
||||
{{- range $secret := .Values.extraSecrets }}
|
||||
- name: {{ $secret.name }}
|
||||
mountPath: {{ $secret.mountPath }}
|
||||
{{- end }}
|
||||
{{- range $config := .Values.extraConfigs }}
|
||||
- name: {{ $config.name }}
|
||||
mountPath: {{ $config.mountPath }}
|
||||
{{- end }}
|
||||
{{- range $storage := .Values.extraStorage }}
|
||||
- name: {{ $storage.name }}
|
||||
mountPath: {{ $storage.mountPath }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraContainers }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: run
|
||||
emptyDir: {}
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
- name: scripts
|
||||
emptyDir: {}
|
||||
- name: configs
|
||||
emptyDir: {}
|
||||
- name: initscripts
|
||||
configMap:
|
||||
name: {{ $fullname }}-scripts
|
||||
defaultMode: 0555
|
||||
{{- if .Values.extraScripts }}
|
||||
- name: extrascripts-volume
|
||||
configMap:
|
||||
name: {{ .Values.extraScripts }}
|
||||
defaultMode: 0555
|
||||
{{- end }}
|
||||
{{- if .Values.customScripts }}
|
||||
- name: customscripts-volume
|
||||
configMap:
|
||||
name: {{ $fullname }}-customscripts
|
||||
defaultMode: 0555
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecretConfigs }}
|
||||
- name: extraconfigs-volume
|
||||
secret:
|
||||
secretName: {{ .Values.extraSecretConfigs }}
|
||||
{{- end }}
|
||||
{{- if .Values.customConfig }}
|
||||
- name: customconfig-volume
|
||||
configMap:
|
||||
name: {{ $fullname }}-customconfig
|
||||
{{- end }}
|
||||
{{- range $secret := .Values.extraSecrets }}
|
||||
- name: {{ $secret.name }}
|
||||
secret:
|
||||
secretName: {{ $secret.name }}
|
||||
defaultMode: {{ $secret.defaultMode | default 0440 }}
|
||||
{{- end }}
|
||||
{{- range $config := .Values.extraConfigs }}
|
||||
- name: {{ $config.name }}
|
||||
configMap:
|
||||
name: {{ $config.name }}
|
||||
defaultMode: {{ $config.defaultMode | default 0440 }}
|
||||
{{- end }}
|
||||
{{- range $storage := .Values.extraStorage }}
|
||||
- name: {{ $storage.name }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $storage.pvcName }}
|
||||
{{- end }}
|
||||
{{- with .Values.storage }}
|
||||
{{- $createPvc := and (empty .persistentVolumeClaimName) .requestedSize }}
|
||||
{{- if not $createPvc }}
|
||||
- name: {{ .volumeName }}
|
||||
{{- if .persistentVolumeClaimName }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .persistentVolumeClaimName }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if $usedeployment }}
|
||||
- name: {{ .volumeName }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $fullname }}
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: {{ .volumeName }}
|
||||
{{- with .labels }}
|
||||
labels:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .accessModes }}
|
||||
accessModes:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .className }}
|
||||
storageClassName: {{ .className }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .requestedSize }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,307 @@
|
||||
## Default values for PostgreSQL deployment
|
||||
|
||||
## PostgreSQL docker image
|
||||
image:
|
||||
registry: "docker.io"
|
||||
repository: "postgres"
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
## Pull secrets and name override options
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
## Additional labels for Deployment or StatefulSet
|
||||
customLabels: {}
|
||||
|
||||
## Additional annotations for Deployment or StatefulSet
|
||||
customAnnotations: {}
|
||||
|
||||
## Optional service account
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
## Additional pod annotations
|
||||
podAnnotations: {}
|
||||
|
||||
## Additional pod labels
|
||||
podLabels: {}
|
||||
|
||||
## Pod management policy
|
||||
podManagementPolicy: OrderedReady
|
||||
|
||||
## Pod update strategy
|
||||
updateStrategyType: RollingUpdate
|
||||
|
||||
## Pod security context uses file system group 999 (postgres)
|
||||
podSecurityContext:
|
||||
fsGroup: 999
|
||||
supplementalGroups:
|
||||
- 999
|
||||
|
||||
## Default security options to run PostgreSQL as non-root (postgres user), read only container without privilege escalation
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
privileged: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsGroup: 999
|
||||
runAsUser: 999
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
|
||||
## The postgres service configuration (Default is ClusterIP with port 5432)
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 5432
|
||||
## The node port (only relevant for type LoadBalancer or NodePort)
|
||||
nodePort:
|
||||
## The cluster ip address (only relevant for type LoadBalancer or NodePort)
|
||||
clusterIP:
|
||||
## The loadbalancer ip address (only relevant for type LoadBalancer)
|
||||
loadBalancerIP:
|
||||
## The list of IP CIDR ranges that are allowed to access the load balancer (only relevent for type LoadBalancer)
|
||||
loadBalancerSourceRanges: []
|
||||
## Annotations to add to the service
|
||||
annotations: {}
|
||||
## Labels to add to the service
|
||||
labels: {}
|
||||
|
||||
|
||||
resources: {}
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Pod priority class name
|
||||
priorityClassName: ""
|
||||
|
||||
## Additional node selector
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
tolerations: []
|
||||
|
||||
## Affinity for pod assignment
|
||||
affinity: {}
|
||||
|
||||
## Topology spread constraints for pods
|
||||
topologySpreadConstraints: {}
|
||||
|
||||
## Maximum number of revisions maintained in revision history
|
||||
revisionHistoryLimit:
|
||||
|
||||
## Custom startup probe (overwrites default startup probe)
|
||||
customStartupProbe: {}
|
||||
|
||||
## Default startup check
|
||||
startupProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 30
|
||||
successThreshold: 1
|
||||
periodSeconds: 10
|
||||
|
||||
## Custom liveness probe (overwrites default liveness probe)
|
||||
customLivenessProbe: {}
|
||||
|
||||
## Default health check
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
successThreshold: 1
|
||||
periodSeconds: 10
|
||||
|
||||
## Custom readiness probe (overwrites default readiness probe)
|
||||
customReadinessProbe: {}
|
||||
|
||||
## Default readiness probe
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
successThreshold: 1
|
||||
periodSeconds: 10
|
||||
|
||||
## Extra init containers
|
||||
extraInitContainers: []
|
||||
|
||||
## Extra containers for usage as sidecars
|
||||
extraContainers: []
|
||||
|
||||
## Resources of the default init container
|
||||
initResources: {}
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Additional environment variables
|
||||
env: []
|
||||
|
||||
## Arguments for the container entrypoint process
|
||||
args: []
|
||||
|
||||
## Use Kubernetes Deployment instead of StatefulSet
|
||||
useDeployment: false
|
||||
|
||||
## Database configuration
|
||||
settings:
|
||||
## Optional existing secret for the Postgrest superuser
|
||||
existingSecret:
|
||||
|
||||
## The default postgres superuser (default when nothing is set: "postgres")
|
||||
superuser:
|
||||
# secretKey:
|
||||
# value:
|
||||
|
||||
## The superuser password
|
||||
superuserPassword:
|
||||
# secretKey:
|
||||
# value:
|
||||
|
||||
## Postgres database authentication method
|
||||
## For example: "md5"
|
||||
authMethod:
|
||||
|
||||
## Optional init database arguments
|
||||
## For example: "--auth-local=md5"
|
||||
initDbArgs:
|
||||
|
||||
## Default data directory mountpoint
|
||||
dataDir: "/var/lib/postgresql/data"
|
||||
|
||||
## Name of the postgres directory inside data directory
|
||||
## This is necessary because of the default behavior of the docker-entrypoint.sh in the container image
|
||||
## The default entrypoint always tries to create a directory and set permissions on it. Thats is the reason why data directory mountpoint and directory inside must two different configuration options
|
||||
## PGDATA will be dataDir+pgDir => "/var/lib/postgresql/data/pg" while volume mount point will be dataDir => "/var/lib/postgresql/data"
|
||||
pgDir: "pg"
|
||||
|
||||
## Optional user database which is created during first startup with user and password
|
||||
userDatabase: {}
|
||||
## Optional existing secret with database name, user and password
|
||||
# existingSecret:
|
||||
## Name of the user database
|
||||
# name:
|
||||
## Use secretKey when existingSecret was specified otherwise value
|
||||
# secretKey:
|
||||
# value:
|
||||
## Database user with full access rights
|
||||
## Use secretKey when existingSecret was specified otherwise value
|
||||
# user:
|
||||
# secretKey:
|
||||
# value:
|
||||
## Password of the database user
|
||||
## Use secretKey when existingSecret was specified otherwise value
|
||||
# password:
|
||||
# secretKey:
|
||||
# value:
|
||||
|
||||
## Optional custom configuration block that will be mounted as file in /etc/postgresql/postgresql.conf
|
||||
## For more flexible options see extraSecretConfigs: section
|
||||
customConfig: |
|
||||
|
||||
## Optional custom scripts that can be defined inline and will be mounted as files in /docker-entrypoint-initdb.d
|
||||
customScripts: {}
|
||||
# 01-a-script.sh: |
|
||||
# echo "hello"
|
||||
# 02-another-script.sh: |
|
||||
# echo "hello 2"
|
||||
|
||||
## A list of existing secrets that will be mounted into the container as environment variables
|
||||
## As an alternative these secrets can set the database superuser password or other options when settings.superuserPassword was not specified
|
||||
## For example: Setting POSTGRES_DB, USERDB_USER, USERDB_PASSWORD will allow creating a user database and grant access for the given user
|
||||
extraEnvSecrets: []
|
||||
|
||||
## An existing secret with files that will be added to the postgres configuration in addition to /etc/postgresql/postgresql.conf
|
||||
extraSecretConfigs:
|
||||
|
||||
## An existing configMap with files that will be mounted into the container as script files (*.sql, *.sh) in /docker-entrypoint-initdb.d
|
||||
## For more details see https://hub.docker.com/_/postgres
|
||||
extraScripts:
|
||||
|
||||
## A list of additional existing secrets that will be mounted into the container
|
||||
## The mounted files of the secrets can be used for advanced configuration - f.e. TLS
|
||||
extraSecrets: []
|
||||
## Name of the existing K8s secret
|
||||
# - name:
|
||||
## Mount default mode (0440 if parameter is omitted)
|
||||
# defaultMode: 0440
|
||||
## Mount path where the secret should be mounted into the container (f.e. /mysecretfolder)
|
||||
# mountPath:
|
||||
|
||||
## A list of additional existing configMaps that will be mounted into the container
|
||||
extraConfigs: []
|
||||
## Name of the existing K8s configMap
|
||||
# - name:
|
||||
## Mount default mode (0440 if parameter is omitted)
|
||||
# defaultMode: 0440
|
||||
## Mount path where the configMap should be mounted into the container (f.e. /mysecretfolder)
|
||||
# mountPath:
|
||||
|
||||
## Storage parameters
|
||||
storage:
|
||||
## Set persistentVolumenClaimName to reference an existing PVC
|
||||
persistentVolumeClaimName:
|
||||
|
||||
## Internal volume name and prefix of a created PVC
|
||||
volumeName: "postgres-data"
|
||||
|
||||
## Alternative set requestedSize to define a size for a dynmaically created PVC
|
||||
requestedSize:
|
||||
|
||||
## the storage class name
|
||||
className:
|
||||
|
||||
## Default access mode (ReadWriteOnce)
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
|
||||
## Keep a created Persistent volume claim when uninstalling the helm chart (only for option useDeployment: true)
|
||||
keepPvc: false
|
||||
|
||||
## Persistent volume claim retention policy for the StatefulSet (only applies when useDeployment: false)
|
||||
persistentVolumeClaimRetentionPolicy:
|
||||
## Policy for PVCs when the StatefulSet is deleted (Retain or Delete)
|
||||
whenDeleted:
|
||||
## Policy for PVCs when the StatefulSet is scaled down (Retain or Delete)
|
||||
whenScaled:
|
||||
|
||||
## Additional storage annotations
|
||||
annotations: {}
|
||||
|
||||
## Additional storage labels
|
||||
labels: {}
|
||||
|
||||
## Mount existing extra PVC
|
||||
extraStorage: {}
|
||||
## Internal volume name
|
||||
# - name:
|
||||
## Container mount path
|
||||
# mountPath:
|
||||
## Name of existing PVC
|
||||
# pvcName:
|
||||
|
||||
## Network policies
|
||||
networkPolicy: {}
|
||||
## Ingress and Egress policies
|
||||
# ingress: {}
|
||||
# egress: {}
|
||||
Reference in New Issue
Block a user