{"id":19456875,"url":"https://github.com/porter-dev/porter-node-drainer","last_synced_at":"2026-05-16T19:31:53.885Z","repository":{"id":51738917,"uuid":"520597591","full_name":"porter-dev/porter-node-drainer","owner":"porter-dev","description":"Simple node drainer for EKS self-managed nodes.","archived":false,"fork":false,"pushed_at":"2023-08-15T08:44:23.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T16:56:52.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/porter-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-02T17:52:41.000Z","updated_at":"2023-10-20T22:37:29.000Z","dependencies_parsed_at":"2024-06-21T15:27:00.107Z","dependency_job_id":null,"html_url":"https://github.com/porter-dev/porter-node-drainer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porter-dev%2Fporter-node-drainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porter-dev%2Fporter-node-drainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porter-dev%2Fporter-node-drainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porter-dev%2Fporter-node-drainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/porter-dev","download_url":"https://codeload.github.com/porter-dev/porter-node-drainer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240654161,"owners_count":19835856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T17:18:50.148Z","updated_at":"2026-05-16T19:31:48.854Z","avatar_url":"https://github.com/porter-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Porter Node Drainer\n\nThis repository contains source code for performing a node drain for self-managed EKS nodes.\n\n**How does it work?**\n\nThe script is meant to run as a Lambda function which gets triggered on an ASG instance termination event. The script performs the following actions:\n\n1. Performs a read on the relevant EC2 instance being terminated to discover the EC2 internal hostname.\n2. Lists nodes on the EKS cluster and matches the above hostname on the `kubernetes.io/hostname` label.\n3. Cordons the node to prevent new workloads from being scheduled on that node.\n4. Evicts any non-daemonset pods running on the node.\n5. Calls the ASG Complete Lifecycle action to allow ASG termination to proceed.\n\n**Required environment variables:**\n\n```\nEKS_AWS_ACCESS_KEY_ID\nEKS_AWS_SECRET_ACCESS_KEY\nEKS_AWS_REGION\nEKS_AWS_CLUSTER_ID\nEKS_CLUSTER_SERVER\nEKS_CA_DATA\n```\n\n### Project Goals\n\nWhile this project currently contains a very simple drain script, the goal is eventually to be able to customize the drain behavior on the node and to notify the Porter server that a node is being cycled out.\n\n### Similar Projects\n\n- https://github.com/aws-samples/amazon-k8s-node-drainer\n- https://github.com/ryan-a-baker/eks-node-drainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporter-dev%2Fporter-node-drainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fporter-dev%2Fporter-node-drainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporter-dev%2Fporter-node-drainer/lists"}