I was able to recreate this issue.
Digital Ocean does not support Cluster Auto scaling as mentioned here. But it seems that HPA should work, as it scales pods.
I was able to work with this and get the HPA to work. Note that I did not spend a significant amount of time on this, so I am not yet aware if there are any issues later on. My goal was to make hpa scale and this was successful.
First install the Metrics server as the Heapster is deprecated. I did that by git clone and then kubectl create -f deploy/1.8+/
.
Next find the metrics server deployment and edit it:
kubectl edit deployment metrics-server -n kube-system
Under spec:
->containers:
add following metrics:
spec:
containers:
- command:
- /metrics-server
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP
- --logtostderr
Wait few minutes, when you will call kubectl get hpa
you will see that under TARGETS<unknown>/50%
changes to 0%/50%
you are ready to generate the load and scale the pods. After you stop the load, the hpa will slowly start removing the pods.
UPDATE:
you probably missed a dash. It should look like this.
spec:
containers:
- command:
- /metrics-server
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP
- --logtostderr
image: k8s.gcr.io/metrics-server-amd64:v0.3.1
Delete the dash that was in front of "image".
Hope this helps.
kubectl get hpa
could be useful. – aureliuskubectl logs <heapster-pod>
? – Rico