Azure-Samples / aks-platform-engineering

MIT License
83 stars 22 forks source link

Fix terraform destroy #48

Open dtzar opened 6 months ago

dtzar commented 6 months ago

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

provision the management cluster with terraform successfully. Then do a terraform destroy

Any log messages given by the failure

Plan: 0 to add, 0 to change, 22 to destroy.

Changes to Outputs:
  - subscription_id = "/subscriptions/-4518-4d05-9d6d-a29b5cf33a8d" -> null
  - tenant          = "-345f-445e-90b7-31ac0c5cf7ef" -> null
kubernetes_namespace.crossplane_namespace[0]: Destroying... [id=crossplane-system]
kubernetes_secret.git_secrets["git-workloads"]: Destroying... [id=argocd/git-workloads]
kubernetes_secret.git_secrets["git-addons"]: Destroying... [id=argocd/git-addons]
module.gitops_bridge_bootstrap.helm_release.bootstrap["addons"]: Destroying... [id=addons]
module.gitops_bridge_bootstrap.helm_release.bootstrap["workloads"]: Destroying... [id=workloads]
azurerm_federated_identity_credential.capz[0]: Destroying... [id=/subscriptions/-4518-4d05-9d6d-a29b5cf33a8d/resourceGroups/aks-gitops/providers/Microsoft.ManagedIdentity/userAssignedIdentities/capz/federatedIdentityCredentials/capz-manager-credential]
azurerm_federated_identity_credential.service_operator[0]: Destroying... [id=/subscriptions/-4518-4d05-9d6d-a29b5cf33a8d/resourceGroups/aks-gitops/providers/Microsoft.ManagedIdentity/userAssignedIdentities/capz/federatedIdentityCredentials/serviceoperator]
azurerm_role_assignment.capz_role_assignment[0]: Destroying... [id=/subscriptions/-4518-4d05-9d6d-a29b5cf33a8d/resourceGroups/aks-gitops/providers/Microsoft.Authorization/roleAssignments/60e6aa76-bad4-3670-2a90-8d3bdb1e0740]
azurerm_federated_identity_credential.service_operator[0]: Destruction complete after 1s
azurerm_federated_identity_credential.capz[0]: Destruction complete after 2s
azurerm_role_assignment.capz_role_assignment[0]: Destruction complete after 2s
╷
│ Warning: Deprecated attribute
│ 
│   on .terraform/modules/aks/main.tf line 548, in resource "azurerm_kubernetes_cluster" "main":
│  548:       public_network_access_enabled,
│ 
│ The attribute "public_network_access_enabled" is deprecated. Refer to the provider documentation for details.
╵
╷
│ Error: Delete "http://localhost/api/v1/namespaces/argocd/secrets/git-addons": dial tcp 127.0.0.1:80: connect: connection refused
│ 
│ 
╵
╷
│ Error: Delete "http://localhost/api/v1/namespaces/crossplane-system": dial tcp 127.0.0.1:80: connect: connection refused
│ 
│ 
╵
╷
│ Error: Delete "http://localhost/api/v1/namespaces/argocd/secrets/git-workloads": dial tcp 127.0.0.1:80: connect: connection refused
│ 
│ 
╵
╷
│ Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
│ 
│ 
╵
╷
│ Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
│ 
│ 
╵

Expected/desired behavior

destroy completes successfully

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Windows 11 WSL - Ubuntu 22.04 - Terraform 1.8.2