|
1 | 1 | ---
|
2 | 2 | title: Access the Kubernetes Dashboard in Azure Stack Hub
|
3 |
| -description: Learn how to access the Kubernetes Dashboard in Azure Stack Hub |
| 3 | +description: Learn how to access the Kubernetes Dashboard in Azure Stack Hub. |
4 | 4 | author: sethmanheim
|
5 | 5 | ms.topic: article
|
6 |
| -ms.date: 2/1/2021 |
7 |
| -ms.author: sethm |
8 |
| -ms.reviewer: waltero |
| 6 | +ms.date: 01/23/2025 |
| 7 | +ms.author: sethm |
9 | 8 | ms.lastreviewed: 06/18/2019
|
10 | 9 |
|
11 | 10 | # Intent: As an Azure Stack user, I want to access the Kubernetes dashboard from Azure Stack for basic management operations.
|
12 | 11 | # Keyword: azure stack kubernetes dashboard
|
13 | 12 |
|
14 | 13 | ---
|
15 | 14 |
|
16 |
| -# Access the Kubernetes Dashboard in Azure Stack Hub |
| 15 | +# Access the Kubernetes Dashboard in Azure Stack Hub |
17 | 16 |
|
18 |
| -> [!NOTE] |
| 17 | +> [!NOTE] |
19 | 18 | > Only use the Kubernetes Azure Stack Marketplace item to deploy clusters as a proof-of-concept. For supported Kubernetes clusters on Azure Stack, use [the AKS engine](azure-stack-kubernetes-aks-engine-overview.md).
|
20 | 19 |
|
21 | 20 | Kubernetes includes a web dashboard that you can use for basic management operations. This dashboard lets you view basic health status and metrics for your applications, create and deploy services, and edit existing applications. This article shows you how to set up the Kubernetes dashboard on Azure Stack Hub.
|
22 | 21 |
|
23 | 22 | ## Prerequisites for Kubernetes Dashboard
|
24 | 23 |
|
25 |
| -* Azure Stack Hub Kubernetes cluster |
26 |
| - |
27 |
| - You will need to have deployed a Kubernetes cluster to Azure Stack Hub. For more information, see [Deploy Kubernetes](azure-stack-solution-template-kubernetes-deploy.md). |
28 |
| - |
29 |
| -* SSH client |
30 |
| - |
31 |
| - You'll need an SSH client to security connect to your control plane node in the cluster. If you're using Windows, you can use [Putty](https://www.ssh.com/ssh/putty/download). You will need the private key used when you deployed your Kubernetes cluster. |
32 |
| - |
33 |
| -* FTP (PSCP) |
34 |
| - |
35 |
| - You may also need an FTP client that supports SSH and SSH File Transfer Protocol to transfer the certificates from the control plane node to your Azure Stack Hub management machine. You can use [FileZilla](https://filezilla-project.org/download.php?type=client). You will need the private key used when you deployed your Kubernetes cluster. |
| 24 | +- Azure Stack Hub Kubernetes cluster: a Kubernetes cluster deployed to Azure Stack Hub. For more information, see [Deploy Kubernetes](azure-stack-solution-template-kubernetes-deploy.md). |
| 25 | +- SSH client: an SSH client to security connect to your control plane node in the cluster. If you use Windows, you can use [Putty](https://www.ssh.com/ssh/putty/download). You need the private key that you used when you deployed your Kubernetes cluster. |
| 26 | +- FTP (PSCP): an FTP client that supports SSH and the SSH File Transfer Protocol to transfer the certificates from the control plane node to your Azure Stack Hub management machine. You can use [FileZilla](https://filezilla-project.org/download.php?type=client). You need the private key that you used when you deployed your Kubernetes cluster. |
36 | 27 |
|
37 | 28 | ## Overview of steps to enable dashboard
|
38 | 29 |
|
39 |
| -1. Export the Kubernetes certificates from the control plane node in the cluster. |
40 |
| -2. Import the certificates to your Azure Stack Hub management machine. |
41 |
| -2. Open the Kubernetes web dashboard. |
| 30 | +1. Export the Kubernetes certificates from the control plane node in the cluster. |
| 31 | +1. Import the certificates to your Azure Stack Hub management machine. |
| 32 | +1. Open the Kubernetes web dashboard. |
42 | 33 |
|
43 |
| -## Export certificate from the master |
| 34 | +## Export certificate from the master |
44 | 35 |
|
45 | 36 | You can retrieve the URL for the dashboard from the control plane node in your cluster.
|
46 | 37 |
|
47 |
| -1. Get the public IP address and username for your cluster master from the Azure Stack Hub dashboard. To get this information: |
48 |
| - |
49 |
| - - Sign in to the Azure Stack Hub portal `https://portal.local.azurestack.external/`. |
50 |
| - - Select **All services** > **All resources**. Find the master in your cluster resource group. The master is named `k8s-master-<sequence-of-numbers>`. |
| 38 | +1. Get the public IP address and username for your main cluster from the Azure Stack Hub dashboard. To get this information: |
51 | 39 |
|
52 |
| -2. Open the control plane node in the portal. Copy the **Public IP** address. Click **Connect** to get your user name in the **Login using VM local account** box. This is the same user name you set when creating your cluster. Use the public IP address rather than the private IP address listed in the connect blade. |
| 40 | + - Sign in to the Azure Stack Hub portal at `https://portal.local.azurestack.external/`. |
| 41 | + - Select **All services** > **All resources**. Find the master in your cluster resource group. The master is named `k8s-master-<sequence-of-numbers>`. |
53 | 42 |
|
54 |
| -3. Open an SSH client to connect to the master. If you are working on Windows, you can use [Putty](https://www.ssh.com/ssh/putty/download) to create the connection. You will use the public IP address for the control plane node, the username, and add the private key you used when creating the cluster. |
| 43 | +1. Open the control plane node in the portal. Copy the **Public IP** address. Select **Connect** to get your user name in the **Login using VM local account** box. This is the same user name you set when you created your cluster. Use the public IP address rather than the private IP address listed in the connect blade. |
| 44 | +1. Open an SSH client to connect to the main cluster. If you use Windows, you can use [Putty](https://www.ssh.com/ssh/putty/download) to create the connection. You use the public IP address for the control plane node, the username, and add the private key you used when you created the cluster. |
| 45 | +1. When the terminal connects, type `kubectl` to open the Kubernetes command-line client. |
| 46 | +1. Run the following command: |
55 | 47 |
|
56 |
| -4. When the terminal connects, type `kubectl` to open the Kubernetes command-line client. |
| 48 | + ```bash |
| 49 | + kubectl cluster-info |
| 50 | + ``` |
57 | 51 |
|
58 |
| -5. Run the following command: |
| 52 | + Find the URL for the dashboard. For example: `https://k8-1258.local.cloudapp.azurestack.external/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy` |
59 | 53 |
|
60 |
| - ```Bash |
61 |
| - kubectl cluster-info |
62 |
| - ``` |
63 |
| - Find the URL for the dashboard. For example: `https://k8-1258.local.cloudapp.azurestack.external/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy` |
| 54 | +1. Extract the self-signed certificate and convert it to the PFX format. Run the following command: |
64 | 55 |
|
65 |
| -6. Extract the self-signed cert and convert it to the PFX format. Run the following command: |
| 56 | + ```bash |
| 57 | + sudo su |
| 58 | + openssl pkcs12 -export -out /etc/kubernetes/certs/client.pfx -inkey /etc/kubernetes/certs/client.key -in /etc/kubernetes/certs/client.crt -certfile /etc/kubernetes/certs/ca.crt |
| 59 | + ``` |
66 | 60 |
|
67 |
| - ```Bash |
68 |
| - sudo su |
69 |
| - openssl pkcs12 -export -out /etc/kubernetes/certs/client.pfx -inkey /etc/kubernetes/certs/client.key -in /etc/kubernetes/certs/client.crt -certfile /etc/kubernetes/certs/ca.crt |
70 |
| - ``` |
| 61 | +1. Get the list of secrets in the **kube-system** namespace. Run the following command: |
71 | 62 |
|
72 |
| -7. Get the list of secrets in the **kube-system** namespace. Run the following command: |
| 63 | + ```bash |
| 64 | + kubectl -n kube-system get secrets |
| 65 | + ``` |
73 | 66 |
|
74 |
| - ```Bash |
75 |
| - kubectl -n kube-system get secrets |
76 |
| - ``` |
| 67 | + Make note of the kubernetes-dashboard-token-\<XXXXX> value. |
77 | 68 |
|
78 |
| - Make note of the kubernetes-dashboard-token-\<XXXXX> value. |
| 69 | +1. Get the token and save it. Update the `kubernetes-dashboard-token-<####>` with the secret value from the previous step: |
79 | 70 |
|
80 |
| -8. Get the token and save it. Update the `kubernetes-dashboard-token-<####>` with the secret value from the previous step. |
81 |
| - |
82 |
| - ```Bash |
83 |
| - kubectl -n kube-system describe secret kubernetes-dashboard-token-<####>| awk '$1=="token:"{print $2}' |
84 |
| - ``` |
| 71 | + ```bash |
| 72 | + kubectl -n kube-system describe secret kubernetes-dashboard-token-<####>| awk '$1=="token:"{print $2}' |
| 73 | + ``` |
85 | 74 |
|
86 | 75 | ## Import the certificate
|
87 | 76 |
|
88 |
| -1. Open Filezilla and connect to the control plane node. You will need the: |
89 |
| - |
90 |
| - - the control plane node public IP |
91 |
| - - the username |
92 |
| - - the private secret |
93 |
| - - Use **SFTP - SSH File Transfer Protocol** |
94 |
| - |
95 |
| -2. Copy `/etc/kubernetes/certs/client.pfx` and `/etc/kubernetes/certs/ca.crt` to your Azure Stack Hub management machine. |
| 77 | +1. Open Filezilla and connect to the control plane node. You need the following information: |
96 | 78 |
|
97 |
| -3. Make note of the file locations. Update the script with the locations, and then open PowerShell with an elevated prompt. Run the updated script: |
| 79 | + - Control plane node public IP |
| 80 | + - Username |
| 81 | + - Private secret |
| 82 | + - Use **SFTP - SSH File Transfer Protocol** |
98 | 83 |
|
99 |
| - ```powershell |
100 |
| - Import-Certificate -Filepath "ca.crt" -CertStoreLocation cert:\LocalMachine\Root |
101 |
| - $pfxpwd = Get-Credential -UserName 'Enter password below' -Message 'Enter password below' |
102 |
| - Import-PfxCertificate -Filepath "client.pfx" -CertStoreLocation cert:\CurrentUser\My -Password $pfxpwd.Password |
103 |
| - ``` |
| 84 | +1. Copy `/etc/kubernetes/certs/client.pfx` and `/etc/kubernetes/certs/ca.crt` to your Azure Stack Hub management machine. |
| 85 | +1. Make a note of the file locations. Update the script with the locations, and then open PowerShell with an elevated prompt. Run the updated script: |
104 | 86 |
|
105 |
| -## Open the Kubernetes dashboard |
| 87 | + ```powershell |
| 88 | + Import-Certificate -Filepath "ca.crt" -CertStoreLocation cert:\LocalMachine\Root |
| 89 | + $pfxpwd = Get-Credential -UserName 'Enter password below' -Message 'Enter password below' |
| 90 | + Import-PfxCertificate -Filepath "client.pfx" -CertStoreLocation cert:\CurrentUser\My -Password $pfxpwd.Password |
| 91 | + ``` |
106 | 92 |
|
107 |
| -1. Disable the pop-up blocker on your Web browser. |
| 93 | +## Open the Kubernetes dashboard |
108 | 94 |
|
109 |
| -2. Point your browser to the URL noted when you ran the command `kubectl cluster-info`. For example: |
110 |
| - https:\//azurestackdomainnamefork8sdashboard/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy |
111 |
| -3. Select the client certificate. |
112 |
| -4. Enter the token. |
113 |
| -5. Reconnect to the bash command line on the control plane node and give permissions to `kubernetes-dashboard`. Run the following command: |
| 95 | +1. Disable the pop-up blocker on your web browser. |
| 96 | +1. Point your browser to the URL noted when you ran the command `kubectl cluster-info`; for example, `https://azurestackdomainnamefork8sdashboard/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy`. |
| 97 | +1. Select the client certificate. |
| 98 | +1. Enter the token. |
| 99 | +1. Reconnect to the bash command line on the control plane node and give permissions to `kubernetes-dashboard`. Run the following command: |
114 | 100 |
|
115 |
| - ```Bash |
116 |
| - kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard |
117 |
| - ``` |
| 101 | + ```bash |
| 102 | + kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard |
| 103 | + ``` |
118 | 104 |
|
119 |
| - The script gives `kubernetes-dashboard` Cloud administrator privileges. For more information, see [For RBAC-enabled clusters](/azure/aks/kubernetes-dashboard). |
| 105 | + The script gives `kubernetes-dashboard` cloud administrator privileges. For more information, see [For RBAC-enabled clusters](/azure/aks/kubernetes-dashboard). |
120 | 106 |
|
121 |
| -You can use the dashboard. For more information on the Kubernetes dashboard, see [Kubernetes Web UI Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) |
| 107 | +You can now use the dashboard. For more information about the Kubernetes dashboard, see [Kubernetes Web UI Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/). |
122 | 108 |
|
123 | 109 | 
|
124 | 110 |
|
125 | 111 | ## Troubleshooting
|
126 | 112 |
|
127 | 113 | ### Custom Virtual Networks
|
128 | 114 |
|
129 |
| -If you face connectivity issues accessing the Kubernetes dashboard after you deploy Kubernetes to a [custom virtual network](./kubernetes-aks-engine-custom-vnet.md), ensure that target subnets are linked to the route table and network security group resources that were created by the AKS engine. |
130 |
| - |
131 |
| -Make sure that the network security group rules allow communication between the control plane nodes and the Kubernetes dashboard pod IP. This can be validated by using the ping command from a control plane node. |
132 |
| - |
133 |
| -## Next steps |
| 115 | +If you encounter connectivity issues accessing the Kubernetes dashboard after you deploy Kubernetes to a [custom virtual network](./kubernetes-aks-engine-custom-vnet.md), ensure that target subnets are linked to the route table and network security group resources that were created by the AKS engine. |
134 | 116 |
|
135 |
| -[Deploy Kubernetes to Azure Stack Hub](azure-stack-solution-template-kubernetes-deploy.md) |
| 117 | +Make sure that the network security group rules allow communication between the control plane nodes and the Kubernetes dashboard pod IP. You can validate this permission by using the `ping` command from a control plane node. |
136 | 118 |
|
137 |
| -[Add a Kubernetes cluster to the Marketplace (for the Azure Stack Hub operator)](../operator/azure-stack-solution-template-kubernetes-cluster-add.md) |
| 119 | +## Next steps |
138 | 120 |
|
139 |
| -[Kubernetes on Azure](/azure/container-service/kubernetes/container-service-kubernetes-walkthrough) |
| 121 | +- [Deploy Kubernetes to Azure Stack Hub](azure-stack-solution-template-kubernetes-deploy.md) |
| 122 | +- [Add a Kubernetes cluster to the Marketplace (for the Azure Stack Hub operator)](../operator/azure-stack-solution-template-kubernetes-cluster-add.md) |
| 123 | +- [Kubernetes on Azure](/azure/container-service/kubernetes/container-service-kubernetes-walkthrough) |
0 commit comments