Seems like we need a statefulset generator
cc: @kubernetes/sig-cli-feature-requests
@kow3ns the generator that will be created for kubectl autoscale
can be used for kubectl create statefulset
too. I think. Unless kubectl autoscale
is still using the old generator interface.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
/assign @adohe
I will pick this up and submit a PR asap.
@kargakis @smarterclayton @adohe @Tedezed
Before we enable this feature I think we need to consider a few things.
CPU based auto-scaling works well if the following is true
There are many categories of applications for which auto-scaling based on CPU might not be the best approach.
I think this discussion needs to take into account the v2alpha1 autoscaler that allows custom metrics as signals for HPA. I haven't looked at it in detail yet, but it appears to be more than just CPU based autoscaling.
Some things need to be a statefulset that aren't really that stateful but need something like an EBS volume attached via PVC. So therefore now we can't autoscale those?
cc: @DirectXMan12
note that basically supporting any new autoscaling any new resources is block on supporting scale clients on any resources, which did not quite make it into Kube 1.8.
@DirectXMan12: GitHub didn't allow me to assign the following users: directxman12.
Note that only kubernetes members can be assigned.
In response to this:
/assign @DirectXMan12
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign @DirectXMan12
let's try that again with slightly different capitalization in the source:
@DirectXMan12 : Is there some commit plan for this issue? We are leveraging StatefulSet pod and auto scaling. This feature is very beneficial to us.
Your reply is much appreciated.
well, we now have a polymorphic scale client (in 1.9), so we should be able to unblock this issue in that regard. From an HPA perspective, StatefulSet needs a /scale
subresource, and then we should be able to run the HPA against it. That doesn't guarantee your statefulset will handle the scales very well, but that's not really an HPA problem.
StatefulSet is @kubernetes/sig-apps-feature-requests, correct?
@DirectXMan12 sts has a scale sub resource
if that's the case, then we're all set :-)
@DirectXMan12 sorry I did not catch your point quite clearly. I want to know if any plans for supporting HPA in StatefulSet or prs on implementing this? We do have some scenarios required this feature, thanks :)
If statefulset has a scale subresource already, then it's automatically supported in the HPA. @kow3ns indicated that statefulset has a scale subresource, so it should be supported in the HPA automatically now.
/close
Closed #44033.
You can use https://github.com/GleamAI/overscale, that tool is for GKE
It just works in Kubernetes 1.9 and Openshift 3.9.
All you have to do is create HPA like below (example from Openshift 3.9):
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: YOUR_HPA_NAME
spec:
maxReplicas: 3
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: YOUR_STATEFUL_SET_NAME
targetCPUUtilizationPercentage: 80
It just works in Kubernetes 1.9 and Openshift 3.9.
All you have to do is create HPA like below (example from Openshift 3.9), pointing to your StatefulSet:
apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: YOUR_HPA_NAME spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: StatefulSet name: YOUR_STATEFUL_SET_NAME targetCPUUtilizationPercentage: 80
You save lot of my time.
It just works in Kubernetes 1.9 and Openshift 3.9.
All you have to do is create HPA like below (example from Openshift 3.9), pointing to your StatefulSet:apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: YOUR_HPA_NAME spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: StatefulSet name: YOUR_STATEFUL_SET_NAME targetCPUUtilizationPercentage: 80
It's worked for me as well and really saved time.
Thanks
Regarding hpa I set for prometheus, But pod terminates instantly while crossing the threshold limit. this is my code:
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: YOUR_HPA_NAME
spec:
maxReplicas: 3
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: YOUR_STATEFUL_SET_NAME
targetMemoryUtilizationPercentage: 80
Can anyone help me?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are on a team that was mentioned.
hi Tedezed thanks for the info.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are on a team that was mentioned.