-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate scale sub resouce by means of an HPA and ScheludedScaling CRD #276
base: master
Are you sure you want to change the base?
Integrate scale sub resouce by means of an HPA and ScheludedScaling CRD #276
Conversation
This pr development focusses on using the a scaling schedule or a cluster scaling schedule CRD's for automatically scaling up an EDS to the required number of replicas. The HPA doesn't directly control or edit the replicas of the EDS. The replic count reported by the HPA is stored in a separate property which is taken into account during the calculation for determining the scaling operation. Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
To aviod having unused nodes and nodes with shards less than minShardsPerNode during the HPA scale up step, now we calculate the increase in index replica required to maintain minShardsPerNode ratio or close to the minShardsPerNodeRatio so that: - quick scaling can be achieved in a single step - to avoid an inconsistent state during the first HPA scale up operation - prepare the nodes and indices ready for the expected incrased in load due to a scheduled scaling or any other HPA trigger Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
253663d
to
fc49d1c
Compare
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
The stabel version of metrics-server is available at https://objects.githubusercontent.com/github-production-release-asset-2e65be/92132038/cdc0a1f8-1732-4c26-b68e-876396de00ed?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220822%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220822T080848Z&X-Amz-Expires=300&X-Amz-Signature=a7d7186163ef64461dc4036c86b3a528a40deb969ae63783728b3bcd4f461730&X-Amz-SignedHeaders=host&actor_id=9018501&key_id=0&repo_id=92132038&response-content-disposition=attachment%3B%20filename%3Dcomponents.yaml&response-content-type=application%2Foctet-stream There were some errors when running the metrics-server locally with kind. Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
2b42361
to
58447c2
Compare
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
@mikkeloscar Can you paste here the snippet that you prepared for creating the fake clientset. I cannot access our chat message anymore. I have one pending unit test to complete this pr. |
The Clientset had to be modified a bit to expose the internal clients for mocking in test package. Signed-off-by: Girish Chandrashekar <[email protected]>
Signed-off-by: Girish Chandrashekar <[email protected]>
@otrosien I've complete the last task from my side. The e2e and documentation tests are taking longer than before which cause a timeout on the workflow step. I can try and increase the CPU resources in the documentation manifests but I'm not sure if it will help. |
Thanks @girishc13, I'm still on a few other topics and will pick it up later this month. |
@girishc13 sorry I missed your message. Here it is in case you didn't figure it out yet: package clientset
import (
mFake "github.com/zalando-incubator/es-operator/pkg/client/clientset/versioned/fake"
"github.com/zalando-incubator/es-operator/pkg/clientset"
"k8s.io/client-go/kubernetes/fake"
zFake "k8s.io/metrics/pkg/client/clientset/versioned/fake"
)
func NewFakeClientset() *clientset.Clientset {
return clientset.Clientset{
Interface: fake.NewSimpleClientset(),
zInterface: zFake.NewSimpleClientset(),
mInterface: mFake.NewSimpleClientset(),
}
} Didn't have time to check the PR yet :( |
One-line summary
Integrate Horizontal Pod Autoscaler to allow scaling EDS using ScalingSchedule custom resource.
Description
This pr development focusses on using the a scaling schedule or a cluster scaling schedule CRD's for automatically scaling up an EDS to the required number of replicas. The HPA doesn't directly control or edit the replicas of the EDS. The replica count reported by the HPA is stored in a separate property which is taken into account during the calculation for determining the scaling operation. The HPA targets the EDS for registering the target scaling counts.
A new
hpa_replicas
property is introduced to the EDS spec. This property is controlled by the HPA via the scale subresource. There is also a corresponding status property. By default the HPA will not set the number of replicas to zero. Therefore the default value of hpa_replicas is 1. The HPA scaling pattern respects the existing cool down periods.The initial
scalingHint()
method checks for the .spec.hpa_replicas property in addition to the cpu metrics to determine the next scaling operation.The subsequent
scaleUpOrDown
has the core logic for incorporating the hpa replica count to calculate the next change in index or node replicas.MinNodeReplica
condition is satisfied first. The hpa replica count is satisfied in the next scaling step.MaxShardsPerNode
is satisfied before satisfying hpa replica count. The hpa replica count maybe satisfied in the next scaling step.MinIndexReplicas
is satisfied before satisfying hpa replica count. The hpa replica count is satisfied in the next scaling step.UP
:MinShardsPerNode
condition.DOWN
:MinIndexReplica
setting. Re-calculate the number of node replicas based on the new shard to node ratio.A custom metrics adapter like kube-metrics-adapter is required to support the custom ScheduledScaling CRD. The custom metrics server is responsible for collecting replica counts or scaling values based on the CRD.
Types of Changes
Tasks
List of tasks you will do to complete the PR
Review
List of tasks the reviewer must do to review the PR
Deployment Notes