kubernetes-sigs/cloud-provider-kind

Errors when starting up `cloud-provider-kind` on MacOS

kimnh-0823 opened this issue · 1 comments

Environment

  • MacOS 14 Sonoma
  • Docker Engine (Colima)

Steps to reproduce

  • Create kind cluster (successfully):
kind create cluster --name dev
  • Install Ingress Nginx (successfully):
helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace
  • Start cloud-provider-kind (error):
cloud-provider-kind

Errror logs

~> docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Status}}'
CONTAINER ID   NAMES                                              STATUS
f281c23f2f59   kindccm-SK7VAVAHTT5FATLMFFPXYFEB5UJCE4K7BDL3NCXL   Up 5 minutes
b46dae9a7d24   dev-control-plane                                  Up 26 hours
I0916 11:37:52.419305   89544 proxy.go:290] updating loadbalancer with config
resources:
- "@type": type.googleapis.com/envoy.config.listener.v3.Listener
  name: listener_IPv4_443_TCP
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 443
      protocol: TCP
  filter_chains:
  - filters:
    - name: envoy.filters.network.tcp_proxy
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
        access_log:
        - name: envoy.file_access_log
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
        stat_prefix: tcp_proxy
        cluster: cluster_IPv4_443_TCP
- "@type": type.googleapis.com/envoy.config.listener.v3.Listener
  name: listener_IPv4_80_TCP
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 80
      protocol: TCP
  filter_chains:
  - filters:
    - name: envoy.filters.network.tcp_proxy
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
        access_log:
        - name: envoy.file_access_log
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
        stat_prefix: tcp_proxy
        cluster: cluster_IPv4_80_TCP
I0916 11:37:52.469790   89544 proxy.go:301] updating loadbalancer with config
resources:
- "@type": type.googleapis.com/envoy.config.cluster.v3.Cluster
  name: cluster_IPv4_443_TCP
  connect_timeout: 5s
  type: STATIC
  lb_policy: RANDOM
  health_checks:
  - timeout: 5s
    interval: 3s
    unhealthy_threshold: 2
    healthy_threshold: 1
    no_traffic_interval: 5s
    always_log_health_check_failures: true
    always_log_health_check_success: true
    event_log_path: /dev/stdout
    http_health_check:
      path: /healthz
  load_assignment:
    cluster_name: cluster_IPv4_443_TCP
    endpoints:
      - lb_endpoints:
        - endpoint:
            health_check_config:
              port_value: 10256
            address:
              socket_address:
                address: 172.18.0.2
                port_value: 32314
                protocol: TCP
- "@type": type.googleapis.com/envoy.config.cluster.v3.Cluster
  name: cluster_IPv4_80_TCP
  connect_timeout: 5s
  type: STATIC
  lb_policy: RANDOM
  health_checks:
  - timeout: 5s
    interval: 3s
    unhealthy_threshold: 2
    healthy_threshold: 1
    no_traffic_interval: 5s
    always_log_health_check_failures: true
    always_log_health_check_success: true
    event_log_path: /dev/stdout
    http_health_check:
      path: /healthz
  load_assignment:
    cluster_name: cluster_IPv4_80_TCP
    endpoints:
      - lb_endpoints:
        - endpoint:
            health_check_config:
              port_value: 10256
            address:
              socket_address:
                address: 172.18.0.2
                port_value: 31670
                protocol: TCP
I0916 11:37:52.540858   89544 server.go:120] updating loadbalancer tunnels on userspace
I0916 11:37:52.552381   89544 tunnel.go:38] found port maps map[10000:32782 443:32781 80:32780] associated to container kindccm-SK7VAVAHTT5FATLMFFPXYFEB5UJCE4K7BDL3NCXL
I0916 11:37:52.563488   89544 tunnel.go:45] setting IPv4 address 172.18.0.3 associated to container kindccm-SK7VAVAHTT5FATLMFFPXYFEB5UJCE4K7BDL3NCXL
E0916 11:37:52.565312   89544 controller.go:298] error processing service ingress-nginx/ingress-nginx-controller (retrying with exponential backoff): failed to ensure load balancer: exit status 1
I0916 11:37:52.565353   89544 event.go:389] "Event occurred" object="ingress-nginx/ingress-nginx-controller" fieldPath="" kind="Service" apiVersion="v1" type="Warning" reason="SyncLoadBalancerFailed" message="Error syncing load balancer: failed to ensure load balancer: exit status 1"

Upon reviewing the commit history, I discovered the solution (7d92b65). It's necessary to execute cloud-provider-kind with root privileges on a Mac:

sudo cloud-provider-kind

Now, It works.