kubernetes安装heapster、influxdb及grafana

下载yaml

在这里下载deploy/kube-config/influxdb

修改yaml

  • 替换镜像
gcr.io/google_containers/heapster-grafana:v4.0.2
registry.cn-hangzhou.aliyuncs.com/kube_containers/heapster_grafana

gcr.io/google_containers/heapster-influxdb:v1.1.1
registry.cn-hangzhou.aliyuncs.com/kube_containers/heapster_influxdb

gcr.io/google_containers/heapster:v1.3.0-beta.0
registry.cn-hangzhou.aliyuncs.com/wayne/heapster:v1.1.0
  • 修改grafana-service.yaml
    添加external ip,同时把port由80改为3000。因为80的port跟heapster-service.yaml中的80的port冲突了。
apiVersion: v1
kind: Service
metadata:
  labels:
    # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
    # If you are NOT using this as an addon, you should comment out this line.
    kubernetes.io/cluster-service: 'true'
    kubernetes.io/name: monitoring-grafana
  name: monitoring-grafana
  namespace: kube-system
spec:
  # In a production setup, we recommend accessing Grafana through an external Loadbalancer
  # or through a public IP.
  # type: LoadBalancer
  # You could also use NodePort to expose the service at a randomly-generated port
  # type: NodePort
  ports:
  - port: 3000
    targetPort: 3000
  selector:
    k8s-app: grafana
  externalIPs: 
    - 192.168.99.101   
  • 修改influxdb-service.yaml
    新增8083的port暴露出来,同时添加external ip
apiVersion: v1
kind: Service
metadata:
  labels:
    task: monitoring
    # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
    # If you are NOT using this as an addon, you should comment out this line.
    kubernetes.io/cluster-service: 'true'
    kubernetes.io/name: monitoring-influxdb
  name: monitoring-influxdb
  namespace: kube-system
spec:
  ports:
  - name: http
    port: 8083
    targetPort: 8083
  - name: api
    port: 8086
    targetPort: 8086
  selector:
    k8s-app: influxdb
  externalIPs: 
    - 192.168.99.101  

创建

kubectl create -f deploy/kube-config/influxdb/

配置grafana

http://192.168.99.101:3000/
修改下k8s数据源的url

Paste_Image.png

查看数据


Paste_Image.png

doc

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容