{"id":20465805,"url":"https://github.com/enrise/kubetoolbox","last_synced_at":"2025-09-03T02:19:28.532Z","repository":{"id":36952100,"uuid":"193138024","full_name":"Enrise/KubeToolbox","owner":"Enrise","description":"Kubernetes toolbox container for deploying to Kubernetes etc. Optimized to run in CI.","archived":false,"fork":false,"pushed_at":"2023-10-18T22:04:15.000Z","size":55,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T00:22:43.480Z","etag":null,"topics":["aws","aws-cli","ci","deployment","eks","gcloud","gke","hacktoberfest","hacktoberfest2023","helm","kubectl"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Enrise.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-06-21T17:39:28.000Z","updated_at":"2024-12-13T17:49:01.000Z","dependencies_parsed_at":"2024-11-15T13:30:07.588Z","dependency_job_id":null,"html_url":"https://github.com/Enrise/KubeToolbox","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/Enrise%2FKubeToolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enrise%2FKubeToolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enrise%2FKubeToolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enrise%2FKubeToolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enrise","download_url":"https://codeload.github.com/Enrise/KubeToolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248687740,"owners_count":21145760,"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":["aws","aws-cli","ci","deployment","eks","gcloud","gke","hacktoberfest","hacktoberfest2023","helm","kubectl"],"created_at":"2024-11-15T13:19:55.902Z","updated_at":"2025-04-13T08:44:06.478Z","avatar_url":"https://github.com/Enrise.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeToolbox\n\nThis container makes it super easy for you to connect to kubernetes and apply the manifests you desire.\n\nWe have kube-toolboxes for:\n\n- [Amazon Web Services](https://aws.amazon.com/) (see [Amazon](#amazon))\n- [Microsoft Azure](https://azure.microsoft.com/) (see [Azure](#azure))\n- [Digital Ocean](https://www.digitalocean.com/products/kubernetes/) (see [Digital Ocean](#digital-ocean))\n- [Google Cloud Platform](https://cloud.google.com/) (see [Google Cloud](#google-cloud))\n\nEvery kube-toolbox contains:\n\n- `bash`: the commonly used command line interface that's more advanced than `sh` itself\n- `connect-kubernetes`: Check below how this command should be used for your cloud provider\n- `curl`: Allows you to easily fire http requests\n- `docker`: The docker client and server\n- `envsubst '${ENV_VAR_1} ${ENV_VAR_2}' \u003c dev/kube/production.yml \u003e production.yml`: Replaces given environment\n  variables in a file, into a new file\n- `helm`: [Helm kubernetes recipes](https://github.com/helm/helm)\n- `jq`: Tool to format json strings\n- `kubectl`: Kubernetes command line interface\n\n# Cloud providers\n\nFor every cloud provider we have an example of how to connect to your kubernetes cluster via a GitLab CI file.\n\n## Amazon\n\nThe kube-toolbox for Azure is available with docker tag `enrise/kube-toolbox:amazon`.\n\nThe following additional packages are available:\n\n- `aws`: this cli allows you to connect and interact with your AWS account.\n- `connect-kubernetes \"\u003caws_access_key_id\u003e\" \"\u003caws_secret_access_key\u003e\" \"\u003cregion\u003e\" \"\u003ccluster_name\u003e\"`:\n  connects you with your Kubernetes cluster on AWS directly\n\n```yml\ndeploy to amazon web services:\n  stage: deploy\n  image: enrise/kube-toolbox:amazon\n  environment:\n    name: production\n    url: https://example.com\n  only:\n    - master\n  before_script:\n    - connect-kubernetes \"\u003caws_access_key_id\u003e\" \"\u003caws_secret_access_key\u003e\" \"\u003cregion\u003e\" \"\u003ccluster_name\u003e\"\n  script:\n    - envsubst \u003c kubernetes/manifest.yml \u003e manifest.yml\n    - kubectl apply -f manifest.yml\n    - kubectl rollout status deployment -n \"\u003cnamespace\u003e\" \"\u003cdeployment-name\u003e\"\n```\n\n## Azure\n\nThe kube-toolbox for Azure is available with docker tag `enrise/kube-toolbox:azure`.\n\nThe following additional packages are available:\n\n- `az`: this cli allows you to connect and interact with your Azure account.\n- `connect-kubernetes \"\u003cazure_account_username\u003e\" \u003cazure_account_password\u003e\" \"\u003cresource_group\u003e\" \"\u003ccluster_name\u003e\"`:\n  connects you with your Kubernetes cluster on Azure directly\n\n```yml\ndeploy to azure:\n  stage: deploy\n  image: enrise/kube-toolbox:azure\n  environment:\n    name: production\n    url: https://example.com\n  only:\n    - master\n  before_script:\n    - connect-kubernetes \"\u003cazure_account_username\u003e\" \u003cazure_account_password\u003e\" \"\u003cresource_group\u003e\" \"\u003ccluster_name\u003e\"\n  script:\n    - envsubst \u003c kubernetes/manifest.yml \u003e manifest.yml\n    - kubectl apply -f manifest.yml\n    - kubectl rollout status deployment -n \"\u003cnamespace\u003e\" \"\u003cdeployment-name\u003e\"\n```\n\n## Digital Ocean\n\nThe kube-toolbox for Digital Ocean is available with docker tag `enrise/kube-toolbox:digital-ocean`.\n\nThe following additional packages are available:\n\n- `doctl`: this cli allows you to connect and interact with your Digital Ocean account.\n- `connect-kubernetes \"\u003capi_personal_access_token\u003e\" \"\u003ccluster_name\u003e\"`: connects you with your\n  Kubernetes cluster on Digital Ocean directly\n\n```yml\ndeploy to digital ocean kubernetes:\n  stage: deploy\n  image: enrise/kube-toolbox:digital-ocean\n  environment:\n    name: production\n    url: https://example.com\n  only:\n    - master\n  before_script:\n    - connect-kubernetes \"\u003capi_personal_access_token\u003e\" \"\u003ccluster_name\u003e\"\n  script:\n    - envsubst \u003c kubernetes/manifest.yml \u003e manifest.yml\n    - kubectl apply -f manifest.yml\n    - kubectl rollout status deployment -n \"\u003cnamespace\u003e\" \"\u003cdeployment-name\u003e\"\n```\n\n## Google Cloud\n\nThe kube-toolbox for Google Cloud is available with docker tag `enrise/kube-toolbox:google`.\n\nThe following additional packages are available:\n\n- `gcloud`: this cli allows you to connect and interact with your Google Cloud account.\n- `connect-kubernetes \"\u003cservice_account_file\u003e\" \u003cregion\u003e\" \"\u003cproject\u003e\" \"\u003ccluster_name\u003e\"`: connects you with your\n  Kubernetes cluster on the Google Cloud directly\n\n```yml\ndeploy to google cloud platform:\n  stage: deploy\n  image: enrise/kube-toolbox:google\n  environment:\n    name: production\n    url: https://example.com\n  only:\n    - master\n  before_script:\n    - connect-kubernetes $SERVICE_ACCOUNT_KEY_FILE \"\u003cregion\u003e\" \"\u003cproject\u003e\" \"\u003ccluster_name\u003e\"\n  script:\n    - envsubst \u003c kubernetes/manifest.yml \u003e manifest.yml\n    - kubectl apply -f manifest.yml\n    - kubectl rollout status deployment -n \"\u003cnamespace\u003e\" \"\u003cdeployment-name\u003e\"\n```\n\nMake sure the `$SERVICE_ACCOUNT_KEY_FILE` is a path to the service account json file, containing all\nsecrets to properly connect to your account. In GitLab project settings you can configure a secret variable\nto be served as a file directly.\n\nIf you only have the contents of the file available, create the\nkey file manually first as follows:\n\n```yaml\n  before_script:\n    - echo $SERVICE_ACCOUNT_JSON_KEY \u003e /tmp/.gcloud_private_key\n    - connect-kubernetes /tmp/.gcloud_private_key \"\u003cregion\u003e\" \"\u003cproject\u003e\" \"\u003ccluster_name\u003e\"\n```\n\n# Tips\n\nSome tips that might be helpful to you\n\n## Recursive envsubst\n\nWith the following magic line, you can replace all environment variables in the `*.yml` files, recursively:\n\n```shell\nfind . -iname \\*.yml -type f -exec sh -c 'envsubst \u003c $0 \u003e $0.tmp \u0026\u0026 mv $0.tmp $0' {} \\;\n```\n\nAnother trick to make it more readable in your CI file:\n\n```yaml\n.replace-environment-variables-recursively: \u0026replace-environment-variables-recursively |\n    find . -iname \\*.yml -type f -exec sh -c 'envsubst \u003c $0 \u003e $0.tmp \u0026\u0026 mv $0.tmp $0' {} \\;\n\ndeploy to kubernetes:\n  script:\n    - cd kubernetes/\n    - *replace-environment-variables-recursively\n    - kubectl apply -f manifest.yml\n    - kubectl rollout status deployment -n \"\u003cnamespace\u003e\" \"\u003cdeployment-name\u003e\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenrise%2Fkubetoolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenrise%2Fkubetoolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenrise%2Fkubetoolbox/lists"}