Questions tagged [terraform-provider-kubernetes]
79 questions
9
votes
3 answers
How to make Terraform provider dependent on a resource being created
I am trying to utilize Rancher Terraform provider to create a new RKE cluster and then use the Kubernetes and Helm Terraform providers to create/deploy resources to the created cluster. I'm using this…

Suhas Potluri
- 121
- 1
- 4
8
votes
1 answer
How to define a service label for a kubernetes service running on GKE
I am creating a kubernetes cluster to host a service and added an internal load balancer to route traffic between my VM Instances and the kubernetes cluster. I want to add a service label to the load balancer FrontEnd so that I can use a dns name…

RandomQuests
- 635
- 4
- 16
7
votes
3 answers
How do I apply a CRD from github to a cluster with terraform?
I want to install a CRD with terraform, I was hoping it would be easy as doing this:
data "http" "crd" {
url = "https://raw.githubusercontent.com/kubernetes-sigs/application/master/deploy/kube-app-manager-aio.yaml"
request_headers = {
Accept…

red888
- 27,709
- 55
- 204
- 392
7
votes
2 answers
Get IP from externally created load balancers with terraform
I'm working on a terraform module to create a GKE cluster. The same module invokes a provisioner that performs a helm install of an application.
The helm chart creates load balancer. The load balancer is not know to the terraform module so that the…

Randy
- 1,299
- 2
- 10
- 23
6
votes
0 answers
Can I set up Kubernetes Ingress through Terrafrom without declaring any services through Terraform?
The problem I am trying to solve:
I want to achieve the following setup:
Terraform provisioned infrastructure consisting of Kubernetes cluster, DNS records pointing to that cluster,
Kubernetes services, deployments configured through Kubernetes…

Adam
- 1,470
- 1
- 17
- 13
5
votes
1 answer
Terraform kubernetes_config_map --from-env-file
I am creating a kubernetes configMap using '--from-env-file' option to store the file contents as environment variables.
kubectl create configmap env --from-env-file=env.properties -n namespace
When I create a terraform resource as below, the…

user691197
- 927
- 6
- 20
- 38
4
votes
1 answer
Terraform throws resource name may not be empty error
I'm getting the following error message that I don't understand:
Error: resource name may not be empty
on main.tf line 48, in data "kubernetes_service" "spark_master_service":
48: data "kubernetes_service" "spark_master_service" {
Related data…

Jordi
- 20,868
- 39
- 149
- 333
4
votes
1 answer
What is the right way to manage changes in kubernetes manifests?
I've been using terraform for a while and I really like it. I also set up Atlantis so that my team could have a "GitOps" flow. This is my current process:
Add or remove resources from Terraform files
Push changes to GitHub and create a pull…

kenske
- 2,235
- 2
- 20
- 27
4
votes
1 answer
Multiline string annotations for terraform kubernetes provider
I would like to set up Ambassador as an API Gateway for kubernetes using terraform. There are several ways how to configure Ambassador. The recommended way, according to documentation, is by using kubernetes annotations for each service that is…

zdebra
- 948
- 8
- 22
3
votes
2 answers
Failed to construct REST client
I'm trying to use kubernetes-alpha provider in Terraform, but I have "Failed to construct REST client" error message.
I'm using tfk8s to convert my yaml file to terraform code.
I make the seme declaration for the provider than kubernetes, and my…

握草行天下
- 41
- 1
- 1
- 4
3
votes
1 answer
terraform manually installed plugin fails
I am using terraform 0.13.0 and trying to the kubernetes-alpha provider (https://github.com/hashicorp/terraform-provider-kubernetes-alpha). I download the plugin for Mac and copied the plugin to ~/.terraform.d/plugins dir
when I run terraform init…

RandomQuests
- 635
- 4
- 16
3
votes
1 answer
Inheriting Values from output.tf with conditional resources using TF 0.12+
I have a module for service-accounts in GCP being used to populate kubernetes secrets
Here is my module
resource "google_service_account" "service_account" {
count = var.enabled ? 1 : 0
account_id = var.account_id
display_name =…

Sam-Tahir
- 191
- 3
- 15
3
votes
1 answer
terraform keeps overwriting token for kubernetes provider
We're trying to run terraform apply with the following kubernetes provider setting in our terraform file:
data "google_client_config" "current" {
}
data "google_container_cluster" "onboarding_cluster" {
name = var.cluster_name
location =…

Bilbo Baggins
- 1,029
- 1
- 9
- 19
3
votes
2 answers
Terraform Unsupported block error for selector in kubernetes_service resource
Terraform configuration for heapster to deploy on kubernetes cluster is failing with error:
Blocks of type "selector" are not expected here. Did you mean to define
argument "selector"? If so, use the equals sign to assign it a value.
Resource…

Santosh Kumar
- 761
- 5
- 28
3
votes
3 answers
Managing GKE and its deployments with Terraform
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 …

Navarro
- 1,284
- 2
- 17
- 40