kubernetes monitoring
2020-03-03 本文已影响0人
cdz620
docs
introduction
https://kubernetes.io/docs/user-guide/monitoring/
heapster
https://github.com/kubernetes/heapster
install
checkout Heapster
git clone git@github.com:kubernetes/heapster.git
edit deploy yaml
由于镜像的不断更新,代码库中的镜涉及三个gcr.io镜像的版本可能根据需要修改,具体的image tag需要到 https://console.cloud.google.com/kubernetes/images/list?project=google-containers 查询版本并修改(需要翻墙), (today: 2017-01-14)镜像的各个版本如下:
- vi grafana-deployment.yaml change image to gcr.io/google_containers/heapster-grafana:v2.6.0-2
- vi heapster-deployment.yaml change image to gcr.io/google_containers/heapster:v1.3.0-beta.0
- vi influxdb-deployment.yaml change image to gcr.io/google_containers/heapster-influxdb:v0.13.0
edit export service type(default LoadBalancer) to NodePort
vi grafana-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: 30080
targetPort: 3000
type: NodePort
externalIPs:
- 112.124.41.XXX
selector:
k8s-app: grafana
finally, start all of pods and services
kubectl create -f deploy/kube-config/influxdb/
check cluster info
kubectl cluster-info