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

LoadBalancer not working, nginx app not reachable #217

Open
nicoclau opened this issue Feb 21, 2025 · 2 comments
Open

LoadBalancer not working, nginx app not reachable #217

nicoclau opened this issue Feb 21, 2025 · 2 comments

Comments

@nicoclau
Copy link

nicoclau commented Feb 21, 2025

Hello I use WSL Unbuntu

  • k8s v 1.32.0
  • kind 0.26.0
  • cloud provider kind 0.6.0

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx LoadBalancer 10.96.100.51 172.21.0.5 8080:32297/TCP 3m57s

I tried

curl 172.21.0.5
curl: (7) Failed to connect to 172.21.0.5 port 80: Connection refused

No response, when I logged in the master node for example:

docker exec -it xxxx bash

curl 10.96.100.51

<title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style>

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

so the apps runs,

even curl 172.21.0.5 works from the master node.

Can you tell me how to troubleshoot the pb please?
Thanks 👍

@nicoclau
Copy link
Author

Here the complete description of the service

Name:                     nginx
Namespace:                ckad
Labels:                   <none>
Annotations:              <none>
Selector:                 run=nginx
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.111.24
IPs:                      10.96.111.24
LoadBalancer Ingress:     172.21.0.5 (Proxy)
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  31716/TCP
Endpoints:                10.244.241.11:80
Session Affinity:         None
External Traffic Policy:  Cluster
Internal Traffic Policy:  Cluster
Events:
  Type     Reason                  Age                From                Message
  ----     ------                  ----               ----                -------
  Normal   EnsuringLoadBalancer    28m                service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  20m (x2 over 26m)  service-controller  Error syncing load balancer: failed to ensure load balancer: failed to create continers kindccm-0aca0d405b16 [--detach --tty --label io.x-k8s.cloud-provider-kind.cluster=marianel --label io.x-k8s.cloud-provider-kind.loadbalancer.name=marianel/ckad/nginx --net kind --init=false --hostname kindccm-0aca0d405b16 --privileged --restart=on-failure --sysctl=net.ipv4.ip_forward=1 --sysctl=net.ipv4.conf.all.rp_filter=0 --sysctl=net.ipv4.ip_unprivileged_port_start=1 --publish=80/TCP --publish=10000/TCP --publish-all docker.io/envoyproxy/envoy:v1.30.1 bash -c echo -en 'node:
  cluster: cloud-provider-kind
  id: cloud-provider-kind-id

dynamic_resources:
  cds_config:
    resource_api_version: V3
    path: /home/envoy/cds.yaml
  lds_config:
    resource_api_version: V3
    path: /home/envoy/lds.yaml

admin:
  access_log_path: /dev/stdout
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 10000
' > /home/envoy/envoy.yaml && touch /home/envoy/cds.yaml && touch /home/envoy/lds.yaml && while true; do envoy -c /home/envoy/envoy.yaml && break; sleep 1; done]: exit status 125
  Normal  EnsuringLoadBalancer  20m (x3 over 27m)  service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   20m                service-controller  Ensured load balancer
  Normal  EnsuringLoadBalancer  17m                service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   17m                service-controller  Ensured load balancer

@aojea
Copy link
Contributor

aojea commented Feb 22, 2025

Hello I use WSL Unbuntu

it got fixed in latest release, but you need to run with privileges in order to work

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