{"id":13522991,"url":"https://github.com/jordanwilson230/kubectl-plugins","last_synced_at":"2025-04-01T00:30:33.013Z","repository":{"id":38865628,"uuid":"117155340","full_name":"jordanwilson230/kubectl-plugins","owner":"jordanwilson230","description":"A Collection of Plugins for kubectl Integration (exec as any user, context switching, etc).","archived":false,"fork":false,"pushed_at":"2024-06-27T06:00:21.000Z","size":154,"stargazers_count":610,"open_issues_count":15,"forks_count":62,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-02T06:14:36.065Z","etag":null,"topics":["automated-deployment","ci-cd","context-switching","deployment","devops","eks","exec","gke","google-cloud","kubectl","kubectl-plugins","kubernetes","namespace","namespaces","plugins","pod","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/jordanwilson230.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-11T21:24:18.000Z","updated_at":"2024-08-01T16:10:55.000Z","dependencies_parsed_at":"2022-08-30T02:10:50.350Z","dependency_job_id":null,"html_url":"https://github.com/jordanwilson230/kubectl-plugins","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanwilson230%2Fkubectl-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanwilson230%2Fkubectl-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanwilson230%2Fkubectl-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanwilson230%2Fkubectl-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordanwilson230","download_url":"https://codeload.github.com/jordanwilson230/kubectl-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688170,"owners_count":17023297,"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":["automated-deployment","ci-cd","context-switching","deployment","devops","eks","exec","gke","google-cloud","kubectl","kubectl-plugins","kubernetes","namespace","namespaces","plugins","pod","ssh"],"created_at":"2024-08-01T06:00:54.382Z","updated_at":"2024-11-02T07:31:03.651Z","avatar_url":"https://github.com/jordanwilson230.png","language":"Shell","funding_links":[],"categories":["API/CLI adaptors","kubectl Plugins","Shell","Plugins","CLI tools"],"sub_categories":["[Jenkins](#jenkins)","Collection of kubectl plugins"],"readme":"# kubectl-plugins\n[![CI Status](https://github.com/jordanwilson230/kubectl-plugins/workflows/CI/badge.svg)](https://github.com/jordanwilson230/kubectl-plugins/actions)\n\nA collection of plugins for kubectl integration (for Kubectl versions \u003e= 1.12.0)\n\n*A portion of these plugins are available on [krew](https://github.com/kubernetes-sigs/krew) as well.*\n\n###### Note\n- These plugins are for kubectl versions at or above 1.12.0 only. Check your version via ```kubectl version```\n- For versions below 1.12.0, use the 1.11.0 branch.\n- To upgrade your kubectl version via homebrew: ```brew upgrade kubectl```, or via gcloud: ```gcloud components update```\n- The kubectl-ip plugin requires jq ( brew/apt/yum install jq )\n- All coding was written to maintain compatibility across both BSD and GNU.\n- Requires Bash.\n\n## Install on Linux/Mac\n```bash\ngit clone https://github.com/jordanwilson230/kubectl-plugins.git\ncd kubectl-plugins\n./install-plugins.sh\nsource ~/.bash_profile\n```\n#### To Uninstall\n```\nrm -rf ~/.kube/plugins/jordanwilson230\nex '+g/jordanwilson230/d' -cwq ~/.bash_profile\n```\nRemove the ```image``` plugin:\n```\nex '+g/IMG_REGISTRY=/d' -cwq ~/.bash_profile\n```\nRemove the ```prompt``` plugin:\n```\nex '+g/function kubectl()/d' -cwq ~/.bash_profile\nex '+g/KUBECTL_\\(.*\\)_PROMPT/d' -cwq ~/.bash_profile\n```\n\n\n### kubectl ssh\n![kapssh](https://user-images.githubusercontent.com/22456127/46683069-4152c100-cbbd-11e8-9db5-9fb319bb320b.gif)\n- Like kubectl exec, but offers a --user flag to exec as root (or any other user)\n- 'ssh' is a misnomer (it works by mounting a docker socket as a volume), but it's easier to work with as a command.\n- You must be in the same namespace as the target pod or you can use ```-n namespace``` option to specify the namespace\n- Kudos to mikelorant for thinking of the docker socket! :)\n\nUsage:\n  ```kubectl ssh [OPTIONAL: -n \u003cnamespace\u003e] [OPTIONAL: -u \u003cuser\u003e] [OPTIONAL: -c \u003cContainer Name\u003e] [REQUIRED: \u003cPodName\u003e ] -- [command]```\n\nExample:\n  ```kubectl ssh -n default -u root -c prometheus prometheus-282sd0s2 -- bash```\n\nOption | Required | Description | Example\n------------- | ------------- | ------------- | -------------\n-h | N | Show usage | *`kubectl ssh -h`*\n-d | N | Enable debug mode. Print a trace of each commands |  *`kubectl ssh -d kafka-0`*\n-n | N | The namespace scope for this CLI request | *`kubectl ssh -n infra kafka-0`*\n-u | N | User to exec as. Defaults to root | *`kubectl ssh -u kafka kafka-0`*\n-c | N | Specify container within pod | *`kubectl ssh -c burrow-metrics kafka-0`*\n-- | N | Pass an optional command. Defaults to /bin/sh | *`kubectl ssh kafka -- ls /etc/burrow`*\n\n\n### kubectl switch\n![switch](https://user-images.githubusercontent.com/22456127/47271118-50cdf480-d543-11e8-8e27-84d8909548b6.gif)\n- View current namespace: *`kubectl switch`*\n- Switch namespace: *`kubectl switch preprod`*\n- Switch cluster: *`kubectl switch cluster staging`* (accepts fuzzy on the cluster name)\n- List and select from all available clusters: *`kubeclt switch cluster -l`*\n\nOption | Required | Description | Example\n------------- | ------------- | ------------- | -------------\n-l | N | List available clusters and prompts for selection. Can only be used when ```cluster``` is passed. | *`kubNctl switch cluster -l`*\n-h | N | Show usage | *`kubectl switch -h`*\n\n\n### kubectl prompt\n![prompt](https://user-images.githubusercontent.com/22456127/47271066-91793e00-d542-11e8-9a97-71f2457aef51.gif)\n- Displays a warning prompt when issuing commands in a flagged cluster or namespace\n- Commands that trigger the prompt include ```create, scale, delete, apply, etc.,```\n- Flag a namespace: ```kubectl prompt add -n production```\n- Flag a cluster: ```kubectl prompt add -c my-cluster```\n- List flagged environments: ```kubectl prompt list```\n- Clear flagged environments: ```kubectl prompt remove```\n- View description: ```kubectl prompt```\n\n\n### kubectl image\n![image](https://user-images.githubusercontent.com/22456127/53746358-02285380-3e6f-11e9-901f-abc1a824b6c7.gif)\n- Search for Docker images\n- If you have a Google Container Registry, run ```kubectl image -c``` to set it as the default for future searches.\n- If _not_ configured with ```-c```, searches will use Docker Hub by default.\n- Adding ```-p``` will search Docker Hub, regardless of any default.\n- Sorts Docker Hub images by number of stars.\n- Sorts GCR images by upload date.\n\nExample:\n```kubectl image kafka```\n\n### kubectl ip\n![kap_ip](https://user-images.githubusercontent.com/22456127/46684546-1c604d00-cbc1-11e8-8b8f-9e2684e42121.gif)\n- Outputs the node name, node IP, and Pod IP for a given resource. Search is performed against common labels (defaults to app, name, component)\n\nExample: `kubectl ip cassandra`\n\n\n\n### kubectl uptime\n![kap_uptime](https://user-images.githubusercontent.com/22456127/46684550-22eec480-cbc1-11e8-8770-9a61c28179f4.gif)\n- Displays total uptime for pods/statefulsets in the current namespace.\n\nExample: `kubectl uptime`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanwilson230%2Fkubectl-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordanwilson230%2Fkubectl-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanwilson230%2Fkubectl-plugins/lists"}