{"id":15632001,"url":"https://github.com/jaymzh/kubectl-daemons","last_synced_at":"2025-07-05T04:34:04.289Z","repository":{"id":225960349,"uuid":"766063625","full_name":"jaymzh/kubectl-daemons","owner":"jaymzh","description":"A kubectl plugin to make working with daemonsets easier","archived":false,"fork":false,"pushed_at":"2024-03-14T07:12:01.000Z","size":51,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T03:49:24.475Z","etag":null,"topics":["kubernetes","kubernetes-daemonset"],"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/jaymzh.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}},"created_at":"2024-03-02T08:30:57.000Z","updated_at":"2025-01-29T13:55:07.000Z","dependencies_parsed_at":"2024-03-14T08:29:21.223Z","dependency_job_id":"033f0a56-c0a9-4ce9-bf71-825c18e1f712","html_url":"https://github.com/jaymzh/kubectl-daemons","commit_stats":null,"previous_names":["jaymzh/kubectl-daemons"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fkubectl-daemons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fkubectl-daemons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fkubectl-daemons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaymzh%2Fkubectl-daemons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaymzh","download_url":"https://codeload.github.com/jaymzh/kubectl-daemons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251638761,"owners_count":21619663,"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":["kubernetes","kubernetes-daemonset"],"created_at":"2024-10-03T10:42:21.654Z","updated_at":"2025-04-30T03:49:30.341Z","avatar_url":"https://github.com/jaymzh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubectl-daemons\n\n[![Lint](https://github.com/jaymzh/kubectl-daemons/actions/workflows/lint.yml/badge.svg?branch=main\u0026event=push)](https://github.com/jaymzh/kubectl-daemons/actions/workflows/lint.yml)\n[![Build](https://github.com/jaymzh/kubectl-daemons/actions/workflows/build.yml/badge.svg?branch=main\u0026event=push)](https://github.com/jaymzh/kubectl-daemons/actions/workflows/build.yml)\n\n## Intro\n\nkubectl-daemons is a kubectl plugin to help with daemonset work. When running a\nkubernetes infrastructure, it is common to do lots of work with deamonsets, but\nthe tools are optimized for other workflows where node names aren't\nparticularly important.. With daemonsets, you often know a node and a DS you\ncare about, and this plugin lets you focus on that.\n\nPreviously you'd do things like:\n\n```shell\nkubectl get pods -o wide | grep \u003cdaemonset\u003e | grep \u003cnode\u003e\nkubectl describe pod \u003cpod_from_above\u003e\nkubectl delete pod \u003cpod_from_above\u003e\nkubectl get pods -o wide | grep \u003cdaemonset\u003e | grep \u003cnode\u003e\n...\n```\n\nOr maybe:\n\n```shell\nkubectl get pods --field-selector spec.nodeName=\u003cnode\u003e\nkubectl describe pod \u003cpod_from above\u003e\nkubectl delete pod \u003cpod_from above\u003e\nkubectl get pods ---field-selector spec.nodeName=\u003cnode\u003e\n...\n```\n\nNo more using a long `get` command to find the pod name,\nand having to keep track of it! Just specify the DS and\nthe node:\n\n```shell\nkubectl d describe \u003cdaemonset\u003e -N \u003cnode\u003e\nkubectl d delete \u003cdaemonset\u003e -N \u003cnode\u003e\nkubectl d logs \u003cdaemonset\u003e -N \u003cnode\u003e\n```\n\n## General Usage\n\nGet pods from a daemonset:\n\n```bash\nkubectl d get \u003cdaemonset\u003e\n```\n\nOr get the pod from a daemonset on a specific node\n\n```bash\nkubectl d get \u003cdaemonset\u003e -N \u003cnode\u003e\n```\n\nOr get all daemonset-related pods on a node.  I think of this as the equivalent\nof asking systemd to list all services on a node. :)\n\n```bash\nkubectl d get -N \u003cnodename\u003e\n```\n\nOr you can delete the pod from a daemonset on a specific node\n\n```bash\nkubectl d delete \u003cdaemonset\u003e -N \u003cnodename\u003e\n```\n\nYou can do logs as well:\n\n```bash\nkubectl d logs \u003cdaemonset\u003e -N \u003cnode\u003e\n```\n\nNOTE: -N is required here.\n\nYou can describe pods:\n\n```bash\nkubectl d describe \u003cdaemonset\u003e [-N \u003cnode\u003e] # node optional\n```\n\nYou can even exec:\n\n```bash\nkubectl d exec \u003cdaemonset\u003e -N \u003cnode\u003e -- echo \"Hello world\"\n```\n\nOr interactively:\n\n```bash\nkubectl d exec \u003cdaemonset\u003e -N \u003cnode\u003e -it -- /bin/bash\n```\n\nAnd you can list all daemonsets on a node:\n\n```bash\nkubectl d list \u003cnode\u003e\n```\n\n## Installing\n\nThe easiest way to install, right now, is to grab the right build from our\n[releases](https://github.com/jaymzh/kubectl-daemons/releases) page, and drop\nthe binary (`kubectl-d`) in your PATH.\n\nIf you get an error like \"macOS cannot verify this app...\" see [this page](\nhttps://zaiste.net/os/macos/howtos/resolve-macos-cannot-be-opened-because-the-developer-cannot-be-verified-error/).\n\nIf you are a [Krew](https://krew.sigs.k8s.io/) user, we maintain our own index,\nwhich you can use to install `kubectl-daemons`:\n\n```shell\nkubectl krew index add jaymzh https://github.com/jaymzh/jaymzh-krew.git\nkubectl krew install kubectl-d\n```\n\n## Building from source\n\nThe quick-n-easy way to build is:\n\n```shell\ngo build -o kubectl-d\n```\n\nThen stick `kubectl-d` somewhere in your path.\n\n## Thanks\n\nA huge thanks to Benjamin Muschko's [Writing your first kubectl\nplugin](https://bmuschko.com/blog/writing-your-first-kubectl-plugin/) blog post\nand associated [GH repo](https://github.com/bmuschko/kubectl-server-version).\nThis was invaluable in getting me up and running.\n\n## FAQ\n\n**Why not just write a simple shell wrapper?**\n\nFor many reasons. First, I had that, and it's quite slow. You end up doing more\nqueries than you need, and if your API servers are on the other side of\nprivatelinks, it can get quite slow.\n\nSecond, I wanted a good excuse to learn some golang and get better at Kube\ninternals.\n\n**Aren't there already other plugins that do this?**\n\nNot that I could find!\n\n**Can I contribute?**\n\nSure, send a pull request!\n\n**Why did you end up re-implementing so much kubectl formatting code?**\n\nTrust me, I didn't want to. Unfortunately kubectl plugins aren't really\n\"plugins\". They're standalone binaries that `kubectl` executes for you. So you\ncan use whatever is in the k8s libraries, but various things kubectl does like\nformatting `describe` output, or various calculated fields, are note exposed as\nfunctions other code can call.\n\nIdeally, plugins would be a library that could hook into various stages within\nkubectl and allow you to not have to implement so much yourself, but it turns\nout that's not how kubectl plugins work.\n\n**Why do you maintain your own Krew index?**\n\nKrew\n[felt](https://github.com/kubernetes-sigs/krew-index/pull/3679#issuecomment-1987113765)\nthis plugin wasn't sufficiently different from what you could do with `kubectl`\noptions and as such did not accept it.\n\nHowever, a custom krew index is a simple [git\nrepository](https://github.com/jaymzh/jaymzh-krew), so maintaining our own\nisn't an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymzh%2Fkubectl-daemons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaymzh%2Fkubectl-daemons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymzh%2Fkubectl-daemons/lists"}