Skip to content
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

./hack/launch-local-ca.sh for dev productivity #337

Draft
wants to merge 3 commits into
base: machine-controller-manager-provider
Choose a base branch
from

Conversation

elankath
Copy link

What this PR does / why we need it:

This change is to assist developer productivity by providing a local CA launch script that copies its configuration from the gardener shoot CA in the control plane avoiding the necessity of developer painfully copying CA flags and making their custom script.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

NONE

@elankath elankath requested review from unmarshall, rishabh-11 and a team as code owners November 21, 2024 09:38
@gardener-robot gardener-robot added needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Nov 21, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 21, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 21, 2024
@elankath
Copy link
Author

launch-local-ca.sh

This script requires ./hack/local-setup.sh to be run as prerequisite. It connects to the shoot control plane and copies the configuration of the shoot CA and generates the command to launch the local CA with the same configuration. It also generates a fast launch script at /tmp/fast-launch-ca.sh that can be used to expedite the local CA launch and also allow local editing of configuration params. All logs for the local CA are captured into /tmp/ca-local.log

Example Invocation

(⎈|garden--aws-ha-external:garden shoot--i034796--aw)cluster-autoscaler ➤ ./hack/launch-local-ca.sh                                                                         git:devprod*
NOTE: This script launches the local CA with the same configuration as that of the remote CA in the configured shoot's control plane
Targeting control plane of sap-landscape-dev:i034796:aw
Successfully targeted control plane of shoot "aw"
Downloaded CA Deployment JSON YAML into /tmp/ca-deploy.json

Creating fast launch script at /tmp/fast-launch-ca.sh
Launching local CA using following command in 5 secs. You may also launch using generated fast launch script at: /tmp/fast-launch-ca.sh
go run main.go --kubeconfig=/Users/I034796/go/src/k8s.io/autoscaler/cluster-autoscaler/dev/kubeconfigs/kubeconfig_target.yaml --address=:8085 --cloud-provider=mcm --stderrthreshold=info --skip-nodes-with-system-pods=false --skip-nodes-with-local-storage=false --expendable-pods-priority-cutoff=-10 --balance-similar-node-groups=true --ignore-taint=node.gardener.cloud/critical-components-not-ready --expander=priority --max-graceful-termination-sec=600 --max-node-provision-time=20m0s --scale-down-utilization-threshold=0.500000 --scale-down-unneeded-time=0s --scale-down-delay-after-add=0s --scale-down-delay-after-delete=0s --scale-down-delay-after-failure=0s --scan-interval=10s --ignore-daemonsets-utilization=false --v=3 --max-empty-bulk-delete=10 --new-pod-scale-up-delay=0s --max-nodes-total=4096 --nodes=1:2:shoot--i034796--aw.shoot--i034796--aw-a-z1 --nodes=0:3:shoot--i034796--aw.shoot--i034796--aw-b-z1 --nodes=1:2:shoot--i034796--aw.shoot--i034796--aw-c-z1 --feature-gates=InTreePluginAWSUnregister=true  2>&1 | tee /tmp/ca-local.log
I1121 15:23:58.787966   80166 main.go:647] Cluster Autoscaler 1.30.1
W1121 15:23:58.788799   80166 main.go:652] Error reading gardener autoscaler version, err: read VERSION: is a directory
I1121 15:23:58.788846   80166 client.go:47] Using kubeconfig file: /Users/I034796/go/src/k8s.io/autoscaler/cluster-autoscaler/dev/kubeconfigs/kubeconfig_target.yaml
I1121 15:24:00.121931   80166 leaderelection.go:250] attempting to acquire leader lease kube-system/cluster-autoscaler...
I1121 15:24:00.552012   80166 leaderelection.go:260] successfully acquired lease kube-system/cluster-autoscaler
I1121 15:24:00.552512   80166 client.go:47] Using kubeconfig file: /Users/I034796/go/src/k8s.io/autoscaler/cluster-autoscaler/dev/kubeconfigs/kubeconfig_target.yaml
...
I1121 15:24:00.984645   80166 cloud_provider_builder.go:30] Building mcm cloud provider.
...
I1121 15:24:23.470250   80166 static_autoscaler.go:567] No unschedulable pods

@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 21, 2024
@elankath elankath self-assigned this Nov 21, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 21, 2024
@elankath elankath marked this pull request as draft November 21, 2024 10:09
@gardener-robot gardener-robot added size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Nov 22, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants