aiidalab / aiidalab-on-azure

A Terraform template to deploy AiiDAlab via Azure Kubernetes Services (AKS)
MIT License
3 stars 0 forks source link

Issue connecting to Kubernetes cluster after transferring deployment #28

Closed mbercx closed 2 years ago

mbercx commented 2 years ago

After receiving the directory for one of our Kubernetes deployments on Azure, I was unable to run terraform apply after doing terraform init, receiving the following error message:

│ Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
│ 
│   with module.aiidalab.helm_release.jupyterhub,
│   on modules/aiidalab/jupyterhub.tf line 1, in resource "helm_release" "jupyterhub":
│    1: resource "helm_release" "jupyterhub" {

Doing a bit of searching lead to this thread on Stackoverflow, where one of the suggestions was to set the KUBE_CONFIG_PATH variable. Currently, the template sets the KUBECONFIG variable instead when executing source setup-kubeconfig (and also in the README instructions):

https://github.com/aiidalab/aiidalab-on-azure/blob/7cfb29d50dde0b048c339b3f0ade33b7aac9824d/template/%7B%7Bhostname%7D%7D/setup-kubeconfig#L6

However, it seems this has been deprecated in favour of using KUBE_CONFIG_PATH:

https://github.com/hashicorp/terraform-provider-helm/blob/main/website/docs/guides/v2-upgrade-guide.markdown

For our deployment at least, setting KUBE_CONFIG_PATH allowed the terraform plan command to run successfully.

ltalirz commented 2 years ago

@sphuber would you be able to update the template to incorporate this?