Skip to content

Commit 196f4b6

Browse files
authored
Project motivations in the readme (#15)
1 parent 1754330 commit 196f4b6

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@
44

55
# Terraform GKE Kubeconfig
66

7-
📝 Terraform module that creates a Kubeconfig for accessing GKE clusters
7+
📝 Terraform module that generates a Kubeconfig for accessing GKE clusters
8+
9+
## Motivations
10+
11+
When provisioning GKE clusters, there is no direct (API) way to obtain a
12+
kubeconfig, and the only way _to_ do so requires a hard external dependency on
13+
the [gcloud cli](https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials),
14+
and by extension, a working python installation.
15+
16+
Additionally, `gcloud` provides no means of obtaining a kubeconfig that uses
17+
[certificate](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#x509-client-certs)
18+
or [password](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-password-file)
19+
authentication.
20+
21+
This module streamlines this process by generating a kubeconfig file similar to
22+
how `gcloud` would, without needing it as a dependency. This config can then be
23+
passed to other units (`kubectl`, `helm`, etc) for usage.
824

925
## Usage
1026

module/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Terraform GKE Kubeconfig
22

3-
📝 Terraform module that creates a Kubeconfig for accessing GKE clusters
3+
📝 Terraform module that generates a Kubeconfig for accessing GKE clusters
44

55
## Usage:
66

@@ -12,10 +12,10 @@ provider "google" {
1212
module "kubeconfig" {
1313
source = "github.com/joshdk/terraform-gke-kubeconfig//module"
1414
15+
auth_type = "gcloud"
1516
gcloud_path = "/usr/bin/gcloud"
1617
kubeconfig = "/tmp/config.yml"
1718
name = "my-cluster"
18-
use_password_auth = false
1919
zone = "us-east1-a"
2020
}
2121
```

module/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* # Terraform GKE Kubeconfig
33
*
4-
* 📝 Terraform module that creates a Kubeconfig for accessing GKE clusters
4+
* 📝 Terraform module that generates a Kubeconfig for accessing GKE clusters
55
*
66
* ## Usage:
77
*
@@ -13,10 +13,10 @@
1313
* module "kubeconfig" {
1414
* source = "github.com/joshdk/terraform-gke-kubeconfig//module"
1515
*
16+
* auth_type = "gcloud"
1617
* gcloud_path = "/usr/bin/gcloud"
1718
* kubeconfig = "/tmp/config.yml"
1819
* name = "my-cluster"
19-
* use_password_auth = false
2020
* zone = "us-east1-a"
2121
* }
2222
* ```

0 commit comments

Comments
 (0)