diff --git a/config/providers/azure/sc-config.yaml b/config/providers/azure/sc-config.yaml index ab40a230b..2a036cd69 100644 --- a/config/providers/azure/sc-config.yaml +++ b/config/providers/azure/sc-config.yaml @@ -9,3 +9,8 @@ fluentd: # azcopy is used by az CLI for downloading files azureCopyBufferGB: 0.3 azureCopyConcurrency: 8 + +objectStorage: + sync: + ## If Harbor or Thanos are using swift then we will automatically use swift for the sync, regardless of the value set for type. + destinationType: azure diff --git a/config/sc-config.yaml b/config/sc-config.yaml index 939b3fc1a..beabfa2c9 100644 --- a/config/sc-config.yaml +++ b/config/sc-config.yaml @@ -64,7 +64,6 @@ objectStorage: enabled: false dryrun: false - ## Only 's3' is currently supported for `.objectStorage.sync.destinationType` as not all default buckets applications have swift support. ## If Harbor or Thanos are using swift then we will automatically use swift for the sync, regardless of the value set for type. destinationType: s3 # secondaryUrl: set-me if regionEndpoint and or authUrl does not have all the relevant ips and or ports used for rclone-sync networkpolicy. diff --git a/migration/v0.42/README.md b/migration/v0.42/README.md index 47a581007..b2430d04d 100644 --- a/migration/v0.42/README.md +++ b/migration/v0.42/README.md @@ -127,6 +127,15 @@ As with all scripts in this repository `CK8S_CONFIG_PATH` is expected to be set. export CK8S_CLUSTER= ``` +1. Update objectStorage.sync.destinationType for azure clusters + + Ensure that objectStorage.sync.destinationType keeps current value for azure clusters that have sync enabled. + Default is updated to `azure` for azure clusters. + + ```bash + ./migration/v0.42/prepare/40-azure-sync-destination-type.sh + ``` + 1. Update apps configuration: This will take a backup into `backups/` before modifying any files. diff --git a/migration/v0.42/prepare/40-azure-sync-destination-type.sh b/migration/v0.42/prepare/40-azure-sync-destination-type.sh new file mode 100755 index 000000000..40715eb23 --- /dev/null +++ b/migration/v0.42/prepare/40-azure-sync-destination-type.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +HERE="$(dirname "$(readlink -f "${0}")")" +ROOT="$(readlink -f "${HERE}/../../../")" + +# shellcheck source=scripts/migration/lib.sh +source "${ROOT}/scripts/migration/lib.sh" + +log_info "configuring object storage sync type on azure" +if [[ "${CK8S_CLUSTER}" =~ ^(sc|both)$ ]]; then + cloud_provider=$(yq_dig sc .global.ck8sCloudProvider) + if [[ "${cloud_provider}" != "azure" ]]; then + log_info "not running on azure, skipping" + exit 0 + fi + + if yq_check sc .objectStorage.sync.enabled true; then + if yq_null sc .objectStorage.sync.destinationType; then + log_info "objectStorage sync is enabled, will keep previous default destinationType: s3" + yq_add sc .objectStorage.sync.destinationType "\"s3\"" + else + log_info "sync destinationType already has an override, skipping" + fi + else + log_info "object storage sync is not enabled, will use new default destinationType: azure" + fi +fi