Sign inSign up

skriptfabrik/gke-tools

By skriptfabrik

•Updated 14 days ago

Google Kubenetes Engine Client Toolset Docker Images

Image
0

10K+

skriptfabrik/gke-tools repository overview

⁠Google Kubernetes Engine Tools

This image provide a toolset to interact with the Google Kubenetes Engine.

There is also a script activate-service-account to simplify the authentication with a service account.

The image provides a zsh including plugins for helm and kubectl. Autocomplete will work for all these tools.

  • skriptfabrik/gke-tools:latest, skriptfabrik/gke-tools:VERSION (Dockerfile)⁠

→ Check out Docker Hub⁠ for available tags.

⁠How to use this image

Start the interactive shell:

docker run \
    --rm \
    --interactive \
    --tty \
    --volume "$(pwd)":/app \
    skriptfabrik/gke-tools \
    zsh

Authorizing access to the Google Cloud Platform and logging in to the Google Container Registry using docker:

docker run \
    --rm \
    --interactive \
    --tty \
    --volume ~/.config/gcloud:/root/.config/gcloud \
    skriptfabrik/gke-tools \
    gcloud auth login

docker run \
    --rm \
    --volume ~/.config/gcloud:/root/.config/gcloud \
    skriptfabrik/gke-tools \
    gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io

Authorizing access to the Google Cloud Platform and using the tools within a CI:

docker run \
    --rm \
    --volume "$(pwd)":/app \
    --env GKE_SERVICE_ACCOUNT_KEY=<BASE64-ENCODED-SERVICE-ACCOUNT-JSON-DATA> \
    --env GKE_CLUSTER_NAME=<CLUSTER-NAME> \
    --env GKE_REGION=<GKE-CLUSTER-REGION> \
    --env GKE_ZONE=<GKE-CLUSTER-ZONE> \
    skriptfabrik/gke-tools \
    sh -c " \
        activate-service-account; \
        <ALL THE FANCY COMMAND LINE TOOL CALLS>
    "

Aa an alternative mount the service account credentials:

docker run \
    --rm \
    --volume "$(pwd)":/app \
    --volume ./service-account.json:/root/.config/gcloud-credentials/service-account.json \
    --env GKE_CLUSTER_NAME=<CLUSTER-NAME> \
    --env GKE_REGION=<GKE-CLUSTER-REGION> \
    --env GKE_ZONE=<GKE-CLUSTER-ZONE> \
    skriptfabrik/gke-tools \
    sh -c " \
        activate-service-account; \
        <ALL THE FANCY COMMAND LINE TOOL CALLS>
    "
⁠Configuration

The image can be configured by using environment variables.

EnvironmentDescription
GKE_SERVICE_ACCOUNT_KEYThe base64 encoded content of the Google service account key json file which is provided by Google.
GKE_CLUSTER_NAMEThe name of the Kubernetes cluster.
GKE_REGION*The region of the Kubernetes cluster.
GKE_ZONE*The zone of the Kubernetes cluster.

* Either one of these environments have to be defined. If both are defined, GKE_REGION will be used.

If necessary, the configuaration if all tools can be mounted as volume.

ToolConfiguration path within the container
Google Cloud SDK Client/root/.config/gcloud
Google Cloud Credentials/root/.config/gcloud-credentials
Helm/root/.helm
Kubernetes/root/.kube

Instead of injecting the Google Cloud Credentials, the credential file can also be set as first argument to the activate-service-account script.

⁠Quick reference

Tag summary

Content type

Image

Digest

sha256:8d1dad14b…

Size

359.9 MB

Last updated

14 days ago

docker pull skriptfabrik/gke-tools