kuberneteskubectlazure-akskubernetes-dashboard

Kubernetes Dashboard deployed through Terraform and helm_release module is not working


I deployed kubernetes dashboard using Terraform into my Azure Kubernetes cluster, using the following code:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">=3.0.0"
    }
  }
}


provider "azurerm" {
  features {}

}

provider "helm" {
  kubernetes {
    config_path = "~/.kube/config"
  }
}

resource "helm_release" "my-kubernetes-dashboard" {

  name = "kubernetes-dashboard"

  repository = "https://kubernetes.github.io/dashboard/"
  chart      = "kubernetes-dashboard"
  namespace  = "kube-dashboard"
 

  set {
    name  = "metricsScraper.enabled"
    value = "true"
  }
}

I am able to launch the Kubernetes dashboard in a browser with the following command:

kubectl port-forward -n kubernetes-dashboard service/kubernetes-dashboard 8080:443

enter image description here

However, when I try to use the kubectl proxy command, it gives me the following error:

enter image description here

I have tried multiple solutions but none of them have worked. Please help me resolve this error using kubectl proxy command? Thank you in advance.


Solution

  • When using kubectl proxy, I discovered that the URL I was previously using was incorrect. After following the new URL it is worked as expected:

    http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:https/proxy/#/login