Download yaml
Download heredeploy/kube-config/influxdb
Modify yaml
-
Replace mirror
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
-
Modify grafana-service.yaml
Add external ip and change port from 80 to 3000. Because 80 port conflicts with 80 port in heapster-service.yaml
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
-
Modify influxdb-service.yaml
Port of 8083 is exposed, and external ip is added at the same time.
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
Create
kubectl create -f deploy/kube-config/influxdb/
Configure grafana
http://192.168.99.101:3000/
Modify the url of the k8s data source below
View data