{"id":13547555,"url":"https://github.com/estafette/estafette-gke-node-pool-shifter","last_synced_at":"2026-04-02T02:07:39.230Z","repository":{"id":33165590,"uuid":"100254203","full_name":"estafette/estafette-gke-node-pool-shifter","owner":"estafette","description":"Kubernetes controller that can shift nodes from one node pool to another, to favour for example preemptibles over regular VMs","archived":false,"fork":false,"pushed_at":"2023-02-15T01:52:53.000Z","size":1976,"stargazers_count":129,"open_issues_count":11,"forks_count":16,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-02T20:38:28.821Z","etag":null,"topics":["container-engine","golang","kubernetes"],"latest_commit_sha":null,"homepage":"https://helm.estafette.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/estafette.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-14T10:06:59.000Z","updated_at":"2024-11-19T17:52:39.000Z","dependencies_parsed_at":"2024-01-16T17:48:15.286Z","dependency_job_id":"7c1bf28e-88c7-4938-adec-cfeb3ef14265","html_url":"https://github.com/estafette/estafette-gke-node-pool-shifter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/estafette/estafette-gke-node-pool-shifter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estafette%2Festafette-gke-node-pool-shifter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estafette%2Festafette-gke-node-pool-shifter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estafette%2Festafette-gke-node-pool-shifter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estafette%2Festafette-gke-node-pool-shifter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/estafette","download_url":"https://codeload.github.com/estafette/estafette-gke-node-pool-shifter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estafette%2Festafette-gke-node-pool-shifter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container-engine","golang","kubernetes"],"created_at":"2024-08-01T12:00:57.975Z","updated_at":"2026-04-02T02:07:39.204Z","avatar_url":"https://github.com/estafette.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# estafette-gke-node-pool-shifter\n\nThis controller shifts nodes from one node pool to another, in order to favour preemptibles over a 'safety net' node\npool of regular vms.\n\n[![License](https://img.shields.io/github/license/estafette/estafette-gke-node-pool-shifter.svg)](https://github.com/estafette/estafette-gke-node-pool-shifter/blob/master/LICENSE)\n\n\n## Usage\n\nYou can either use environment variables or flags to configure the following settings:\n\n| Environment variable    | Flag                      | Default  | Description\n| ----------------------- | ------------------------- | -------- | ----------------------------------------------------\n| INTERVAL                | --interval (-i)           | 300      | Time in second to wait between each shift check\n| KUBECONFIG              | --kubeconfig              |          | Provide the path to the kube config path, usually located in ~/.kube/config. For out of cluster execution\n| METRICS_LISTEN_ADDRESS  | --metrics-listen-address  | :9001    | The address to listen on for Prometheus metrics requests\n| METRICS_PATH            | --metrics-path            | /metrics | The path to listen for Prometheus metrics requests\n| NODE_POOL_FROM          | --node-pool-from          |          | Name of the node pool to shift from\n| NODE_POOL_FROM_MIN_NODE | --node-pool-from-min-node | 0        | Minimum amount of node to keep on the from node pool\n| NODE_POOL_TO            | --node-pool-to            |          | Name of the node pool to shift to\n\n*Before deploying*, you first need to create a service account via the GCloud dashboard with role set to _Compute\nInstance Admin_ and _Kubernetes Engine Admin_. This key is going to be used to authenticate from the application to\nthe GCloud API. See [documentation](https://developers.google.com/identity/protocols/application-default-credentials).\n\n\n### Deploy with Helm\n\n```\n# Prepare Helm/Tiller\n$ kubectl create sa tiller -n kube-system\n$ helm init --service-account tiller\n$ kubectl create clusterrolebinding tiller \\\n    --clusterrole=cluster-admin \\\n    --serviceaccount=kube-system:tiller\n\n# Install\n$ helm upgrade estafette-gke-node-pool-shifter \\\n    --namespace estafette \\\n    --install \\\n    --set rbac.create=true \\\n    --set-file googleServiceAccount=./google_service_account.json \\\n    --set nodePool.from=default-pool \\\n    --set nodePool.to=preemptible-pool \\\n    chart/estafette-gke-node-pool-shifter\n```\n\n### Deploy without Helm\n\n```\nexport NAMESPACE=estafette\nexport APP_NAME=estafette-gke-node-pool-shifter\nexport TEAM_NAME=tooling\nexport VERSION=1.0.11\nexport GO_PIPELINE_LABEL=1.0.11\nexport GOOGLE_SERVICE_ACCOUNT=$(cat google-service-account.json | base64)\nexport INTERVAL=300\nexport NODE_POOL_FROM=default-pool\nexport NODE_POOL_TO=preemptible-pool\nexport NODE_POOL_FROM_MIN_NODE=0\nexport CPU_REQUEST=10m\nexport MEMORY_REQUEST=16Mi\nexport CPU_LIMIT=50m\nexport MEMORY_LIMIT=128Mi\n\n# Setup RBAC\ncurl https://raw.githubusercontent.com/estafette/estafette-gke-node-pool-shifter/master/rbac.yaml | envsubst | kubectl apply -n ${NAMESPACE} -f -\n\n# Run application\ncurl https://raw.githubusercontent.com/estafette/estafette-gke-node-pool-shifter/master/kubernetes.yaml | envsubst | kubectl apply -n ${NAMESPACE} -f -\n```\n\n\n### Local development\n\nFor development purpose, you can create a new cluster with 2 autoscaled node pools, 1 preemptible and 1 regular VM.\n\n#### Create the cluster with appropriate node pools\n\n```\nexport CLUSTER_NAME=node-shifter\nexport CLUSTER_VERSION=1.7.3\nexport PROJECT=my-project\nexport ZONE=europe-west1-c\n\n# Create cluster with regular VMs\ngcloud beta container clusters create $CLUSTER_NAME \\\n  --project=$PROJECT \\\n  --zone=$ZONE \\\n  --cluster-version=$CLUSTER_VERSION \\\n  --num-nodes=1 \\\n  --enable-autoscaling \\\n  --min-nodes=0 \\\n  --max-nodes=3\n\n# Add preemptible VMs node pool\ngcloud beta container node-pools create preemptible-pool \\\n  --project=$PROJECT \\\n  --zone=$ZONE \\\n  --cluster=$CLUSTER_NAME \\\n  --num-nodes=1  \\\n  --enable-autoscaling \\\n  --min-nodes=1 \\\n  --max-nodes=3 \\\n  --preemptible\n```\n\n#### Deploy an application\n\n```\nkubectl run nginx --image=nginx:alpine --replicas=5 --limits='cpu=200m,memory=512Mi'\n```\n\n#### Start the node pool shifter\n\n```\n# proxy master\nkubectl proxy\n\n# in another shell\ngo build \u0026\u0026 ./estafette-gke-node-pool-shifter --node-pool-from=default-pool --node-pool-to=preemptible-pool\n```\n\nNote: `KUBECONFIG=~/.kube/config` as environment variable can also be used if you don't want to use the `kubectl proxy`\ncommand.\n\nIf necessary, you can resize the node pool size:\n```\ngcloud container clusters resize $CLUSTER_NAME\n  --project=$PROJECT \\\n  --zone=$ZONE \\\n  --size=1 \\\n  --node-pool=default-pool\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festafette%2Festafette-gke-node-pool-shifter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festafette%2Festafette-gke-node-pool-shifter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festafette%2Festafette-gke-node-pool-shifter/lists"}