# Truy cập Kube Dashboad (K8S) ```{admonition} Pre-condition * Tạo K8S với tùy chọn bật add-on Kubernetes Dashboard và Nginx Ingress * Tải về file Kubeconfig ``` **Các bước thực hiện:** ---------- ### **Bước 1: Tạo tài khoản dịch vụ và ràng buộc vai trò cụm cho Kube Dashboard bằng file** {download}`kube-dashboard.yaml<../../../_static/file/ske/troubleshooting/kube-dashboard.yaml>` ### **Bước 2: Áp dụng thông tin tài khoản và ràng buộc cho cụm** Chạy câu lệnh ``` kubectl --kubeconfig={name file kubeconfig} apply -f kube-dashboard.yaml ``` Kết quả ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-1.png :width: 65% :alt: Image :align: center ``` ### **Bước 3: Lấy Token từ Service Account** Chạy câu lệnh ``` kubectl --kubeconfig={name file kubeconfig} -n kubernetes-dashboard create token dashboard-admin ``` Kết quả ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-2.png :width: 65% :alt: Image :align: center ``` ### **Bước 4: Truy cập Kube Dashboard bằng cách ấn nút Kubernetes Dashboard bên trong K8S detail** ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-3.png :width: 65% :alt: Image :align: center ``` ### **Bước 5: Đăng nhập vào bên trong Dashboard** #### Đăng nhập bằng token * Người dùng chọn Token trên màn hình * Người dùng điền token đã lấy ở bước 3 và sau đó ấn Sign In để đăng nhập ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-4.png :width: 65% :alt: Image :align: center ``` #### Đăng nhập bằng file Kubeconfig * Người dùng thực hiện mở file Kubeconfig và dán dữ liệu 'token: nội\_dung\_token' vào cuối file sau đó tiến hành lưu lại. ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-5.png :width: 65% :alt: Image :align: center ``` * Thực hiện chọn loại Kubeconfig sau đó tải file vừa chỉnh sửa và thực hiện Sign in ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-6.png :width: 65% :alt: Image :align: center ``` ```{div} sd-fs-5 sd-text-primary Result ``` Toàn bộ các tính năng quản lý K8S được thể hiện trên giao diện. ```{thumbnail} ../../../_static/img/ske/troubleshooting/truy-cap-kube-dashboard-7.png :width: 65% :alt: Image :align: center ```