# Accessing with browsers

### วิธีการเข้าใช้งาน Kubernetes cluster บน browser

1. ดาวน์โหลด์ไฟล์ **kubeconfig** จากแท็บข้างบนของ cluster<br>

   <figure><img src="/files/WDSRgKsLos7UhhzctSoa" alt=""><figcaption></figcaption></figure>
2. ตั้งค่า environment ดังนี้<br>

   <figure><img src="/files/UUMHz1ae6w6Z1F8gPG27" alt=""><figcaption></figcaption></figure>

```
export KUBECONFIG=config
```

หรือใช้ script นี้ หากมี kubernetes cluster มากกว่า 1 cluster และต้องการสลับ cluster

```
#!/bin/bash
unlink ~/.kube/config
list_host () {
        LIST_HOST_SSH=$(ls ~/.kube/kubeconfig)
}

list_host
index=1
echo "Select kubeconfig"
for hosts in $LIST_HOST_SSH
do
    echo "$index: $hosts"
    LIST[$index]=$hosts
    index=`expr $index + 1`
done
echo "Select : "
read index
ln -sf ~/.kube/kubeconfig/${LIST[$index]} ~/.kube/config
ls -lart ~/.kube/config
```

3. รัน proxy ตามคำสั่งนี้

```
kubectl proxy
```

4. การเข้าใช้งาน Kubernetes dashboard เข้าตามลิ้งค์นี้\
   <http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/>
5. เลือก **Kubeconfig** ในการยืนยันตัวตน<br>

   <figure><img src="/files/tPyO7mRfhDfkMXSu2Jwt" alt=""><figcaption></figcaption></figure>
6. เมื่อเข้าใช้งานได้แล้ว จะเห็นหน้าของ kubernetes dashboard ดังนี้<br>

   <figure><img src="/files/7V7pAkPH1ofNEu2qksPJ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://readyidc.gitbook.io/readyidc-docs/readme/kubenetes-cluster/accessing-kubernetes-clusters/accessing-with-browsers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
