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

[BUG] The entrypoint script in an agent node continuously fails at the line until kubectl uncordon "$HOSTNAME"; do sleep 3; done as KUBECONFIG not set #1420

Open
realfresh opened this issue Mar 28, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@realfresh
Copy link

What did you do

  • How was the cluster created?
    • k3d cluster create --config "k3d.yaml"

My k3d.yaml config:

apiVersion: k3d.io/v1alpha5
kind: Simple
servers: 1
agents: 1
image: ${K_SERVER_IMAGE}
token: ${K_SERVER_TOKEN}
network: ${K_NET_NAME}
metadata:
  name: ${K_DEV_NAME}

env:
  - envVar: KUBECONFIG=/var/lib/rancher/k3s/agent/kubelet.kubeconfig
    nodeFilters:
      - agent:*
volumes:
  - volume: "${K_SERVER_VOLUME_SOURCE_0}:${K_NODE_VOLUME_TARGET}"
    nodeFilters:
      - server:*
  - volume: "${K_AGENT_VOLUME_SOURCE_0}:${K_NODE_VOLUME_TARGET}"
    nodeFilters:
      - agent:*

kubeAPI:
  host: "${K_SERVER_DOMAIN}"
  hostPort: "${K_SERVER_KUBEAPI_PORT}"
  hostIP: "0.0.0.0" # "127.0.0.1"

registries:
  config: |
    mirrors:
      "${K_REGISTRY_DOMAIN}":
        rewrite: {}
        endpoint:
          - http://${K_NET_IP_REGISTRY}:${K_REGISTRY_PORT}

hostAliases: []

options:
  k3d:
    wait: true
    timeout: "60s"
    disableLoadbalancer: true
    disableImageVolume: false
    disableRollback: false
  k3s:
    nodeLabels:
      - label: cloud.google.com/gke-nodepool=agent
        nodeFilters: ["agent:*"]
      - label: cloud.google.com/gke-nodepool=server
        nodeFilters: ["server:*"]

    extraArgs:
      - nodeFilters: ["server:*"]
        arg: "--disable=traefik"
      - nodeFilters: ["server:*"]
        arg: "--disable=servicelb"
      - nodeFilters: ["server:*"]
        arg: "--datastore-endpoint=${K_PG_URL}"

  kubeconfig:
    updateDefaultKubeconfig: false
    switchCurrentContext: false
  runtime:
    labels: []
    ulimits:
      - name: nofile
        soft: 2000000
        hard: 2000000
  • What did you do afterwards?
    • Nothing

What did you expect to happen

To see the agent logs be fine, instead it's plagued with:

E0328 11:09:48.838205     424 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0328 11:09:48.838726     424 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0328 11:09:48.840152     424 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0328 11:09:48.840786     424 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?

Which version of k3d

k3d version v5.6.0
k3s version v1.21.7-k3s1 (default)

I'm deploying k3s version 1.29.x


The problem is in the entrypoint script for a k3s agent node, at the line:

until kubectl uncordon "$HOSTNAME"; do sleep 3; done

That continuously fails, because $KUBECONFIG is not set, so it defaults to http:/localhost:8080. Not sure if I'm understanding the situation correctly but that seems to be it

@realfresh realfresh added the bug Something isn't working label Mar 28, 2024
@iwilltry42 iwilltry42 added this to the v5.7.0 milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants