kubernetes + dashboard + heapster

renderings

renderings

安装```kubernetes```集群请参考 https://my.oschina.net/binges/blog/1615955

Required software

Link: https://pan.baidu.com/s/1dzQyiq Password: dyvi

Preparation before installation

所需要文件
    heapster-amd64.tar
    heapster-grafana-amd64.tar
    heapster-influxdb-amd64.tar
    dashboard-1.8.2.tar
    dashboard.yaml  
    grafana.yaml  
    heapster-rbac.yaml  
    heapster.yaml  
    influxdb.yaml
    admin-user.yaml

Import image (operate on all nodes)

docker load < heapster-amd64.tar
docker load < heapster-grafana-amd64.tar
docker load < heapster-influxdb-amd64.tar
docker load < dashboard-1.8.2.tar

[root@node27 ~]# docker images
REPOSITORY                                         TAG                 IMAGE ID            CREATED             SIZE
gcr.io/google_containers/kube-proxy-amd64          v1.9.2              e6754bb0a529        12 days ago         109.1 MB
k8s.gcr.io/kubernetes-dashboard-amd64              v1.8.2              c87ea0497294        2 weeks ago         102.3 MB
quay.io/coreos/flannel                             v0.9.1-amd64        2b736d06ca4c        10 weeks ago        51.31 MB
gcr.io/google_containers/heapster-influxdb-amd64   v1.3.3              577260d221db        4 months ago        12.55 MB
gcr.io/google_containers/heapster-grafana-amd64    v4.4.3              8cb3de219af7        4 months ago        151.5 MB
gcr.io/google_containers/heapster-amd64            v1.4.2              d4e02f5922ca        5 months ago        73.4 MB
gcr.io/google_containers/pause-amd64               3.0                 99e59f495ffa        21 months ago       746.9 kB

Install

First modify heapster.yamlthis file

- --source=kubernetes:https://x.x.x.x:6443
修改为自己的apiserver地址和端口
kubectl create -f admin-user.yaml dashboard.yaml -f grafana.yaml  -f heapster-rbac.yaml  -f heapster.yaml  -f influxdb.yaml

Use to kubectl get pods --all-namespacesview the status of each pod. If there is no error, the installation is successful. If there is an error, use it to kubectl logs POD名 --all-namespacesview the error log.

login

official documentation

https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/

yaml file address

https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

In the official documentation, the dashboard needs to proxybe accessed using the method. It feels troublesome to use. So, I changed the port to32666

Part of the original kubernetes-dashboard.yamlfile


kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  ports:
    - port: 443
      targetPort: 8443
  selector:
    k8s-app: kubernetes-dashboard

I modified to:

kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  type: NodePort
  ports:
    - port: 443
      targetPort: 8443
      nodePort: 32666
  selector:
    k8s-app: kubernetes-dashboard

Now go back to the main topic. After the operation is completed, you can use the https://nodeip:32666login interface in the browser as follows:

login

This is using a token to log in (didn't find a proper way to log in).

token

Use the following command

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | grep token

会得到如下内容(一定要记录以下内容)
token:      eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLThmamx6Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiI0YjdjMWJkMi0wNTdjLTExZTgtOTY2Mi0wMDUwNTZiNjJiNjUiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.DIjORmQOsloHV6CsDKi7XXc3uhg4uf0j5xZiph19zJBkzzGlvlrwkXwa-KhezJ_6DuOgpnFYBTM0coUVxly8RD7Q82zg2vf_ijOE_AIWV3uMy0ni-VgwduNoD

这里的token就是登陆Dashboard的令牌

After logging in, you can see the renderings at the beginning for up to 5 minutes.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324391888&siteId=291194637