Skip to content

Commit

Permalink
refactored and update in-cluster CS controller incase of existing dep…
Browse files Browse the repository at this point in the history
…loyment
  • Loading branch information
shavi2626 committed Feb 12, 2025
1 parent 64eb7f8 commit 34f09f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
24 changes: 10 additions & 14 deletions asmcli/asmcli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 9 additions & 13 deletions asmcli/commands/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,20 @@ apply_kube_yamls() {
}

install_canonical_controller() {
info "Installing ASM CanonicalService controller in asm-system namespace..."
retry 3 kubectl apply -f "${CANONICAL_CONTROLLER_MANIFEST}"
info "Waiting for deployment..."
retry 3 kubectl wait --for=condition=available --timeout=600s \
deployment/canonical-service-controller-manager -n asm-system
info "...done!"
}

install_managed_canonical_controller() {
info "Installing managed canonical service controller..."
local IN_CLUSTER_CSC_DEP; IN_CLUSTER_CSC_DEP="$(kubectl get deployment/canonical-service-controller-manager \
-n asm-system --ignore-not-found=true || true)"
-n asm-system --ignore-not-found=true || true)"
if [[ -z "$IN_CLUSTER_CSC_DEP" ]]; then
enable_service_mesh_feature
info "Checking Managed CanonicalService controller state..."
check_managed_canonical_controller_state
else
warn "Kindly migrate to managed canonical service controller. Refer <DocLink to be added>"
info "Updating ASM CanonicalService controller in asm-system namespace..."
retry 3 kubectl apply -f "${CANONICAL_CONTROLLER_MANIFEST}"
info "Waiting for deployment..."
retry 3 kubectl wait --for=condition=available --timeout=600s \
deployment/canonical-service-controller-manager -n asm-system
fi
info "...done!"
}

install_fleet_api() {
Expand Down Expand Up @@ -278,5 +274,5 @@ install_control_plane() {
if use_fleet_api; then install_fleet_api; else install_control_plane_revision; fi
fi

install_managed_canonical_controller
install_canonical_controller
}

0 comments on commit 34f09f1

Please sign in to comment.