Sign inSign up

crunchgeek/gcloud-kubectl

By crunchgeek

Updated over 7 years ago

Google Cloud SDK with authorized access to Kubernetes cluster

Image
0

639

crunchgeek/gcloud-kubectl repository overview

gcloud-kubectl

gcloud-kubectl is a Docker image to authorize kubectl command line tool, to connect to a Kubernetes cluster running on Google Cloud.

gcloud-kubectl container exposes SSH port to make it possible to execute kubectl commands remotely.

Variables (required)

  • SSH_KEY Public RSA key file authorized to connect to container via SSH port
  • KUBE_AUTH Google service account json key file with privileges to manage Kubernetes
  • KUBE_NAME Kubernetes cluster name to connect to
  • KUBE_ZONE Kubernetes cluster location zone

Example use

Start container by mounting the volume from local file system containing public RSA key and Google service account json key (/config in this example) into /auth directory inside the container.

docker run --rm \
    -v /config:/auth \
    -e SSH_KEY=/auth/id_rsa.pub \
    -e KUBE_AUTH=/auth/gcloud-auth.json \
    -e KUBE_NAME=kubernetes \
    -e KUBE_ZONE=us-central1-f \
    -ti crunchgeek/gcloud-kubectl
docker-compose.yml
version: "3"

services:
    gcloud_sdk:
        image: crunchgeek/gcloud-kubectl
        volumes:
            - /config/:/auth
        environment:
            - SSH_KEY=/auth/id_rsa.pub
            - KUBE_AUTH=/auth/gcloud-auth.json
            - KUBE_NAME=kubernetes
            - KUBE_ZONE=us-central1-f

Tag summary

Content type

Image

Digest

Size

1 GB

Last updated

over 7 years ago

docker pull crunchgeek/gcloud-kubectl