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):
After receiving the directory for one of our Kubernetes deployments on Azure, I was unable to run
terraform apply
after doingterraform init
, receiving the following error message: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 theKUBECONFIG
variable instead when executingsource 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 theterraform plan
command to run successfully.