How to launch one Pod in Minikube using Terraform?

0 votes

Hi Guys,

I am new in Terraform. I want to use Kubernetes as a Terraform provider to launch one Pod. Can anyone help me how can I launch one Pod using Terraform in Minikube Cluster?

Jun 16 in Terraform by akhtar
• 18,250 points
235 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use kubernetes_pod resource to launch one Pod in Minikube Cluster with the help of Terraform. This resource will automatically connect with Minikube. You can go through the below-given example.

provider "kubernetes" {
  config_context_cluster   = "minikube"
}

resource "kubernetes_pod" "mypod1" {
  metadata {
    name = "mypod"
  }
  spec {
    container {
      image = "httpd"
      name  = "webcon"
    }
  }
}
answered Jun 16 by MD
• 42,420 points
Config context cluster=minikube
Why you used minikube there you might give username and pass or certificates in config file

You can do that way also. But you can check this link once.

https://www.terraform.io/docs/providers/kubernetes/index.html

Related Questions In Terraform

0 votes
1 answer

How to create one S3 bucket in AWS using Terraform?

Hi@akhtar, You need to set aws provider name ...READ MORE

answered Jul 23 in Terraform by MD
• 42,420 points
64 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 in Terraform by MD
• 42,420 points
459 views
0 votes
1 answer

How to create one s3 bucket using terraform?

Hi@akhtar, You can use aws_s3_bucket resources to create ...READ MORE

answered Jun 12 in Terraform by MD
• 42,420 points
174 views
0 votes
1 answer

How to do ssh in EC2 instance using Terraform?

Hi@akhtar, To ssh in your EC2 instance, you ...READ MORE

answered Jun 15 in Terraform by MD
• 42,420 points
229 views
0 votes
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
7,619 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 11, 2019 in Kubernetes by Kalgi
• 51,890 points

reshown Apr 12, 2019 by Kalgi 2,239 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 in Terraform by MD
• 42,420 points
105 views
0 votes
1 answer

How to create a namespace in minikube using Terraform?

Hi@akhtar, You can use kubernetes_namespace resource. It is used ...READ MORE

answered Jun 30 in Terraform by MD
• 42,420 points
70 views