File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
# Terraform GKE Kubeconfig
6
6
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.
8
24
9
25
## Usage
10
26
Original file line number Diff line number Diff line change 1
1
# Terraform GKE Kubeconfig
2
2
3
- 📝 Terraform module that creates a Kubeconfig for accessing GKE clusters
3
+ 📝 Terraform module that generates a Kubeconfig for accessing GKE clusters
4
4
5
5
## Usage:
6
6
@@ -12,10 +12,10 @@ provider "google" {
12
12
module "kubeconfig" {
13
13
source = "github.com/joshdk/terraform-gke-kubeconfig//module"
14
14
15
+ auth_type = "gcloud"
15
16
gcloud_path = "/usr/bin/gcloud"
16
17
kubeconfig = "/tmp/config.yml"
17
18
name = "my-cluster"
18
- use_password_auth = false
19
19
zone = "us-east1-a"
20
20
}
21
21
```
Original file line number Diff line number Diff line change 1
1
/* *
2
2
* # Terraform GKE Kubeconfig
3
3
*
4
- * 📝 Terraform module that creates a Kubeconfig for accessing GKE clusters
4
+ * 📝 Terraform module that generates a Kubeconfig for accessing GKE clusters
5
5
*
6
6
* ## Usage:
7
7
*
13
13
* module "kubeconfig" {
14
14
* source = "github.com/joshdk/terraform-gke-kubeconfig//module"
15
15
*
16
+ * auth_type = "gcloud"
16
17
* gcloud_path = "/usr/bin/gcloud"
17
18
* kubeconfig = "/tmp/config.yml"
18
19
* name = "my-cluster"
19
- * use_password_auth = false
20
20
* zone = "us-east1-a"
21
21
* }
22
22
* ```
You can’t perform that action at this time.
0 commit comments