https://github.com/markhilton/gcloud-kubectl
Google Cloud SDK with authorized access to Kubernetes cluster
https://github.com/markhilton/gcloud-kubectl
docker docker-compose docker-image dockerfile google-cloud google-cloud-platform google-kubernetes-engine google-service-account kubectl kubernetes rsa-key ssh ssh-key ssh-server
Last synced: about 1 month ago
JSON representation
Google Cloud SDK with authorized access to Kubernetes cluster
- Host: GitHub
- URL: https://github.com/markhilton/gcloud-kubectl
- Owner: markhilton
- License: mit
- Created: 2018-04-19T21:43:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T02:48:02.000Z (almost 7 years ago)
- Last Synced: 2025-03-22T15:35:25.707Z (11 months ago)
- Topics: docker, docker-compose, docker-image, dockerfile, google-cloud, google-cloud-platform, google-kubernetes-engine, google-service-account, kubectl, kubernetes, rsa-key, ssh, ssh-key, ssh-server
- Language: Shell
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gcloud-kubectl
**gcloud-kubectl** is a [Docker](https://www.docker.com/) image to authorize [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) command line tool, to connect to a [Kubernetes](https://kubernetes.io/) cluster running on [Google Cloud](https://cloud.google.com/).
**gcloud-kubectl** container exposes [SSH](https://www.ssh.com/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](https://cloud.google.com/iam/docs/understanding-service-accounts) 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
```