This repository is a Terraform Module to use Kubernetes secrets as data.
This module requires Terraform version 0.10.x or newer and a valid out-of-cluster Kubernetes configuration at the default path ($HOME/.kube/config) or the path defined by $KUBECONFIG.
Add the module to your Terraform resources:
module "rds-postgres-password" {
source = "github.com/gearnode/terraform-kubernetes-get-secret?ref=v0.3.1"
namespace = "default"
name = "terraform"
key = "database-password"
context = "supercontext"
}and load the module using terraform get.
Available variables are listed below, along with their default values:
| variable | description |
|---|---|
namespace |
The kubernetes namespace |
name |
The kubernetes secret name |
key |
The kubernetes secret key to get |
context |
The kubernetes context |
Available outputs are listed below, along with their description:
| output | description |
|---|---|
result |
A string of the secret value. |
- fully installed and configured
goenvironment
To build binaries, use the following commands:
$ git clone git@github.com:gearnode/terraform-kubernetes-get-secret.git
$ cd terraform-kubernetes-get-secret
$ make
This module is currently maintained by the individuals listed below.