kyma-incubator / terraform-provider-kind

Terraform Provider for kind (Kubernetes IN Docker)
Apache License 2.0
80 stars 44 forks source link

load balancer issue #42

Closed fmontaldo87 closed 3 years ago

fmontaldo87 commented 3 years ago

Hi

I configure kind and configured metalb. I want to know why I cannot expose any app to the outside with the loadbalancer.

fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$ kubectl --namespace=metallb-system get all NAME READY STATUS RESTARTS AGE pod/controller-64f86798cc-79dhv 1/1 Running 0 179m pod/speaker-5vpzk 1/1 Running 0 179m pod/speaker-5zskj 1/1 Running 0 179m pod/speaker-wk297 1/1 Running 0 179m

NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE daemonset.apps/speaker 3 3 3 3 3 kubernetes.io/os=linux 179m

NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/controller 1/1 1 1 179m

NAME DESIRED CURRENT READY AGE replicaset.apps/controller-64f86798cc 1 1 1 179m

I tired to export the service of my app as a loadbalancer but I cannot access it from the outside

fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$ kubectl --namespace=selenium get all NAME READY STATUS RESTARTS AGE pod/selenium-hub-deployment-856d4bb8fd-545pj 1/1 Running 0 80m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/selenium-hub LoadBalancer 10.96.165.222 172.19.255.201 4444:32048/TCP,5555:30298/TCP 80m

NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/selenium-hub-deployment 1/1 1 1 80m

NAME DESIRED CURRENT READY AGE replicaset.apps/selenium-hub-deployment-856d4bb8fd 1 1 1 80m fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$

tehcyx commented 3 years ago

Hi @fmontaldo87 ,

Have you got this working on vanilla kind without terraform? Not sure this has anything to do with the terraform provider. What configuration did you apply with terraform?

fmontaldo87 commented 3 years ago

Hi @tehcyx

This is my Terraform ans kind version

Terraform v0.13.6

kind v0.10.0 go1.15.7 linux/amd64

My main.tf file that runs the config for the k8s cluster

terraform { required_version = ">= 0.13.0" required_providers { kind = { source = "kyma-incubator/kind" version = "0.0.7" } } }

provider "kubernetes" { load_config_file = "true" }

provider "kind" { }

I am running it on ubunut 20

resource "kind_cluster" "default" { name = "new-cluster" wait_for_ready = true kind_config { kind = "Cluster" api_version = "kind.x-k8s.io/v1alpha4"

node {
  role = "control-plane"
}

node {
  role = "worker"
  image = "kindest/node:v1.19.1"
}

node {
  role = "worker"
}

} }

tehcyx commented 3 years ago

Since the cluster creation succeeds here, this does not seem to be an issue related to this terraform provider.

I see you've already created a ticket here over at kubernetes-sigs/kind: https://github.com/kubernetes-sigs/kind/issues/2212

Try cross checking your setup with what is done in an older kind version on this blog: https://mauilion.dev/posts/kind-metallb/

As this seems unrelated to this terraform provider I'll close the issue here. Feel free to re-open should you find an issue with the provider.