You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/kubernetes-dashboard.md
+8-30Lines changed: 8 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,42 +34,19 @@ This command creates a proxy between your development system and the Kubernetes
34
34
35
35
### For RBAC-enabled clusters
36
36
37
-
If your AKS cluster uses RBAC, a *ClusterRoleBinding* must be created before you can access the dashboard. Without a role binding, the Azure CLI returns an error similar to the following example:
37
+
If your AKS cluster uses RBAC, a *ClusterRoleBinding* must be created before you can correctly access the dashboard. To create a binding, use the [kubectl create clusterrolebinding][kubectl-create-clusterrolebinding] command as shown in the following example.
38
38
39
-
```
40
-
error: unable to forward port because pod is not running. Current status=Pending
41
-
```
42
-
43
-
To create a binding, create a file named *dashboard-admin.yaml* and paste the following sample. This sample binding does not apply any additional authentication components. You can use mechanisms such as bearer tokens or a username/password to control who can access the dashboard and what permissions they have. For more information on authentication methods, see the Kubernetes dashboard wiki on [access controls][dashboard-authentication].
44
-
45
-
```yaml
46
-
apiVersion: rbac.authorization.k8s.io/v1beta1
47
-
kind: ClusterRoleBinding
48
-
metadata:
49
-
name: kubernetes-dashboard
50
-
labels:
51
-
k8s-app: kubernetes-dashboard
52
-
roleRef:
53
-
apiGroup: rbac.authorization.k8s.io
54
-
kind: ClusterRole
55
-
name: cluster-admin
56
-
subjects:
57
-
- kind: ServiceAccount
58
-
name: kubernetes-dashboard
59
-
namespace: kube-system
60
-
```
39
+
> [!WARNING]
40
+
> This sample binding does not apply any additional authentication components and may lead to insecure use. The Kubernetes dashboard is open to anyone with access to the URL. Do not expose the Kubernetes dashboard publicly.
41
+
>
42
+
> You can use mechanisms such as bearer tokens or a username/password to control who can access the dashboard and what permissions they have. This allows for more secure use of the dashboard. For more information on using the different authentication methods, see the Kubernetes dashboard wiki on [access controls][dashboard-authentication].
61
43
62
-
Apply the binding with [kubectl apply][kubectl-apply] and specify your *dashboard-admin.yaml*, as shown in the following example:
63
-
64
-
```
65
-
$ kubectl apply -f dashboard-admin.yaml
66
-
67
-
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
You can now access the Kubernetes dashboard in your RBAC-enabled cluster. To start the Kubernetes dashboard, use the [az aks browse][az-aks-browse] command as detailed in the previous step.
71
49
72
-
73
50
## Run an application
74
51
75
52
In the Kubernetes dashboard, click the **Create** button in the upper right window. Give the deployment the name `nginx` and enter `nginx:latest` for the container image name. Under **Service**, select **External** and enter `80` for both the port and target port.
@@ -116,6 +93,7 @@ For more information about the Kubernetes dashboard, see the Kubernetes document
0 commit comments