From 699ec54a8c11e5192fe7ccf0ababc355f4cd2aad Mon Sep 17 00:00:00 2001 From: rohow Date: Mon, 4 Nov 2024 18:59:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(velero):=20=E6=96=B0=E5=A2=9Evelero?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=9B=86=E7=BE=A4=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/apps/halo/helmchart.yaml | 29 ++++++---- apps/infra/data/cloudnative-pg/helmchart.yaml | 4 +- .../devops/cert-manager/helmchart-dnspod.yaml | 4 +- apps/infra/devops/cert-manager/helmchart.yaml | 12 ++-- apps/infra/devops/gitea/helmchart.yaml | 2 + apps/infra/devops/reflector/helmchart.yaml | 4 +- apps/infra/devops/velero/helmchart.yaml | 57 +++++++++++++++++++ 7 files changed, 88 insertions(+), 24 deletions(-) create mode 100644 apps/infra/devops/velero/helmchart.yaml diff --git a/apps/apps/halo/helmchart.yaml b/apps/apps/halo/helmchart.yaml index 847572c..7cde6a3 100644 --- a/apps/apps/halo/helmchart.yaml +++ b/apps/apps/halo/helmchart.yaml @@ -31,18 +31,7 @@ spec: - greenhk image: repository: halohub/halo-pro - tag: 2.20.8 - mysql: - enabled: false - postgresql: - enabled: false - externalDatabase: - platform: postgresql - host: cnpg-cluster-hk-rw.infra-data - port: 5432 - user: app - password: nyrHzh9WWlDZzvVw7bDFo74gKb9zsls0Sy7OwRTDWiRTNPQQQkW85taUFAoX2AIC - database: halo + tag: 2.20.9 service: type: ClusterIP ingress: @@ -59,7 +48,23 @@ spec: hostname: dev.cm path: / pathType: Prefix + podAnnotations: + backup.velero.io/backup-volumes: halo-data + metrics: + enabled: true + mysql: + enabled: false + postgresql: + enabled: false + externalDatabase: + platform: postgresql + host: cnpg-cluster-hk-rw.infra-data + port: 5432 + user: app + password: nyrHzh9WWlDZzvVw7bDFo74gKb9zsls0Sy7OwRTDWiRTNPQQQkW85taUFAoX2AIC + database: halo haloUsername: rohow haloExternalUrl: https://dev.cm + diff --git a/apps/infra/data/cloudnative-pg/helmchart.yaml b/apps/infra/data/cloudnative-pg/helmchart.yaml index 3c4c331..76a6622 100644 --- a/apps/infra/data/cloudnative-pg/helmchart.yaml +++ b/apps/infra/data/cloudnative-pg/helmchart.yaml @@ -14,10 +14,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" diff --git a/apps/infra/devops/cert-manager/helmchart-dnspod.yaml b/apps/infra/devops/cert-manager/helmchart-dnspod.yaml index 42a0052..736a3a4 100644 --- a/apps/infra/devops/cert-manager/helmchart-dnspod.yaml +++ b/apps/infra/devops/cert-manager/helmchart-dnspod.yaml @@ -25,10 +25,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" diff --git a/apps/infra/devops/cert-manager/helmchart.yaml b/apps/infra/devops/cert-manager/helmchart.yaml index 89f54c0..6d792a4 100644 --- a/apps/infra/devops/cert-manager/helmchart.yaml +++ b/apps/infra/devops/cert-manager/helmchart.yaml @@ -16,10 +16,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" @@ -36,10 +36,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" @@ -50,10 +50,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" diff --git a/apps/infra/devops/gitea/helmchart.yaml b/apps/infra/devops/gitea/helmchart.yaml index 8fc6469..c40e376 100644 --- a/apps/infra/devops/gitea/helmchart.yaml +++ b/apps/infra/devops/gitea/helmchart.yaml @@ -48,6 +48,8 @@ spec: - path: / pathType: Prefix gitea: + podAnnotations: + backup.velero.io/backup-volumes: data config: APP_NAME: Git.dev.cm RUN_MODE: prod diff --git a/apps/infra/devops/reflector/helmchart.yaml b/apps/infra/devops/reflector/helmchart.yaml index dc9fb19..09e8e52 100644 --- a/apps/infra/devops/reflector/helmchart.yaml +++ b/apps/infra/devops/reflector/helmchart.yaml @@ -14,10 +14,10 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: node-role.kubernetes.io/master + - key: topology.kubernetes.io/region operator: In values: - - "true" + - "cn-sh" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" diff --git a/apps/infra/devops/velero/helmchart.yaml b/apps/infra/devops/velero/helmchart.yaml new file mode 100644 index 0000000..e0d1ebf --- /dev/null +++ b/apps/infra/devops/velero/helmchart.yaml @@ -0,0 +1,57 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChart +metadata: + name: velero + namespace: infra-devops +spec: + repo: https://vmware-tanzu.github.io/helm-charts + chart: velero + targetNamespace: infra-devops + version: 8.0.0 + valuesContent: |- + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: topology.kubernetes.io/region + operator: In + values: + - "cn-sh" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + snapshotsEnabled: false + deployNodeAgent: true + defaultRepoMaintainFrequency: 3h + repositoryMaintenanceJob: + latestJobsCount: 1 + configuration: + backupStorageLocation: + - name: default + provider: aws + bucket: devcm + prefix: velero + config: + region: cn-east-3 + s3ForcePathStyle: true + s3Url: https://obs.cn-east-3.myhuaweicloud.com + checksumAlgorithm: "" + credentials: + useSecret: true + secretContents: + cloud: | + [default] + aws_access_key_id = A9RI5BC15F3L9EI8T51T + aws_secret_access_key = ky1n3OlNNu7wjgctVjCqb03HWxjZucRGhvcEBp51 + initContainers: + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.11.0 + volumeMounts: + - mountPath: /target + name: plugins + nodeAgent: + nodeSelector: + backup.velero.io/enable: "true" +