{"id":17675762,"url":"https://github.com/dbz/kube-aliases","last_synced_at":"2026-02-16T17:33:54.065Z","repository":{"id":43510396,"uuid":"84480344","full_name":"Dbz/kube-aliases","owner":"Dbz","description":"Kubernetes Aliases and Bash Functions","archived":false,"fork":false,"pushed_at":"2023-12-09T06:13:31.000Z","size":9518,"stargazers_count":109,"open_issues_count":9,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-21T13:50:43.976Z","etag":null,"topics":["autocomplete","bash","cluster","command-line-tool","devops","k8s","kubectl","kubernetes","kubernetes-commands","kubernetes-metrics-server","metrics","namespace","namespace-switching","oh-my-zsh","oh-my-zsh-plugin","shell","switching-contexts","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Dbz.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-03-09T19:27:31.000Z","updated_at":"2024-04-26T10:17:04.000Z","dependencies_parsed_at":"2024-01-03T04:17:26.993Z","dependency_job_id":"9fa877c7-666d-4c6a-9b7b-1c992feae58d","html_url":"https://github.com/Dbz/kube-aliases","commit_stats":null,"previous_names":["dbz/zsh-kubernetes"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbz%2Fkube-aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbz%2Fkube-aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbz%2Fkube-aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbz%2Fkube-aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dbz","download_url":"https://codeload.github.com/Dbz/kube-aliases/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222515758,"owners_count":16996250,"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":["autocomplete","bash","cluster","command-line-tool","devops","k8s","kubectl","kubernetes","kubernetes-commands","kubernetes-metrics-server","metrics","namespace","namespace-switching","oh-my-zsh","oh-my-zsh-plugin","shell","switching-contexts","zsh","zsh-plugin"],"created_at":"2024-10-24T07:23:25.250Z","updated_at":"2026-02-16T17:33:54.021Z","avatar_url":"https://github.com/Dbz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kube-aliases\n\nThis is an oh-my-zsh plugin (or source `kube-aliases.plugin.zsh` for bash) to\nmake working with kubernetes easier. It provides a bunch of bash aliases and\nzsh functions. Docs can be found\n[here](https://github.com/Dbz/kube-aliases/blob/master/docs/usage), which\nclarifies all aliases.\n\n## Usage\n\nThere are a few main features of this plugin. First, there are lots of aliases\nto make working with Kubernetes easier. Second, there are bash functions to\nhelp with varies tasks such as switching contexts to use different clusters.\n\n### Aliases\n\nTo see a full list of aliases, use\n\n```bash\nkhelp usage\n```\n\nIn general and when it makes sense, aliases follow the following conventions.\n\n```bash\nk           # kubectl\nkd\u003cr\u003e       # kubectl delete \u003cresource\u003e, e.g. kdp for kubectl delete pods\nkds\u003cr\u003e      # kubectl describe \u003cresource\u003e, e.g. kdsp for kubectl describe pod\nke\u003cr\u003e       # kubectl edit \u003cresource\u003e, e.g. kep for kubectl edit pods\nkg\u003cr\u003e       # kubectl get \u003cresource\u003e, e.g. kgp for kubectl get pods\nkga\u003cr\u003e      # kubectl get --all-namespaces -o wide \u003cresource\u003e, e.g. kgap for kubectl --all-namespaces -o wide get pods\nkl          # kubectl logs \u003cpodname\u003e\nklf         # kubectl logs -f \u003cpodname\u003e: i.e. watch logs live\n```\n\nThere is also some other useful commands such as the following:\n\n```bash\nkcon       # create configuration files\nkdap       # delete all pods within a namespace\nkdrain     # drain a node\nkexec      # execute a command in a specified pod,\n           # default drops user into a shell\nkfind      # use a regular expression to find items across everything except\n           # custom resources\nkgpns      # Get just pod names in a namespace\nkpfind     # Search through pods with regular expressions\nkrd        # restart a deployment\nkstatus    # search across namespaces to find pods statuses\n```\n\nFor a more detailed list of aliases, view the [docs](https://github.com/Dbz/kube-aliases/blob/master/docs/usage).\n\nNot everything is currently implemented, but more and more is being added to\nthe list. If something is missing that is desired, feel free to submit a pull\nrequest.\n\n\n## Installation\n\n### Oh-My-Zsh\n\n```\ngit clone https://github.com/Dbz/kube-aliases.git ~/.oh-my-zsh/custom/plugins/kube-aliases\necho \"plugins+=(kube-aliases)\" \u003e\u003e ~/.zshrc\n```\n\nYou can also manually place `kube-aliases` inside of `plugins=(...)`\n\nIf you have set the `ZSH_CUSTOM` environment variable in your zshrc, then you should modify the git clone directory to be `$ZSH_CUSTOM/plugins/kube-aliases`.\n\n### Antigen\n\nAdd `antigen bundle dbz/kube-aliases` to your antigen bundles in your `.zshrc`\n\n### Zgen\n\nAdd `zgen load dbz/kube-aliases` to your zgen plugins in your `.zshrc`\n\n### Zinit\n\nAdd `zinit load Dbz/kube-aliases` to your zinit plugins in your `.zshrc`\n\n### Bash\n\nSource `kube-aliases.plugin.zsh` in your `.bashrc`.\n\n### Aliases for Kubernetes Extensions\n\n#### kubectx\nFor easy context and namespace switching there is\n[kubectx](https://github.com/ahmetb/kubectx). `kubectx` allows users context\nswitching, and the linked github comes with `kubens` which allows for simple\nnamespace switching. You can use the following aliases:\n\n```bash\nalias kctx='kubectx'\nalias kns='kubens'\n```\n#### Kubernetes Metrics Server\n\nTo get some metrics from nodes or pods, you can use [Kubernetes Metrics\nServer](https://github.com/kubernetes-incubator/metrics-server). There are \nthe aliases\n\n```bash\nalias kt='kubectl top'\nalias ktn='kubectl top nodes'\nalias ktp='kubectl top pods'\n```\n\n### Trouble Shooting\n\n#### Autocomplete\n\nIf there is problems with autocomplete, it may be that kubectl is not on the\npath when the plugin is loaded. To fix, load plugins after adding kubectl to\npath.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbz%2Fkube-aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbz%2Fkube-aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbz%2Fkube-aliases/lists"}