Skip to content

Commit

Permalink
PLAT-3291: kubeconfig is overwrites existing (#24)
Browse files Browse the repository at this point in the history
If you happen to recreate AKS, creating the kubeconfig will fail if the
cluster is already defined.
Provide the --overwrite-existing to recreate the kubeconfig when necessary.
  • Loading branch information
fraenkel authored Sep 13, 2021
1 parent 21f48f9 commit 335e180
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ resource "azurerm_kubernetes_cluster" "aks" {
if ! az account show 2>/dev/null; then
az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET -t $ARM_TENANT_ID
fi
az aks get-credentials -f ${var.kubeconfig_output_path} -n ${var.cluster_name} -g ${data.azurerm_resource_group.aks.name}
az aks get-credentials --overwrite-existing -f ${var.kubeconfig_output_path} -n ${var.cluster_name} -g ${data.azurerm_resource_group.aks.name}
EOF
}
}
Expand Down

0 comments on commit 335e180

Please sign in to comment.