Separation db-cluster and app
This commit is contained in:
23
cnpg-liquid/.helmignore
Normal file
23
cnpg-liquid/.helmignore
Normal file
@@ -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/
|
||||
24
cnpg-liquid/Chart.yaml
Normal file
24
cnpg-liquid/Chart.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: v2
|
||||
name: cnpg-liquid
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.16.0"
|
||||
60
cnpg-liquid/templates/cnpg-cluster.yaml
Normal file
60
cnpg-liquid/templates/cnpg-cluster.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: {{ required "Cluster name required" .Values.cnpg.clusterName }}
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install
|
||||
"helm.sh/hook-weight": "-1"
|
||||
spec:
|
||||
startDelay: 300
|
||||
stopDelay: 300
|
||||
instances: 3
|
||||
storage:
|
||||
size: 2Gi
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
|
||||
{{ if .Values.cnpg.recovery.enable }}
|
||||
externalClusters:
|
||||
- name: {{ required "Old cluster name required" .Values.cnpg.recovery.oldClusterName }}
|
||||
barmanObjectStore:
|
||||
destinationPath: {{ .Values.cnpg.recovery.oldClusterName }}
|
||||
endpointURL: {{ .Values.s3.endpointUrl | quote }}
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: {{ .Values.s3.secretName | quote}}
|
||||
key: {{ .Values.s3.accessKeyKey | quote }}
|
||||
secretAccessKey:
|
||||
name: {{ .Values.s3.secretName | quote}}
|
||||
key: {{ .Values.s3.secretKeyKey | quote }}
|
||||
wal:
|
||||
maxParallel: 8
|
||||
|
||||
|
||||
{{ end }}
|
||||
|
||||
bootstrap:
|
||||
{{ if .Values.cnpg.recovery.enable }}
|
||||
recovery:
|
||||
source: {{ required "Old cluster name required" .Values.cnpg.recovery.oldClusterName }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Values.cnpg.backup.enable }}
|
||||
backup:
|
||||
barmanObjectStore:
|
||||
destinationPath: {{ .Values.cnpg.backup.destinationPath }}
|
||||
endpointURL: {{ .Values.s3.endpointUrl | quote }}
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: {{ .Values.s3.secretName | quote}}
|
||||
key: {{ .Values.s3.accessKeyKey | quote }}
|
||||
secretAccessKey:
|
||||
name: {{ .Values.s3.secretName | quote}}
|
||||
key: {{ .Values.s3.secretKeyKey | quote }}
|
||||
wal:
|
||||
compression: bzip2
|
||||
maxParallel: 8
|
||||
data:
|
||||
compression: bzip2
|
||||
retentionPolicy: "7d"
|
||||
{{ end }}
|
||||
14
cnpg-liquid/values.yaml
Normal file
14
cnpg-liquid/values.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
s3:
|
||||
endpointUrl: https://storage.yandexcloud.net
|
||||
secretName: s3-credentials
|
||||
accessKeyKey: ACCESS_KEY_ID
|
||||
secretKeyKey: ACCESS_SECRET_KEY
|
||||
cnpg:
|
||||
clusterName: liquid-db
|
||||
backup:
|
||||
enable: true
|
||||
destinationPath: "s3://liquid-code/backup"
|
||||
recovery:
|
||||
enable: false
|
||||
oldClusterName: liquid-db
|
||||
sourcePath: "s3://liquid-code/backup"
|
||||
Reference in New Issue
Block a user