k3d-io/k3dWhich version of

Do you want to work on this issue?
You can request for a bounty in order to promote it!
[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
realfresh posted onGitHub
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