{"id":16844970,"url":"https://github.com/phenixblue/kubectl-azs","last_synced_at":"2026-05-18T18:36:36.477Z","repository":{"id":78646888,"uuid":"173660575","full_name":"phenixblue/kubectl-azs","owner":"phenixblue","description":"Kubectl plugin for listing Kubernetes objects by Availability Zone","archived":false,"fork":false,"pushed_at":"2021-08-06T22:46:43.000Z","size":139,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T13:13:16.537Z","etag":null,"topics":["availability","az","domains","failure","kubectl","kubernetes","plugin","zones"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phenixblue.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-04T02:35:32.000Z","updated_at":"2024-06-14T20:00:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfa08ce2-78e0-4b05-b75b-74772c768e78","html_url":"https://github.com/phenixblue/kubectl-azs","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenixblue%2Fkubectl-azs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenixblue%2Fkubectl-azs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenixblue%2Fkubectl-azs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenixblue%2Fkubectl-azs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenixblue","download_url":"https://codeload.github.com/phenixblue/kubectl-azs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244167573,"owners_count":20409338,"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":["availability","az","domains","failure","kubectl","kubernetes","plugin","zones"],"created_at":"2024-10-13T12:57:14.311Z","updated_at":"2026-05-18T18:36:31.449Z","avatar_url":"https://github.com/phenixblue.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azs Kubernetes CLI\n\nThe `azs` CLI is a utlity that can be used as a standalone binary or as a `kubectl` plugin to list Kubernetes objects by failure domain (commonly referred to as an Availability Zone). This utility requires a valid kubeconfig context and a given label on the cluster nodes to delineate the failure domain(s), and RBAC permissions to list Node resources. By default the `failure-domain.kubernetes.io/zone` and `failure-domain.beta.kubernetes.io/zone` labels are used. \n\nThis was an opportunity for me to start working with golang and is meant to be a simple example for building a kubectl plugin.\n\nThe utility is written in [go](https://golang.org) and uses the [cobra](https://github.com/spf13/cobra), and [goreleaser](https://goreleaser.com) projects.\n\n## Usage (Standalone)\n\n```\nThe \"azs\" utility is a tool to list Kubernetes objects by Availability Zone. The utility can\nbe used standalone or as a \"kubectl\" plugin\n\nUsage:\n  azs [flags]\n  azs [command]\n\nAvailable Commands:\n  help        Help about any command\n  nodes       List Kubernetes nodes by AZ\n  pods        List Kubernetes pods by AZ\n  version     Prints the version of the \"azs\" utility\n\nFlags:\n      --context string      The name of the kubeconfig context to use\n  -h, --help                help for azs\n      --kubeconfig string   Kubernetes configuration file\n  -l, --label string        The target label that defines the Availability Zone on nodes. The default value also includes\n                            the beta version of the same label (default \"failure-domain.kubernetes.io/zone\")\n  -n, --namespace string    The Namespace to use when listing Pods\n\nUse \"azs [command] --help\" for more information about a command.\n```\n\n### Use as a kubectl plugin\n\nCopy binary into your path\n\n```bash\n$ cp ./azs /usr/local/bin/kubectl-azs\n```\n\n### List Availability Zones using default label\n\n```bash\n$ kubectl azs                                                          \nAZ\n0\n1\n2\n```\n\n### List Nodes and show Availability Zones using default label\n\n```bash\n$ kubectl azs nodes                                                        \nNODE NAME                           AZ\naks-agentpool-94661123-vmss000000   0\naks-agentpool-94661123-vmss000001   1\naks-agentpool-94661123-vmss000002   2\n```\n\n### List Nodes and show Availability Zones using custom label\n\n```bash\n$ kubectl azs nodes -l example.io/custom-az-label\nNODE NAME                           AZ\naks-agentpool-94661123-vmss000000   az1\naks-agentpool-94661123-vmss000001   az2\naks-agentpool-94661123-vmss000002   az3\n```\n\n### List Pods and show Availability Zones using default label\n\n```bash\n$ kubectl azs pods                                                        \nNAME                                        NAMESPACE     NODE                                AZ\nnginx                                       default       aks-agentpool-94661123-vmss000000   0\ncoredns-544d979687-dzsnh                    kube-system   aks-agentpool-94661123-vmss000000   0\ncoredns-544d979687-w4z55                    kube-system   aks-agentpool-94661123-vmss000002   2\ncoredns-autoscaler-6b69c49744-r4qd8         kube-system   aks-agentpool-94661123-vmss000002   2\ndashboard-metrics-scraper-867cf6588-2pcmh   kube-system   aks-agentpool-94661123-vmss000002   2\nkube-proxy-5fkl6                            kube-system   aks-agentpool-94661123-vmss000000   0\nkube-proxy-jbdp6                            kube-system   aks-agentpool-94661123-vmss000002   2\nkube-proxy-tm7cx                            kube-system   aks-agentpool-94661123-vmss000001   1\nkubernetes-dashboard-7f7676f7b5-sz6dt       kube-system   aks-agentpool-94661123-vmss000002   2\nmetrics-server-6df44d5569-5czfg             kube-system   aks-agentpool-94661123-vmss000002   2\nomsagent-4fjxj                              kube-system   aks-agentpool-94661123-vmss000000   0\nomsagent-jm87x                              kube-system   aks-agentpool-94661123-vmss000001   1\nomsagent-qbhz9                              kube-system   aks-agentpool-94661123-vmss000002   2\nomsagent-rs-7bf46448f4-5z2v5                kube-system   aks-agentpool-94661123-vmss000001   1\ntunnelfront-6446d9d9cc-fdrnv                kube-system   aks-agentpool-94661123-vmss000002   2\n```\n\n### List Pods in a specific namespace and show Availability Zones using default label\n\n```bash\n$ kubectl azs pods -n default                                   \nNAME                                        NAMESPACE     NODE                                AZ\nnginx                                       default       aks-agentpool-94661123-vmss000000   0\n```\n\n## Developers\n\n### Build a new release\n\n- Setup GitHub Personal Access Token\n\n    ```bash\n    $ export GITHUB_TOKEN=\"XXXXXXXXXXXXXXXXXXXXXXXXXX\"\n    ```\n\n- Edit the version in `main.go`\n\n- Tag new version and push\n\n    ```bash\n    $ git tag -a v0.0.1 -m \"First release\"\n    $ git push origin v0.0.1\n    ```\n\n- Build new binaries\n\n    ```bash\n    $ goreleaser --rm-dist\n    ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenixblue%2Fkubectl-azs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenixblue%2Fkubectl-azs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenixblue%2Fkubectl-azs/lists"}