{"id":34691625,"url":"https://github.com/cloudresty/kubectl","last_synced_at":"2026-04-21T11:39:23.453Z","repository":{"id":209362423,"uuid":"723667957","full_name":"cloudresty/kubectl","owner":"cloudresty","description":"KubeCTL it's a lightweight Docker image containing 'kubectl' utility that can be used locally or remotely being as a Docker container or as a Kubernetes pod.","archived":false,"fork":false,"pushed_at":"2025-05-23T07:55:07.000Z","size":31,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T10:15:22.798Z","etag":null,"topics":["kubectl","kubernetes"],"latest_commit_sha":null,"homepage":"https://cloudresty.com","language":"Shell","has_issues":false,"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/cloudresty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-26T12:05:38.000Z","updated_at":"2025-07-04T23:25:22.000Z","dependencies_parsed_at":"2025-12-24T22:00:05.214Z","dependency_job_id":null,"html_url":"https://github.com/cloudresty/kubectl","commit_stats":null,"previous_names":["cloudresty/kubectl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cloudresty/kubectl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudresty%2Fkubectl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudresty%2Fkubectl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudresty%2Fkubectl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudresty%2Fkubectl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudresty","download_url":"https://codeload.github.com/cloudresty/kubectl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudresty%2Fkubectl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32090799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["kubectl","kubernetes"],"created_at":"2025-12-24T21:59:59.852Z","updated_at":"2026-04-21T11:39:23.423Z","avatar_url":"https://github.com/cloudresty.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeCTL\n\n**KubeCTL** is a Debian-based Docker image from [Cloudresty](https://cloudresty.com) that contains the [Kubernetes](https://kubernetes.io) command line tool [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/). This image is intended to be used for interacting with Kubernetes clusters being from a local or remote docker host, or from within a Kubernetes cluster itself.\n\n\u0026nbsp;\n\n## Docker Usage\n\nBelow are some examples of how to use KubeCTL as a Docker container. In this example, the container will be started with a shell prompt and the credentials for a Kubernetes cluster will have to be provided manually by passing them to `~/.kube/config` within the container.\n\n\u0026nbsp;\n\n### Simple Docker Usage\n\n```bash\ndocker run \\\n    --interactive \\\n    --tty \\\n    --rm \\\n    --name kubectl \\\n    --hostname kubectl \\\n    cloudresty/kubectl:latest zsh\n```\n\n\u0026nbsp;\n\nKubeCTL as a Docker container can also be used to interact with a Kubernetes cluster from a remote or local docker host. In this example, the container will be started with a shell prompt and the credentials for a Kubernetes cluster will be provided by mounting the `~/.kube` directory from the remote or local docker host to the container.\n\n\u0026nbsp;\n\n### Docker Usage with mounted ~/.kube directory\n\n```bash\ndocker run \\\n    --interactive \\\n    --tty \\\n    --rm \\\n    --name kubectl \\\n    --hostname kubectl \\\n    --volume ~/.kube:/root/.kube \\\n    cloudresty/kubectl:latest zsh\n```\n\n\u0026nbsp;\n\nIf you have multiple Kubernetes clusters, make sure you have the correct context selected before running any commands.\n\n\u0026nbsp;\n\n## Kubernetes Usage\n\nKubeCTL can be used as a shell pod within a Kubernetes cluster. In this example, the pod will be started with a shell prompt and the access to the Kubernetes cluster will be provided by a service account. In this example, the service account will be created in the `cloudresty-system` namespace and will be given cluster-admin privileges. The service account will be named `ksa-kubectl`.\n\nFor security reasons, it is recommended to create a new namespace for the service account and to give the service account only the privileges it needs to perform its intended tasks.\n\nThis approach is useful for when you need to run KubeCTL commands from within a Kubernetes cluster itself. For example, you may want to run KubeCTL scheduled commands from within a Kubernetes cluster to perform tasks such as creating new namespaces, creating new service accounts, creating new roles, creating new role bindings, CronJobs, HPAs, deployment roll-outs, etc. that are non-standard and cannot be performed using the standard Kubernetes resources.\n\n\u0026nbsp;\n\n### Kubernetes Pod Usage with Service Account\n\n```yaml\n#\n# KubeCTL Namespace\n#\n\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: cloudresty-system\n\n---\n\n#\n# KubeCTL Service Account\n#\n\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: ksa-kubectl\n  namespace: cloudresty-system\n\n---\n\n#\n# KubeCTL Cluster Role Binding\n#\n\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: ksa-kubectl\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: cluster-admin\nsubjects:\n  - kind: ServiceAccount\n    name: ksa-kubectl\n    namespace: cloudresty-system\n```\n\n```bash\nkubectl run \\\n    --namespace cloudresty-system \\\n        kubectl \\\n        --stdin \\\n        --tty \\\n        --rm \\\n        --restart Never \\\n        --image cloudresty/kubectl:latest \\\n        --image-pull-policy Always \\\n        --override-type strategic \\\n        --overrides '{ \"apiVersion\": \"v1\", \"spec\": {\"serviceAccountName\":\"ksa-kubectl\" }}' \\\n        --command -- zsh\n```\n\n\u0026nbsp;\n\n### Kubernetes CronJob Usage with Service Account\n\n```yaml\n#\n# KubeCTL Namespace\n#\n\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: cloudresty-system\n\n---\n\n#\n# KubeCTL Service Account\n#\n\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: ksa-kubectl\n  namespace: cloudresty-system\n\n---\n\n#\n# KubeCTL Cluster Role Binding\n#\n\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: ksa-kubectl\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: cluster-admin\nsubjects:\n  - kind: ServiceAccount\n    name: ksa-kubectl\n    namespace: cloudresty-system\n\n---\n\n#\n# KubeCTL CronJob\n#\n\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: kubectl\n  namespace: cloudresty-system\nspec:\n  schedule: \"*/5 * * * *\"\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          serviceAccountName: ksa-kubectl\n          containers:\n            - name: kubectl\n              image: cloudresty/kubectl:latest\n              imagePullPolicy: Always\n              command:\n                - zsh\n              args:\n                - -c\n                - |\n                  kubectl get pods --all-namespaces\n          restartPolicy: OnFailure\n```\n\n\u0026nbsp;\n\n---\nCopyright \u0026copy; [Cloudresty](https://cloudresty.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudresty%2Fkubectl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudresty%2Fkubectl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudresty%2Fkubectl/lists"}