feat(kubernetes): add barman object store configuration and update cluster affinity settings
这个提交包含在:
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: barmancloud.cnpg.io/v1
|
||||||
|
kind: ObjectStore
|
||||||
|
metadata:
|
||||||
|
name: devcm-hw
|
||||||
|
namespace: infra-data
|
||||||
|
spec:
|
||||||
|
retentionPolicy: "7d"
|
||||||
|
configuration:
|
||||||
|
destinationPath: s3://devcm/cnpg/
|
||||||
|
endpointURL: https://obs.cn-east-3.myhuaweicloud.com
|
||||||
|
s3Credentials:
|
||||||
|
accessKeyId:
|
||||||
|
name: s3-devcm-hw
|
||||||
|
key: ACCESS_KEY_ID
|
||||||
|
secretAccessKey:
|
||||||
|
name: s3-devcm-hw
|
||||||
|
key: ACCESS_SECRET_KEY
|
||||||
|
wal:
|
||||||
|
compression: gzip
|
||||||
@@ -6,14 +6,21 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
nodeAffinity:
|
nodeAffinity:
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
- preference:
|
nodeSelectorTerms:
|
||||||
matchExpressions:
|
- matchExpressions:
|
||||||
- key: topology.kubernetes.io/region
|
- key: topology.kubernetes.io/region
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- cn-hk
|
- "cn-hk"
|
||||||
weight: 1
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 1
|
||||||
|
preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- clawhk
|
||||||
instances: 1
|
instances: 1
|
||||||
imageName: ghcr.io/cloudnative-pg/postgresql:17.4
|
imageName: ghcr.io/cloudnative-pg/postgresql:17.4
|
||||||
enableSuperuserAccess: true
|
enableSuperuserAccess: true
|
||||||
@@ -22,30 +29,3 @@ spec:
|
|||||||
postgresql:
|
postgresql:
|
||||||
parameters:
|
parameters:
|
||||||
archive_timeout: 30min
|
archive_timeout: 30min
|
||||||
backup:
|
|
||||||
retentionPolicy: "7d"
|
|
||||||
barmanObjectStore:
|
|
||||||
destinationPath: s3://devcm/cnpg/
|
|
||||||
endpointURL: https://obs.cn-east-3.myhuaweicloud.com
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: s3-devcm-hw
|
|
||||||
key: ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: s3-devcm-hw
|
|
||||||
key: ACCESS_SECRET_KEY
|
|
||||||
wal:
|
|
||||||
compression: gzip
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg17-cluster-hk-backups
|
|
||||||
namespace: infra-data
|
|
||||||
spec:
|
|
||||||
schedule: "0 0 0 * * *"
|
|
||||||
immediate: true
|
|
||||||
backupOwnerReference: self
|
|
||||||
cluster:
|
|
||||||
name: cnpg17-cluster-hk
|
|
||||||
|
|||||||
@@ -6,14 +6,21 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
nodeAffinity:
|
nodeAffinity:
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
- preference:
|
nodeSelectorTerms:
|
||||||
matchExpressions:
|
- matchExpressions:
|
||||||
- key: topology.kubernetes.io/region
|
- key: topology.kubernetes.io/region
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- cn-sh
|
- "cn-sh"
|
||||||
weight: 1
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 1
|
||||||
|
preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- homea
|
||||||
instances: 1
|
instances: 1
|
||||||
imageName: ghcr.io/cloudnative-pg/postgresql:17.4
|
imageName: ghcr.io/cloudnative-pg/postgresql:17.4
|
||||||
enableSuperuserAccess: true
|
enableSuperuserAccess: true
|
||||||
@@ -21,31 +28,4 @@ spec:
|
|||||||
size: 10Gi
|
size: 10Gi
|
||||||
postgresql:
|
postgresql:
|
||||||
parameters:
|
parameters:
|
||||||
archive_timeout: 30min
|
archive_timeout: 30min
|
||||||
backup:
|
|
||||||
retentionPolicy: "7d"
|
|
||||||
barmanObjectStore:
|
|
||||||
destinationPath: s3://devcm/cnpg/
|
|
||||||
endpointURL: https://obs.cn-east-3.myhuaweicloud.com
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: s3-devcm-hw
|
|
||||||
key: ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: s3-devcm-hw
|
|
||||||
key: ACCESS_SECRET_KEY
|
|
||||||
wal:
|
|
||||||
compression: gzip
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg17-cluster-sh-backups
|
|
||||||
namespace: infra-data
|
|
||||||
spec:
|
|
||||||
schedule: "0 0 0 * * *"
|
|
||||||
immediate: true
|
|
||||||
backupOwnerReference: self
|
|
||||||
cluster:
|
|
||||||
name: cnpg17-cluster-sh
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: helm.cattle.io/v1
|
||||||
|
kind: HelmChart
|
||||||
|
metadata:
|
||||||
|
name: cloudnative-pg-plugin-barman
|
||||||
|
namespace: infra-data
|
||||||
|
spec:
|
||||||
|
repo: https://cloudnative-pg.github.io/charts
|
||||||
|
chart: plugin-barman-cloud
|
||||||
|
targetNamespace: infra-data
|
||||||
|
version: 0.5.0
|
||||||
|
valuesContent: |-
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: topology.kubernetes.io/region
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- "cn-sh"
|
||||||
|
tolerations:
|
||||||
|
- key: "node-role.kubernetes.io/control-plane"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ spec:
|
|||||||
repo: https://cloudnative-pg.github.io/charts
|
repo: https://cloudnative-pg.github.io/charts
|
||||||
chart: cloudnative-pg
|
chart: cloudnative-pg
|
||||||
targetNamespace: infra-data
|
targetNamespace: infra-data
|
||||||
version: 0.25.0
|
version: 0.27.1
|
||||||
valuesContent: |-
|
valuesContent: |-
|
||||||
affinity:
|
affinity:
|
||||||
nodeAffinity:
|
nodeAffinity:
|
||||||
@@ -22,6 +22,4 @@ spec:
|
|||||||
- key: "node-role.kubernetes.io/control-plane"
|
- key: "node-role.kubernetes.io/control-plane"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoSchedule"
|
effect: "NoSchedule"
|
||||||
image:
|
|
||||||
tag: "1.25.3"
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ spec:
|
|||||||
role: primary
|
role: primary
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 65432
|
port: 65431
|
||||||
targetPort: 5432
|
targetPort: 5432
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
|
|||||||
在新议题中引用
屏蔽一个用户