Skip to content

πŸ“ Terraform module that generates a Kubeconfig for accessing GKE clusters

License

Notifications You must be signed in to change notification settings

joshdk/terraform-gke-kubeconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CircleCI License GitHub release

Terraform GKE Kubeconfig

πŸ“ Terraform module that generates a Kubeconfig for accessing GKE clusters

Motivations

When provisioning GKE clusters, there is no direct (API) way to obtain a kubeconfig, and the only way to do so requires a hard external dependency on the gcloud cli, and by extension, a working python installation.

Additionally, gcloud provides no means of obtaining a kubeconfig that uses certificate or password authentication.

This module streamlines this process by generating a kubeconfig file similar to how gcloud would, without needing it as a dependency. This config can then be passed to other units (kubectl, helm, etc) for usage.

Usage

To use this module, a pre-built release version can be sourced.

module "kubeconfig" {
  source = "https://github.com/joshdk/terraform-gke-kubeconfig/releases/download/0.1.0/module.tgz"
  ...
}

Alternatively, a development version can be sourced instead.

module "kubeconfig" {
  source = "github.com/joshdk/terraform-gke-kubeconfig//module"
  ...
}

To configure inputs for the module, refer to the bundled readme.

License

This code is distributed under the MIT License, see LICENSE.txt for more information.