Running kubernetes autoscalar

后端 未结 2 738
慢半拍i
慢半拍i 2021-01-20 02:32

I have a replication controller running with the following spec:

apiVersion: v1
kind: ReplicationController
metadata:
  name: owncloud-controller
spec:
  rep         


        
2条回答
  •  被撕碎了的回忆
    2021-01-20 03:29

    I installed hepaster under the name space "kube-system" and it worked. After running heapster, make sure it's running before you use HPA for your application.

    How to run Heapster with Kubernetes cluster

    I put all files here https://gitlab.com/abushoeb/kubernetes/tree/master/heapster. They are collected from the official Kubernetes Repository and made minor changes.

    How to run Heapster

    Go to the directory heapster where you have grafana.yaml, heapster.yaml and influxdb.yaml and run following command

    $ kubectl create -f  .
    

    How to stop Heapster

    Go to the same heapster directory and then run following command

    $ kubectl delete -f  .
    

    How to check Heapster is running

    You can access heapster metric model from the pod where heapster is running to make sure heapster is working. It can be accessed via web browser by accessing http://heapster-pod-ip:heapster-service-port/api/v1/model/metrics/. The same result can be seen by executing following command.

    $ curl -L http://heapster-pod-ip:heapster-service-port/api/v1/model/metrics/
    

    If you see the list of metrics then heapster is running correctly. You can also browse grafana dashboard to see it (find the ip of the pod where grafana is running and the access it http://grafana-pod-ip:grafana-service-port).

    Full documentation of Heapster Metric Model are available here.

    Also just run ($ kubectl cluster-info) and see if it shows results like this:

    Kubernetes master is running at https://cluster-ip:6443

    Heapster is running at https://cluster-ip:6443/api/v1/proxy/namespaces/kube-system/services/heapster

    kubernetes-dashboard is running at https://cluster-ip:6443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard

    monitoring-grafana is running at https://cluster-ip:6443/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana

    monitoring-influxdb is running at https://cluster-ip:6443/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb

    Check influxdb

    You can also check influxdb if it has data in it. Install Influxdb Client on your local machine to get connected to infuxdb database.

    $ influx -host  -port 
    

    Some Sample influxdb queries

    • show databases
    • use db-name
    • show measurements
    • select value from "cpu/node_capacity"

    Reference and Help

    • https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md
    • https://github.com/kubernetes/heapster/blob/master/docs/debugging.md
    • https://blog.kublr.com/how-to-utilize-the-heapster-influxdb-grafana-stack-in-kubernetes-for-monitoring-pods-4a553f4d36c9
    • http://www.dasblinkenlichten.com/installing-cadvisor-and-heapster-on-bare-metal-kubernetes/
    • http://blog.arungupta.me/kubernetes-monitoring-heapster-influxdb-grafana/

提交回复
热议问题