Skip to content

Commit e2b5e9c

Browse files
docs: update README
1 parent 3255853 commit e2b5e9c

File tree

3 files changed

+13
-119
lines changed

3 files changed

+13
-119
lines changed

Makefile

Lines changed: 0 additions & 96 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
# GKE Authentication Plugin
22

3-
This plugin provides a standalone way to generate an ExecCredential for use by k8s.io/client-go applications.
3+
> Note: This is a hard fork of [this repo](https://github.com/traviswt/gke-auth-plugin). This version adds support for service account impersonation and uses `client.authentication.k8s.io/v1` instead of `v1beta1`
44
5-
Google already provides a [gke-gcloud-auth-plugin](https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke); however, that plugin depends on the gcloud CLI, which is written in Python. This dependency graph is Large if you want to authenticate and interact with a GKE cluster from a go application.
5+
This plugin provides a standalone way to generate an ExecCredential for use by k8s.io/client-go applications or
6+
human users.
67

7-
The plugin is for use outside of a cluster; when running in the cluster, mount a service account and use that token to interact with the Kubernetes API.
8+
Google already provides a [gke-gcloud-auth-plugin](https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke); however,
9+
that plugin depends on the gcloud CLI, which is written in Python. This dependency graph is large, if you want to authenticate and interact with a GKE cluster from a go application.
810

9-
## Build
10-
11-
```shell
12-
make
13-
```
14-
15-
Or with Docker:
16-
```shell
17-
docker build -f Dockerfile.dev -t gke-auth-plugin-dev .
18-
19-
docker run -it --rm --name gke-auth-plugin-dev-container -v ${PWD}:/home/nonroot gke-auth-plugin-dev
20-
21-
make
22-
```
11+
This plugin is for use outside of a cluster; when running in the cluster, mount a service account and use that token to interact with the Kubernetes API.
2312

2413
## Run
2514

2615
```shell
2716
# generate ExecCredential
28-
bin/gke-auth-plugin
17+
gke-auth-plugin
18+
19+
# generate credentials for service account
20+
gke-auth-plugin --impersonate_service_account=${GOOGLE_SERVICE_ACCOUNT_EMAIL}
2921

3022
# version
31-
bin/gke-auth-plugin version
23+
gke-auth-plugin version
3224
```
3325

3426
You can straight up replace the gke-gcloud-auth-plugin with this binary, or place on your path and update your kubeconfig exec command to run gke-auth-plugin.
@@ -40,11 +32,8 @@ users:
4032
- name: user_id
4133
user:
4234
exec:
43-
apiVersion: client.authentication.k8s.io/v1beta1
35+
apiVersion: client.authentication.k8s.io/v1
4436
command: gke-auth-plugin
4537
provideClusterInfo: true
4638
interactiveMode: Never
4739
```
48-
## TODO
49-
50-
- Add unit tests

pkg/cmd/version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"fmt"
5+
56
"github.com/spf13/cobra"
67
"github.com/traviswt/gke-auth-plugin/pkg/conf"
78
)

0 commit comments

Comments
 (0)