0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dashboard for Kubernetes のデプロイ

Last updated at Posted at 2019-04-19

Dashboard for Kubernetes のデプロイ

(2019/04時点)

環境

  • Kubernetes
    • OS: CentOS 7.4
    • Kubernetes: v1.12
    • Docker: docker-ce-18.06.1.ce
  • Dashboard
    • Dashboard: v1.10.1
    • Heapstar: 1.5.4

手順

###1. Dashboardのデプロイ

sh
# kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml

外部からアクセスするため、Service のTypeを [NodePort] に変更

sh
# kubectl edit services/kubernetes-dashboard -n kube-system
---
  type: NodePort

https://<master ip address>:<下記で取得したport> でWebUIにアクセス可能

sh
# kubectl get services --all-namespaces

WebUIにログインするためには、 [Kubeconfig] または [Token] での認証が必要となる
[Token] は、下記で取得可能

sh
# kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep kubernetes-dashboard-token | awk '{print $1}')

2. Heapstarのデプロイ

[Dashboard] 上で、PODのリソース使用量を表示したい場合には、 [Heapstar] が必要となる
※ PODのリソース使用量を監視するツールは、 [Heapstar] 以外にもあるが、現状 [Dashboard] では [Heapstar] のみ対応となる
※ ただし、 [Heapstar] は、deprecated となっている

sh
# git clone https://github.com/kubernetes/heapster/
  • 以下を修正
heapstar/deploy/kube-config/influxdb/heapster.yaml
-- org --
- --source=kubernetes:https://kubernetes.default
-- modified --
- --source=kubernetes.summary_api:''?useServiceAccount=true&kubeletHttps=true&kubeletPort=10250&insecure=true
heapstar/deploy/kube-config/rbac/heapster-rbac.yaml
-- org --
name: system:heapster
-- modified --
name: heapster
  • 以下を追加
heapstart/deploy/kube-config/rbac/heapster-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: heapster
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  - namespaces
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - extensions
  resources:
  - deployments
  verbs:
  - get
  - list
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - nodes/stats
  verbs:
  - get
  • デプロイ
sh
# kubectl create -f ./deploy/kube-config/rbac/
clusterrolebinding.rbac.authorization.k8s.io/heapster created
clusterrole.rbac.authorization.k8s.io/heapster created
# kubectl create -f ./deploy/kube-config/influxdb/
deployment.extensions/monitoring-grafana created
service/monitoring-grafana created
serviceaccount/heapster created
deployment.extensions/heapster created
service/heapster created
deployment.extensions/monitoring-influxdb created
service/monitoring-influxdb created

参考

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?