terraform-provider-kubernetes

How to use a token created in a secret in another resource?

╄→尐↘猪︶ㄣ 提交于 2020-04-07 08:03:23
问题 I'm trying to create a service account secret in order to populate a secret with the token: resource "kubernetes_service_account" "k8s-api-token" { metadata { namespace = "${var.whatever_namespace}" name = "api-service-account" } secret { name = "api-service-account-secret" } } resource "kubernetes_secret" "k8s-api-token" { metadata { namespace = "${var.whatever_namespace}" name = "${kubernetes_service_account.k8s-api-token.metadata.0.name}-secret" annotations = { "kubernetes.io/service

Managing GKE and its deployments with Terraform

三世轮回 提交于 2019-12-08 15:44:38
I can use terraform to deploy a Kubernetes cluster in GKE . Then I have set up the provider for Kubernetes as follows: provider "kubernetes" { host = "${data.google_container_cluster.primary.endpoint}" client_certificate = "${base64decode(data.google_container_cluster.primary.master_auth.0.client_certificate)}" client_key = "${base64decode(data.google_container_cluster.primary.master_auth.0.client_key)}" cluster_ca_certificate = "${base64decode(data.google_container_cluster.primary.master_auth.0.cluster_ca_certificate)}" } By default, terraform interacts with Kubernetes with the user client ,

Managing GKE and its deployments with Terraform

两盒软妹~` 提交于 2019-12-08 07:19:43
问题 I can use terraform to deploy a Kubernetes cluster in GKE . Then I have set up the provider for Kubernetes as follows: provider "kubernetes" { host = "${data.google_container_cluster.primary.endpoint}" client_certificate = "${base64decode(data.google_container_cluster.primary.master_auth.0.client_certificate)}" client_key = "${base64decode(data.google_container_cluster.primary.master_auth.0.client_key)}" cluster_ca_certificate = "${base64decode(data.google_container_cluster.primary.master