{"id":16248255,"url":"https://github.com/rmohr/kubernetes-custom-exec","last_synced_at":"2025-03-19T19:31:57.868Z","repository":{"id":70309668,"uuid":"91312986","full_name":"rmohr/kubernetes-custom-exec","owner":"rmohr","description":"Demo on how to write your own `kubectl exec` command with client-go","archived":false,"fork":false,"pushed_at":"2017-05-15T09:22:18.000Z","size":12391,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T10:12:23.135Z","etag":null,"topics":["client-go","exec","kubectl","kubernetes","websocket"],"latest_commit_sha":null,"homepage":null,"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/rmohr.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":"2017-05-15T08:24:06.000Z","updated_at":"2023-07-07T08:39:36.000Z","dependencies_parsed_at":"2023-02-25T03:00:23.399Z","dependency_job_id":null,"html_url":"https://github.com/rmohr/kubernetes-custom-exec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmohr%2Fkubernetes-custom-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmohr%2Fkubernetes-custom-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmohr%2Fkubernetes-custom-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmohr%2Fkubernetes-custom-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmohr","download_url":"https://codeload.github.com/rmohr/kubernetes-custom-exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244493111,"owners_count":20461609,"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":["client-go","exec","kubectl","kubernetes","websocket"],"created_at":"2024-10-10T14:41:00.447Z","updated_at":"2025-03-19T19:31:54.979Z","avatar_url":"https://github.com/rmohr.png","language":"Go","readme":"# Websocket with client-go example\n\nAt the moment [kubernetes/client-go](https://github.com/kubernetes/client-go) does not natively support websocket connections. However the SDK provides everything we need to wrap our own websocket connection handler with the necessary Kubernetes security context, to allow us to authenticate to the apiserver.\n\nThis demo shows, how to write your own `kubectl exec` in go with the Kubernetes SDK.\n\n\n## Building\n\n```bash\ngo get github.com/rmohr/kubernetes-custom-exec\ncd $GOPATH/src/github.com/rmohr/kubernetes-custom-exec\ngo build\n```\n\n# Running\n\nTo execute the command `ls` on pod `virt-api`, in container `virt-api`, type\n\n```bash\n./kubernetes-custom-exec -kubeconfig ~/kubeconfig -pod virt-api -namespace default -command ls -container virt-api\nanaconda-post.log\nbin\ndev\netc\nhome\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\nthird_party\ntmp\nusr\nvar\nvirt-api\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmohr%2Fkubernetes-custom-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmohr%2Fkubernetes-custom-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmohr%2Fkubernetes-custom-exec/lists"}