Azure / aksArc

# Welcome to the Azure Kubernetes Service enabled by Azure Arc (AKS Arc) repo This is where the AKS Arc team will track features and issues with AKS Arc. We will monitor this repo in order to engage with our community and discuss questions, customer scenarios, or feature requests. Checkout our projects tab to see the roadmap for AKS Arc!
MIT License
111 stars 45 forks source link

[BUG] After unsuccessful installation arc with Enable-AksHciArcConnection, Disable-AksHciArcConnection should delete addon on management cluster #182

Open Pamir opened 2 years ago

Pamir commented 2 years ago

Describe the bug Arc installation without proper parameters with Enable-AksHciArcConnection leads to arc-onboarding process fail. To cleanup failed arc onboarding process execution of Disable-AksHciArcConnection does not delete addon < target-cluster >-arc-onboarding"

To Reproduce Steps to reproduce the behavior:

  1. Enable-AksHciArcConnection without or wrong authentication paramters
  2. watch pods in azure-arc-onboarding namesace to fail
  3. Disable-AksHciArcConnection
  4. Enable-AksHciArcConnection with proper parameters. ´´´ cluster addons arc install --cluster-name target1 --kubeconfig "V:\AKS-HCI\WorkingDir\1.0.9.10413\kubeconfig-mgmt" --subscription-id xxxxx --tenant-id xxxxxx --resource-group AksHciAzureEval --location eastus --azure-creds-stdin returned a non zero exit code 1 [Error: addons.msft.microsoft "target1-arc-onboarding" already exists ]. At C:\Program Files\WindowsPowerShell\Modules\Kva\1.0.25\Kva.psm1:4230 char:9 + throw $([System.String]::Format([System.Globalization.Culture ... + ~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: ( cluster addons...eady exists ].:String) [], RuntimeException + FullyQualifiedErrorId : cluster addons arc install --cluster-name target1 --kubeconfig "V:\AKS-HCI\WorkingDir\1 .0.9.10413\kubeconfig-mgmt" --subscription-id xxxx--tenant-id xxxx --resource-group AksHciAzureEval --location eastus --azure-creds-stdin returned a non zero exit code 1 [Error: addons.msft.microsoft "target1-arc-onboarding" already exists ].
    
    **Expected behavior**
    Disable-AksHciArcConnection should delete addon < target-cluster >-arc-onboarding component in management cluster

Environment (please complete the following information): Name Value


catalog aks-hci-stable-catalogs-ext controlplaneVmSize Standard_A4_v2 ipaddressprefix 192.168.0.0/16 identity bmFtZTogNDM0NTQ1YWQtMWI2OS00ZjM2LThiNTItMGMzNmM4NGNlOTMxCnRva2VuOiBleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWpGaVkyTmlPV0UxWldNMFl6UmpOelV5TW1Zd1pqUXlNVGd3TWpNek5EWXlaV000Wldaa09USmlPVE13TlRNMU1qYzJZamxsWldZNFl6WXdZVEptTWpNaUxDSjBlWEFpT2lKS1YxUWlmU... kubeconfig V:\AKS-HCI\WorkingDir\1.0.9.10413\kubeconfig-mgmt ring earlyaccesspreview k8snodeippoolend 192.168.0.149 containerRegistryUser 1516df5a-f1cc-4a6a-856c-03d127b02d05 imageDir V:\AKS-HCI\Images skipUpdates False vlanid 0 proxyServerNoProxy version 1.0.9.10413 kvaconfig V:\AKS-HCI\WorkingDir\1.0.9.10413\yaml\appliance.yaml proxyServerCertFile vnetvippoolstart 192.168.0.150 proxyServerHTTPS installState 7 group clustergroup

macpoolname MocMacPool cloudAgentAuthorizerPort 65000

stagingShare workingDir V:\AKS-HCI\WorkingDir vnetvippoolend 192.168.0.250 dnsservers 192.168.0.1 kvaK8sVersion v1.22.6 useStagingShare False proxyServerUsername cloudAgentPort 55000 addonTokenValidity 60 proxyServerHTTP manifestCache V:\AKS-HCI\WorkingDir\aks-hci-stable-catalogs-ext.json cloudLocation MocLocation kvaSkipWaitForBootstrap False

kvaPodCidr 10.244.0.0/16 k8snodeippoolstart 192.168.0.3 azureResourceGroup AksHciAzureEval azureLocation eastus vnetName mgmtvnet moduleVersion 1.0.22 proxyServerPassword operatorTokenValidity 90 macPoolEnd tokenExpiryDays 90 gateway 192.168.0.1 vswitchName InternalNAT insecure False installationPackageDir V:\AKS-HCI\WorkingDir\1.0.9.10413 macPoolStart

Additional context Add any other context about the problem here.

Collect log files

madhanrm commented 2 years ago

@nwoodmsft can you take a look at this please