Disable the Kubernetes dashboard on Azure Kubernetes Service

A recently introduced change enables the capability to disable the Kubernetes dashboard on an AKS cluster. This is achieved by providing the Kubernetes dashboard as an AKS add-on like the Azure Monitor for containers integration, AKS virtual nodes or the HTTP application routing.

I stumbled over that capability in the Terraform Azure provider documentation for Azure Kubernetes Service.

-> https://www.terraform.io/docs/providers/azurerm/r/kubernetes_cluster.html#kube_dashboard

Add the following lines to your Terraform main.tf file to disable the Kubernetes dashboard on new or existing AKS clusters.

...
  addon_profile {
    kube_dashboard {
      enabled = false
    }
  }
...

When you prefer Azure Resource Manager templates or the Azure CLI, here are the examples.

Azure Resource Manager templates:

...
        "addonProfiles": {
          "kubeDashboard": {
            "enabled": false
          }
        },
...

Azure CLI (AKS preview extension):

az aks disable-addons -a kube-dashboard -g aks -n azst-aks1 --verbose

Whatever tooling you use for disabling the Kubernetes dashboard on AKS, your kube-system namespace should look like this afterwards running kubectl get deployments -l k8s-app=kubernetes-dashboard and kubectl get pods -l k8s-app=kubernetes-dashboard.

> kubectl get deployments -l k8s-app=kubernetes-dashboard
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
kubernetes-dashboard   1/1     1            1           111s
> kubectl get pods -l k8s-app=kubernetes-dashboard
NAME                                   READY   STATUS    RESTARTS   AGE
kubernetes-dashboard-cc4cc9f58-ttntn   1/1     Running   0          119s
> kubectl get deployments -l k8s-app=kubernetes-dashboard
No resources found in kube-system namespace.
> kubectl get pods -l k8s-app=kubernetes-dashboard
No resources found in kube-system namespace.
Facebooktwitterlinkedinmail