Create configMap in Kubernetes using Terraform Script

0 votes

Hi Guys,

I am new to Terraform. I want to use Kubernetes as a provider in Terraform. But before launching a Pod, I want to create a ConfigMap using Terraform Script. How can I do that?

Sep 28, 2020 in Terraform by akhtar
• 38,230 points
3,070 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the kubernetes_config_map resource in Terraform. This has the capability to create a ConfigMap as shown below.

resource "kubernetes_config_map" "dbconfig" {
   "metadata" {
       name = "dbconfig"
   }
   data = {
       dbconnection = "${var.project_id}:${var.region}:${google_sql_database_instance.master.name}"
   }
}
answered Sep 28, 2020 by MD
• 95,440 points

Related Questions In Terraform

0 votes
1 answer

Create service in Kubernetes cluster using Terraform.

Hi@MD, To expose the pod to end-users, provision ...READ MORE

answered Sep 14, 2020 in Terraform by akhtar
• 38,230 points
414 views
0 votes
1 answer

Create a secret in Kubernetes using Terraform.

Hi@akhtar, Terraform has resource to create a secret ...READ MORE

answered Sep 28, 2020 in Terraform by MD
• 95,440 points
2,403 views
0 votes
1 answer

How to create one key in AWS using terraform?

Hi@akhtar, You can use aws_key_pair resource n terraform. ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,440 points
1,351 views
0 votes
1 answer

How to create a folder in S3 bucket using terraform?

Hi@akhtar, You can use aws_s3_bucket_object resource to create one ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,440 points
10,021 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
14,525 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 5,978 views
0 votes
1 answer

How to create a namespace in the Kubernetes cluster using Terraform?

Hi@akhtar, You can use kubernetes_namespace resource in your ...READ MORE

answered Sep 14, 2020 in Terraform by MD
• 95,440 points
7,993 views
0 votes
1 answer

How to get LoadBalancer IP in Kubernetes using Terraform script?

Hi@akhtar, In your Terraform script, you can output ...READ MORE

answered Sep 28, 2020 in Terraform by MD
• 95,440 points
3,010 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP