Running kubernetes autoscalar

后端 未结 2 737
慢半拍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:25

    Most probably heapster is running in a wrong namespace ("default"). HPA expects heapster to be in "kube-system" namespace. Please, add --namespace=kube-system to kubectl run heapster command.

    0 讨论(0)
  • 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 <cluster-ip> -port <influxdb-service-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/
    0 讨论(0)
提交回复
热议问题