Terraform Challenge 1

same error after following the github and the mentioned link and followed steps please guide

Hi @mahesh-chandrasekara,
Thanks for highlighting this. The team will check and will update you asap.

Regards,

I have been trying to solve the terraform challenge 1 but it seems there is some issue with the portal.
I have created provider.tf, deployment.tf and webapp-service.tf. When I click on check button it always say “task not completed”.

Attaching my terraform files below for reference: -

webapp-service.tf

resource "kubernetes_service" "webapp-service"{
    metadata {
      name = "webapp-service"
    }

    spec {
      selector = {
        name = frontend
      }
      port {
        port = 8080
        target_port = 8080
        node_port = 30080
      }
      type = node_port
    }
}
~                                                                                                                                                   
~                                                                                                                                                   
~                                       

Deployment.tf

resource “kubernetes_deployment” “frontend” {
metadata {
name = “frontend”
labels = {
name = “frontend”
}
}

spec {
    replicas = 4

    selector {
      match_labels = {
        name = "webapp"
      }
    }

    template {
      metadata {
        labels = {
            name = "webapp"
        }
      }
    }
    spec {
        container {
          image = "kodekloud/webapp-color:1"
          name = "simple-webapp"
          port {
            container_port = 8080
          }
        }
    }

    }
}

~

provider.tf

provider “kubernetes” {
config_path = “/root/.kube/config”
}

terraform {
required_providers {
kubernetes = {
source = “hashicorp/kubernetes”
version = “2.11.0”
}
}
}
~
~
~
~

Let me know if I have any issue within the code block

Thanks!

Hello @shubhanshu-gupta
Please review your answers with the solution in this repo https://github.com/kodekloudhub/terraform-challenges/tree/master/challenge-1/resources

Hello KodeKloud team,
Curious if you all are still maintaining this challenge?
frontend and webapp-service steps are not getting validated it seems., I even tried copying the files from https://github.com/kodekloudhub/terraform-challenges/tree/master/challenge-1/resources
There is no error, but its not passing the ‘check’… as of 12:50 PM ET on 9/30/23
controlplane and kubernetes-provider stages are working though…

Yes - and this was using the configuration files from the github repo…

i confirm the same its not working for me

What is not working? Here - I’ve done it again.

Following are all the commands I used (output removed for brevity). I have cloned down the git repo and copied the solution’s .tf files into the directory that the question says to put them in.

root@controlplane ~ ➜ git clone https://github.com/kodekloudhub/terraform-challenges.git
root@controlplane ~ ➜  apt update
root@controlplane ~ ➜  apt install unzip -y
root@controlplane ~ ➜  curl -L -o /tmp/terraform_1.1.5_linux_amd64.zip https://releases.hashicorp.com/terraform/1.1.5/terraform_1.1.5_linux_amd64.zip
root@controlplane ~ ➜  unzip -d /usr/local/bin /tmp/terraform_1.1.5_linux_amd64.zip
root@controlplane ~ ➜  cd terraform_challenge/
root@controlplane ~/terraform_challenge ➜ cp ../terraform-challenges/challenge-1/resources/*.tf .
root@controlplane ~/terraform_challenge via 💠 default ➜ terraform init
root@controlplane ~/terraform_challenge via 💠 default ➜ terraform apply -auto-approve

But you should endeavor to understand the content of the .tf files and how they are working to complete the challenge.