add database management
This commit is contained in:
76
charts/postgres-cluster/templates/databases.yaml
Normal file
76
charts/postgres-cluster/templates/databases.yaml
Normal file
@@ -0,0 +1,76 @@
|
||||
{{- range .Values.databases }}
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Database
|
||||
metadata:
|
||||
name: {{ include "cluster.name" $ }}-database-{{ .name | replace "_" "-" }}
|
||||
namespace: {{ include "cluster.namespace" $ }}
|
||||
labels:
|
||||
{{- include "cluster.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
name: {{ .name }}
|
||||
cluster:
|
||||
name: {{ include "cluster.name" $ }}
|
||||
ensure: {{ .ensure | default "present" }}
|
||||
owner: {{ .owner }}
|
||||
template: {{ .template | default "template1" }}
|
||||
encoding: {{ .encoding | default "UTF8" }}
|
||||
databaseReclaimPolicy: {{ .databaseReclaimPolicy | default "retain" }}
|
||||
{{- with .isTemplate }}
|
||||
isTemplate: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .allowConnections }}
|
||||
allowConnections: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .connectionLimit }}
|
||||
connectionLimit: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .tablespace }}
|
||||
tablespace: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .locale }}
|
||||
locale: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .localeProvider }}
|
||||
localeProvider: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .localeCollate }}
|
||||
localeCollate: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .localeCType }}
|
||||
localeCType: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .icuLocale }}
|
||||
icuLocale: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .icuRules }}
|
||||
icuRules: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .builtinLocale }}
|
||||
builtinLocale: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .collationVersion }}
|
||||
collationVersion: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .schemas }}
|
||||
schemas:
|
||||
{{- range . }}
|
||||
- name: {{ .name }}
|
||||
owner: {{ .owner }}
|
||||
ensure: {{ .ensure | default "present" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .extensions }}
|
||||
extensions:
|
||||
{{- range . }}
|
||||
- name: {{ .name }}
|
||||
{{- with .version }}
|
||||
version: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .schema }}
|
||||
schema: {{ . }}
|
||||
{{- end }}
|
||||
ensure: {{ .ensure | default "present" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -3,7 +3,7 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Pooler
|
||||
metadata:
|
||||
name: {{ include "cluster.name" $ }}-pooler-{{ .name }}
|
||||
name: {{ include "cluster.name" $ }}-pooler-{{ .name }}
|
||||
namespace: {{ include "cluster.namespace" $ }}
|
||||
labels:
|
||||
{{- include "cluster.labels" $ | nindent 4 }}
|
||||
|
||||
Reference in New Issue
Block a user