{"id":23872005,"url":"https://github.com/devgine/gke-utils","last_synced_at":"2025-06-25T02:08:51.162Z","repository":{"id":164629705,"uuid":"639361281","full_name":"devgine/gke-utils","owner":"devgine","description":"Docker image based on official alpine image and google cloud sdk and necessary tools to manage a kubernetes cluster hosted in GKE (google kubernetes engine). Available tools (gcloud, kubectl, helm, kustomize and kubeseal)","archived":false,"fork":false,"pushed_at":"2023-05-31T08:38:16.000Z","size":15,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T02:08:50.772Z","etag":null,"topics":["cloud","gcloud","gcp","gke","gke-cluster","google-cloud","google-cloud-platform","helm","kubectl","kubernetes","kubernetes-cluster","kubeseal","kustomize"],"latest_commit_sha":null,"homepage":"https://github.com/devgine/gke-utils/pkgs/container/gke-utils/versions","language":"Dockerfile","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/devgine.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,"zenodo":null}},"created_at":"2023-05-11T10:09:19.000Z","updated_at":"2024-04-08T17:01:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9c9d1a2-a83e-4aae-8368-814c38e72886","html_url":"https://github.com/devgine/gke-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devgine/gke-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fgke-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fgke-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fgke-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fgke-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgine","download_url":"https://codeload.github.com/devgine/gke-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fgke-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261789287,"owners_count":23209776,"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":["cloud","gcloud","gcp","gke","gke-cluster","google-cloud","google-cloud-platform","helm","kubectl","kubernetes","kubernetes-cluster","kubeseal","kustomize"],"created_at":"2025-01-03T15:17:55.105Z","updated_at":"2025-06-25T02:08:51.140Z","avatar_url":"https://github.com/devgine.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GKE Utilities\n[![Build](https://github.com/devgine/gke-utils/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/devgine/gke-utils/actions/workflows/build.yaml)\n[![GitHub](https://img.shields.io/github/license/devgine/gke-utils)](https://github.com/devgine/gke-utils/blob/main/LICENSE)\n![GitHub top language](https://img.shields.io/github/languages/top/devgine/gke-utils)\n[![Packages retention policy](https://github.com/devgine/gke-utils/actions/workflows/packages-retention-policy.yaml/badge.svg?branch=main)](https://github.com/devgine/gke-utils/actions/workflows/packages-retention-policy.yaml)\n\n## About\nThis is a docker image based on official alpine image and google cloud sdk and necessary tools to manage a kubernetes cluster hosted in GKE (google kubernetes engine).\u003cbr /\u003e\nAvailable tools in this image :\n* gcloud\n* gke-gcloud-auth-plugin\n* kubectl\n* helm\n* kustomize\n* kubeseal\n\n## Content\n\nBelow is the list of tools with their preinstalled version.\n\n| Image tag                                                   | Alpine | gcloud  | kubectl | helm | kustomize | kubeseal |\n|-------------------------------------------------------------|--------|---------|---------|------|-----------|----------|\n| `gke-utils:latest`\u003cbr/\u003e`gke-utils:432.0.0-k8s1.27.1-alpine` | 3.17   | 432.0.0 | 1.27    | 3.11 | 5.0       | 0.20     |\n| `gke-utils:432.0.0-k8s1.26.3-alpine`                        | 3.17   | 432.0.0 | 1.26    | 3.11 | 5.0       | 0.20     |\n| `gke-utils:432.0.0-k8s1.25.9-alpine`                        | 3.17   | 432.0.0 | 1.25    | 3.11 | 5.0       | 0.20     |\n| `gke-utils:432.0.0-k8s1.24.13-alpine`                       | 3.17   | 432.0.0 | 1.24    | 3.11 | 5.0       | 0.20     |\n\n\n## Requirements\n### Credentials\nTo connect to the cluster on GKE you must download the service account or the identity federation pool credentials.\nThe credentials file should be mounted to `/var/gcloud/credentials.json` in the container.\u003cbr\u003e\n\u003e More information about creating service account credentials [here](https://support.google.com/a/answer/7378726?hl=en)\n\n### Configuration\nYou need to do some configuration to connect to the correct cluster in GKE.\u003cbr\u003e\nThe configuration file should be mounted to `/var/gcloud/config.json` in the container.\n\nBellow is the content of the configuration file :\n```json\n{\n  \"project_id\": \"project-id-1234\",\n  \"gke\": {\n    \"cluster_name\": \"cluster-name\",\n    \"cluster_region\": \"europe-central2-a\"\n  },\n  \"acr\": {\n    \"region\": \"us-central1\"\n  }\n}\n```\n\n| Config key         | Required | Description                                          |\n|--------------------|----------|------------------------------------------------------|\n| project_id         | true     | The  GCP project id                                  |\n| gke.cluster_name   | true     | The name of your cluster in GKE                      |\n| gke.cluster_region | true     | The region of your cluster in GKE                    |\n| acr.region         | false    | The region of your artifact or registry (ACR or GCR) |\n\n\u003e The `acr.region` is required only if you use helm to deploy into the cluster.\n\n## Usage\n### Use with docker\n```shell\ndocker run --rm -ti \\\n  -v PATH/config.json:/var/gcloud/config.json \\\n  -v PATH/credentials.json:/var/gcloud/credentials.json \\\n  -v MANIFEST_DIRECTORY:/var/gke-utils \\\n  ghcr.io/devgine/gke-utils:latest sh\n```\n\u003e You can change latest with specific tag\u003cbr\u003e\n\u003e [Available versions](https://github.com/devgine/gke-utils/pkgs/container/gke-utils/versions)\u003cbr\u003e\n\nConnect to the container and check if connection to the cluster is done.\n```shell\nkubectl config get-contexts\n```\n### Use with docker-compose\n\n```yaml\nversion: '3.8'\n\nservices:\n  kubernetes:\n    image: ghcr.io/devgine/gke-utils:latest\n    container_name: kubernetes\n    volumes:\n      - './manifest/:/var/gke-utils'\n      - './.gcloud/:/var/gcloud' # .gcloud/ dir contains config.json and credentials.json files\n      - 'kube_data:/root/.kube'\n      - 'docker_data:/root/.docker'\n      - 'config_data:/root/.config'\n      - 'cache_data:/root/.cache'\n\nvolumes:\n  kube_data:\n    driver: local\n  docker_data:\n    driver: local\n  config_data:\n    driver: local\n  cache_data:\n    driver: local\n```\n\n\u003e `manifest` directory contains the kubernetes manifest\u003cbr\u003e\n\u003e `.gcloud` directory contains config.json and credentials.json\u003cbr\u003e\n\nConnect to the container\n```shell\ndocker-compose up -d \u0026\u0026 docker-compose exec kubernetes sh\n```\nCheck if connection to the cluster is done.\n```shell\nkubectl config get-contexts\n```\n\n### Use in Dockerfile\n```dockerfile\nFROM ghcr.io/devgine/gke-utils:latest\n\n# Add your specific instruction here (exp: install terraform)\nRUN release=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`\nRUN wget https://releases.hashicorp.com/terraform/${release}/terraform_${release}_linux_amd64.zip\nRUN unzip terraform_${release}_linux_amd64.zip\nRUN mv terraform /usr/bin/terraform\n```\n\n## References\n\n### GKE releases\nhttps://cloud.google.com/kubernetes-engine/docs/release-notes\n\n### Google cloud SDK\nhttps://hub.docker.com/r/google/cloud-sdk/\n\n### K8S\nhttps://hub.docker.com/r/alpine/k8s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgine%2Fgke-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgine%2Fgke-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgine%2Fgke-utils/lists"}