9.3 heapster插件

1.下载并解压

wget https://github.com/kubernetes/heapster/archive/v1.5.4.tar.gz
tar -xzvf v1.5.4.tar.gz
mv v1.5.4.tar.gz heapster-1.5.4.tar.gz

2.修改配置
cd heapster-1.5.4/deploy/kube-config/influxdb
a.vim grafana.yaml 修改镜像镜像

<         image: gcr.io/google_containers/heapster-grafana-amd64:v4.4.3
---
>         image: wanghkkk/heapster-grafana-amd64-v4.4.3:v4.4.3

https://hub.docker.com/r/wanghkkk/heapster-grafana-amd64-v4.4.3/
取消注释

<   # type: NodePort
---
>   type: NodePort

b.vim heapster.yaml

<         image: gcr.io/google_containers/heapster-amd64:v1.5.4
---
>         image: fishchen/heapster-amd64:v1.5.4
https://hub.docker.com/r/fishchen/heapster-amd64/
<         - --source=kubernetes:https://kubernetes.default
---
>         - --source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250

c.vim influxdb.yaml

<         image: gcr.io/google_containers/heapster-influxdb-amd64:v1.3.3
---
>         image: fishchen/heapster-influxdb-amd64:v1.5.2

https://hub.docker.com/r/fishchen/heapster-influxdb-amd64/
3.执行文件

kubectl create -f  .

4.执行heapster-rbac.yaml
cd …/rbac/

vim heapster-rbac.yaml 加入以下内容
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: heapster-kubelet-api
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:kubelet-api-admin
subjects:
- kind: ServiceAccount
  name: heapster
  namespace: kube-system

执行

kubectl create -f heapster-rbac.yaml

5.检验

kubectl get pods -n kube-system | grep -E 'heapster|monitoring'

输出

heapster-77fd7449fd-5gszw                1/1       Running   0          44s
monitoring-grafana-cd886b7-q22zb         1/1       Running   0          45s
monitoring-influxdb-c6fbbcc55-r2v42      1/1       Running   0          45s

启动好可以看到cpu及内存使用率

6.访问grafana

kubectl get svc -n kube-system|grep -E 'monitoring|heapster'

输出

heapster                ClusterIP   10.254.201.111   <none>        80/TCP          57s
monitoring-grafana      NodePort    10.254.144.149   <none>        80:8440/TCP     57s
monitoring-influxdb     ClusterIP   10.254.4.255     <none>        8086/TCP        57s

grafana端口为8440,访问地址
http://123.56.41.163:8440/?orgId=1

https://blog.csdn.net/liukuan73/article/details/78704395

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值