forked from pivotal-cf/docs-pks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
access-dashboard.html.md.erb
123 lines (93 loc) · 4.53 KB
/
access-dashboard.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
title: Accessing Dashboard
owner: PKS
---
This topic describes how to access Dashboard, a web-based Kubernetes UI, for your <%= vars.product_full %> deployment.
##<a id='overview'></a>Overview
Kubernetes provides Dashboard to manage Kubernetes clusters and applications, and to review the state of Kubernetes cluster resources.
##<a id='access-credentials'></a>Access Credentials
You must have either a <code>kubectl</code> Kubeconfig or Bearer Token access credential to access Dashboard.
###<a id='kubeconfig-access-credentials'></a>Configure Kubeconfig Access Credentials
You can use the PKS CLI to request a Kubeconfig access credential and
to save the credential to either a file or environment variable for use as your Dashboard access credential.
To request Kubeconfig credentials use one of the two following methods.
* Request a Kubeconfig access credential using the PKS CLI:
```bash
pks get-credentials CLUSTER-NAME
```
Where `CLUSTER-NAME` is the name of your cluster.
<br><br>
For example:
<pre class="terminal">
$ pks get-credentials pks-bosh
Fetching credentials for cluster pks-bosh.
Context set for cluster pks-bosh.
</pre>
<%= partial "saml-sso-login" %>
* Request a Kubeconfig access credential and assign to your Kubernetes configuration:
```bash
KUBECONFIG=CONFIG-FILE pks get-credentials CLUSTER-NAME
```
Where:
* `CONFIG-FILE` is the name of the output file which will store the exported access
credentials.
* `CLUSTER-NAME` is the name of your cluster.
<%= partial "saml-sso-login" %>
###<a id='bearertoken-access-credentials'></a>Request Bearer Token Access Credentials
You can use `kubectl` to request a Bearer Token access credential.
1. To request your Kubernetes user ID, run the following command:
```bash
kubectl config view -o jsonpath='{.contexts[?(@.name == "CLUSTER-NAME")].context.user}'
```
Where `CLUSTER-NAME` is the name of your cluster.
<br><br>
For example:
<pre class="terminal">
$ kubectl config view -o jsonpath='{.contexts[?(@.name == "pks-bosh")].context.user}'
dxbjlm0j-ac11-43f9-99a7-87u5u4fbe44b
</pre>
1. To derive a Kubeconfig Token use one of the two following methods.
* Kubectl Get Secret request:
```
kubectl describe secret $(kubectl get secret | grep USER-ID | awk '{print $1}') | grep "token:"
```
Where `USER-ID` is your Kubernetes User ID.
<br><br>
For example:
<pre class="terminal">
$ kubectl describe secret $(kubectl get secret | grep dxbjlm0j-ac11-43f9-99a7-87u5u4fbe44b | awk '{print $1}') | grep "token:"
token: eyxYzGciOiJSUzI1NiPsIndxbaac0jac11erf999a787e3e4fbe44rgnZ....iI4utgU6-qKDEdwEJw5TQA
</pre>
* Kubectl Describe Service Accounts request:
```
kubectl describe secret $(kubectl describe serviceaccounts USER-ID | grep Tokens | awk '{print $2}') | grep "token:"
```
Where `USER-ID` is your Kubernetes User ID.
<br><br>
For example:
<pre class="terminal">
$ kubectl describe secret $(kubectl describe serviceaccounts dxbjlm0j-ac11-43f9-99a7-87u5u4fbe44b | grep Tokens | awk '{print $2}') | grep "token:"
token: eyxYzGciOiJSUzI1NiPsIndxbaac0jac11erf999a787e3e4fbe44rgnZ....iI4utgU6-qKDEdwEJw5TQA
</pre>
##<a id='access'></a>Access Dashboard
After you have obtained access credentials you can authenticate into Dashboard.
1. To start the proxy server run the following:
```bash
kubectl proxy
```
1. To access the Dashboard UI, open a browser and navigate to the following:
```text
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
````
1. On the Kubernetes Dashboard sign in page select an option based on the type of credential that
you prepared in the previous steps.
* If you prepared a Kubeconfig credential file:
* Select **Kubeconfig**.
* To specify your kubeconfig file select **`...`**, to the right of **Choose kubeconfig file**.
* Specify the kubeconfig file location.
* If you prepared a Kubeconfig token:
* Select **Token**.
* To specify your kubeconfig token, paste your kubeconfig token into the **Enter token** area.
1. Click **SIGN IN**. The Dashboard Overview page is displayed.
##<a id='use'></a>Use Dashboard
For information about how to use Dashboard, see [Web UI (Dashboard)](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#welcome-view) in the Kubernetes documentation.