feat: add support for additional S3 providers

- Introduce S3_PROVIDER variable in cm-script.yaml
- Update s3cmd configuration to include provider
- Modify daemonset.yaml to support tencent-gz1 and tencent-sh1 in node affinity

These changes allow the backup system to utilize multiple S3 providers, enhancing its compatibility and deployment options across different cloud environments.
This commit is contained in:
songtianlun 2025-04-26 11:12:50 +08:00
parent 701bdfa398
commit aef5c35ab8
2 changed files with 17 additions and 11 deletions

View File

@ -13,6 +13,7 @@ data:
S3_ACCESS_KEY="${S3_ACCESS_KEY}"
S3_SECRET_KEY="${S3_SECRET_KEY}"
S3_BUCKET="${S3_BUCKET}"
S3_PROVIDER="${S3_PROVIDER}"
S3_SUBPATH="${S3_SUBPATH:-backups}"
BACKUPS_TO_KEEP="${BACKUPS_TO_KEEP:-7}"
@ -28,6 +29,7 @@ data:
# 配置 s3cmd
cat > ~/.s3cfg << EOF
[default]
provider = ${S3_PROVIDER}
access_key = ${S3_ACCESS_KEY}
secret_key = ${S3_SECRET_KEY}
host_base = ${S3_ENDPOINT}

View File

@ -24,6 +24,8 @@ spec:
values:
#- vkvm-us2
- aliyun-gz2
- tencent-gz1
- tencent-sh1
# - matchExpressions:
# #- key: region
# # operator: NotIn
@ -138,17 +140,19 @@ spec:
labels:
app: node-backup
spec:
nodeSelector:
kubernetes.io/hostname: "aliyun-gz2"
#affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: tIn
# values:
# - aliyun-gz2
#nodeSelector:
# kubernetes.io/hostname: "aliyun-gz2"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- aliyun-gz2
- tencent-gz1
- tencent-sh1
# - matchExpressions:
# #- key: region
# # operator: NotIn