Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while using the .tf file #93

Open
Manoj-07 opened this issue Oct 26, 2021 · 2 comments
Open

error while using the .tf file #93

Manoj-07 opened this issue Oct 26, 2021 · 2 comments

Comments

@Manoj-07
Copy link

I had successfully converted YAML to.tf while I am trying to deploy it I am getting the following error could you please help me to resolve the eeror
image

@kahara
Copy link

kahara commented Oct 27, 2021

Could you post those .yaml and .tf files?

Tip: copypasting text instead of images makes everything better.

@Manoj-07
Copy link
Author

Manoj-07 commented Oct 28, 2021

https://github.com/Kurento/Kubernetes/blob/master/nginx-deployment-service.yaml
nginx-deployment-service.yaml anfd the terraform converted file is

resource "kubernetes_deployment" "nginx" {
  metadata {
    name = "nginx"
  }

  spec {
    replicas = 3

    selector {
      match_labels = {
        app = "nginx"
      }
    }

    template {
      metadata {
        labels = {
          app = "nginx"
        }
      }

      spec {
        container {
          name  = "nginx"
          image = "nginx"

          port {
            container_port = 80
          }
        }
      }
    }

    strategy {
      type = "Recreate"
    }
  }
}

resource "kubernetes_service" "nginx" {
  metadata {
    name      = "nginx"
    namespace = "default"

    labels = {
      app = "nginx"
    }

    annotations = {
      "service.beta.kubernetes.io/aws-load-balancer-type" = "nlb"
    }
  }

  spec {
    port {
      name        = "http"
      protocol    = "TCP"
      port        = 80
      target_port = "80"
    }

    selector = {
      app = "nginx"
    }

    type                    = "LoadBalancer"
    external_traffic_policy = "Local"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants