Skip to content

Commit

Permalink
config: change default destination sync type to azure for azure
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-f committed Oct 22, 2024
1 parent 73711ff commit 659569c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/providers/azure/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 of Harbor or Thanos, regardless of the value set for destinationType.
destinationType: azure
3 changes: 1 addition & 2 deletions config/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ 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.
## If Harbor or Thanos are using Swift then we will automatically use Swift for the sync of Harbor or Thanos, regardless of the value set for destinationType.
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.
# s3:
Expand Down
9 changes: 9 additions & 0 deletions migration/v0.42/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ As with all scripts in this repository `CK8S_CONFIG_PATH` is expected to be set.
export CK8S_CLUSTER=<wc|sc|both>
```

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.
Expand Down
27 changes: 27 additions & 0 deletions migration/v0.42/prepare/40-azure-sync-destination-type.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 659569c

Please sign in to comment.