Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Velero in infrastructure #1541

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ingress-nginx/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ verify_cluster_access
### Create secret required by ingress-nginx
###

SELECTED_INGRESS_IP_RAW_ADDRESS=$(terraform -chdir="../../terraform/subscriptions/$AZ_SUBSCRIPTION_NAME/$RADIX_ZONE/pre-clusters" output -json clusters | jq -r '.[] | select(.cluster==env.CLUSTER_NAME).ingressIp')
SELECTED_INGRESS_IP_RAW_ADDRESS=$(terraform -chdir="../terraform/subscriptions/$AZ_SUBSCRIPTION_NAME/$RADIX_ZONE/pre-clusters" output -json clusters | jq -r '.[] | select(.cluster==env.CLUSTER_NAME).ingressIp')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, will this work if we run the bootstrap script directly?

maybe use something like WORKDIR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" (from install_base_components.sh)

create-a-record "*.${CLUSTER_NAME}" "$SELECTED_INGRESS_IP_RAW_ADDRESS" "$AZ_RESOURCE_GROUP_IPPRE" "$AZ_RESOURCE_DNS" "60" || {
echo "ERROR: failed to create A record *.${CLUSTER_NAME}" >&2
}
Expand Down
21 changes: 0 additions & 21 deletions scripts/install_base_components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,27 +250,6 @@ wait
### For network security policy applied by operator to work, the namespace hosting prometheus and nginx-ingress-controller need to be labeled
kubectl label ns default purpose=radix-base-ns --overwrite

#######################################################################################
### Install prerequisites for Velero
###

echo ""
printf "%s► Execute %s%s\n" "${grn}" "$WORKDIR_PATH/scripts/velero/install_prerequisites_in_cluster.sh" "${normal}"
(USER_PROMPT="$USER_PROMPT" ./velero/install_prerequisites_in_cluster.sh)
wait

#######################################################################################
### Patching kube-dns metrics
###

# TODO: Even with this, kube-dns is not discovered in prometheus. Needs to be debugged.
#
# echo "Patching kube-dns metrics"
# kubectl patch deployment -n kube-system kube-dns-v20 \
# --patch "$(cat ./manifests/kube-dns-metrics-patch.yaml)"

#

#######################################################################################
### Install Flux

Expand Down
248 changes: 0 additions & 248 deletions scripts/velero/install_prerequisites_in_cluster.sh

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/velero/restore/restore_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ start_radix_operator() {
printf " Done.\n"
}

flux suspend ks -n flux-system velero
wait_for_velero "BackupStorageLocation default"
kubectl patch BackupStorageLocation default --namespace velero --type merge --patch "$(echo $PATCH_JSON)"

Expand Down Expand Up @@ -570,8 +571,10 @@ PATCH_JSON="$(
}
END
)"

# Set velero in read/write mode
kubectl patch BackupStorageLocation default --namespace velero --type merge --patch "$(echo $PATCH_JSON)"
flux resume ks -n flux-system velero

#######################################################################################
### Done!
Expand Down
41 changes: 21 additions & 20 deletions terraform/subscriptions/s940/c2/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,27 @@ data "azurerm_subnet" "this" {
}

module "storageaccount" {
source = "../../../modules/storageaccount"
for_each = var.storageaccounts
name = "radix${each.key}${module.config.environment}"
tier = each.value.account_tier
account_replication_type = each.value.account_replication_type
resource_group_name = each.value.resource_group_name
location = each.value.location
environment = module.config.environment
kind = each.value.kind
change_feed_enabled = each.value.change_feed_enabled
versioning_enabled = each.value.versioning_enabled
backup = each.value.backup
principal_id = module.backupvault.data.backupvault.identity[0].principal_id
vault_id = module.backupvault.data.backupvault.id
policyblobstorage_id = module.backupvault.data.policyblobstorage.id
subnet_id = data.azurerm_subnet.this.id
vnet_resource_group = module.config.vnet_resource_group
lifecyclepolicy = each.value.lifecyclepolicy
ip_rule = data.azurerm_key_vault_secret.this.value
log_analytics_id = module.loganalytics.workspace_id
source = "../../../modules/storageaccount"
for_each = var.storageaccounts
name = "radix${each.key}${module.config.environment}"
tier = each.value.account_tier
account_replication_type = each.value.account_replication_type
resource_group_name = each.value.resource_group_name
location = each.value.location
environment = module.config.environment
kind = each.value.kind
change_feed_enabled = each.value.change_feed_enabled
versioning_enabled = each.value.versioning_enabled
backup = each.value.backup
principal_id = module.backupvault.data.backupvault.identity[0].principal_id
vault_id = module.backupvault.data.backupvault.id
policyblobstorage_id = module.backupvault.data.policyblobstorage.id
subnet_id = data.azurerm_subnet.this.id
vnet_resource_group = module.config.vnet_resource_group
lifecyclepolicy = each.value.lifecyclepolicy
ip_rule = data.azurerm_key_vault_secret.this.value
log_analytics_id = module.loganalytics.workspace_id
shared_access_key_enabled = each.value.shared_access_key_enabled #Needed in module create container when running apply
}

module "acr" {
Expand Down
Loading
Loading