-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(kuma-cp) add horizontal pod autoscaler #1271
Conversation
eca3f6a
to
75f5862
Compare
dc12036
to
2f578be
Compare
@tharun208 would you mind taking a look at this too? |
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
1a94722
to
1cf9ad0
Compare
mk/kind.mk
Outdated
@@ -116,6 +116,13 @@ kind/deploy/metrics: build/kumactl | |||
@${BUILD_ARTIFACTS_DIR}/kumactl/kumactl install metrics $(KUMACTL_INSTALL_METRICS_IMAGES) | kubectl apply -f - | |||
@KUBECONFIG=$(KIND_KUBECONFIG) kubectl wait --timeout=60s --for=condition=Ready -n kuma-metrics pods -l app=prometheus | |||
|
|||
.PHONY: kind/deploy/metrics-server | |||
kind/deploy/metrics-server: | |||
@KUBECONFIG=$(KIND_KUBECONFIG) kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.1/components.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please parametrize the version so we can bump it easier.
@KUBECONFIG=$(KIND_KUBECONFIG) kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.1/components.yaml | ||
@KUBECONFIG=$(KIND_KUBECONFIG) kubectl patch -n kube-system deployment/metrics-server \ | ||
--patch='{"spec":{"template":{"spec":{"containers":[{"name":"metrics-server","args":["--cert-dir=/tmp", "--secure-port=4443", "--kubelet-insecure-tls", "--kubelet-preferred-address-types=InternalIP"]}]}}}}' | ||
@KUBECONFIG=$(KIND_KUBECONFIG) kubectl wait --timeout=60s --for=condition=Available -n kube-system deployment/metrics-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, how kind
specific is this? You say in the readme or on a cluster with a similarly self-signed certz
, what are these clusters? Is this a public cloud, or on-prem?
My point is, is, does this belong to kind.mk
or can go a bit more generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely more generic, just wasn't sure which makefile to put it in -- maybe dev.mk? It should be up to the user to configure the metrics-server separately from kuma, this make target is just meant to make the dev setup easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might also be the case for things like minikube and microk8s. Do you generally use kind for local dev?
| controlPlane.autoscaling.minReplicas | int | `2` | The minimum CP pods to allow | | ||
| controlPlane.autoscaling.maxReplicas | int | `5` | The max CP pods to scale to | | ||
| controlPlane.autoscaling.targetCPUUtilizationPercentage | int | `80` | For clusters that don't support autoscaling/v2beta, autoscaling/v1 is used | | ||
| controlPlane.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}]` | For clusters that do support autoscaling/v2beta, use metrics | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, how are we setting these on the command line? is it even possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set dynamically by helm in the Capabilities.APIVersions
builtin object based on what is available in the target cluster. I think it is similar to the kubectl api-versions
command.
@Mergifyio update |
Command
|
|
Signed-off-by: austin ce <austin.cawley@gmail.com>
…arts/hpa Signed-off-by: austin ce <austin.cawley@gmail.com>
* feat(deployments) add horizontal pod autoscaler * test(deployments) add e2e test for helm autoscaling * docs(kuma-cp) add annotations to chart values * docs(kuma-cp) fix tag value doc * chore(*) parameterize metrics-server make target Signed-off-by: austin ce <austin.cawley@gmail.com> (cherry picked from commit 7d703bc) # Conflicts: # app/kumactl/pkg/install/k8s/control-plane/helmtemplates_vfsdata.go
* feat(kuma-cp) add horizontal pod autoscaler (#1271) * feat(deployments) add horizontal pod autoscaler * test(deployments) add e2e test for helm autoscaling * docs(kuma-cp) add annotations to chart values * docs(kuma-cp) fix tag value doc * chore(*) parameterize metrics-server make target Signed-off-by: austin ce <austin.cawley@gmail.com> (cherry picked from commit 7d703bc) # Conflicts: # app/kumactl/pkg/install/k8s/control-plane/helmtemplates_vfsdata.go * fix(*) conflicts Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com> Co-authored-by: Austin Cawley-Edwards <austin.cawley@gmail.com> Co-authored-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Summary
Lifts the HPA configuration from the Kong chart to enable Control Plane horizontal autoscaling.
Will rebase and resync chart readme after we merge #1209.done!Full changelog
kind/deploy/metrics-server
make task for installing the k8s metrics-server, which is necessary for HPAIssues resolved
Fix #1207
Documentation