https://rancher.com/ logo
#general
Title
# general
n

narrow-action-54485

08/16/2022, 10:02 PM
Hi folks. I've been struggling trying to add an agent node to K3s cluster, seeing the following in journal when starting k3s-agent daemon:
Copy code
Aug 16 20:56:25 ip-xx-xx-xx-xx.us-east-2.compute.internal k3s[4056]: W0816 20:56:25.659366    4056 reflector.go:324] <http://k8s.io/client-go@v1.24.3-k3s1/tools/cache/reflector.go:167|k8s.io/client-go@v1.24.3-k3s1/tools/cache/reflector.go:167>: failed to list *v1.Endpoints: Get "<https://127.0.0.1:6444/api/v1/namespaces/default/endpoints?fieldSelector=metadata.name%3Dkubernetes&limit=500&resourceVersion=0>": net/http: TLS handshake timeout
Any ideas on what to try would be greatly appreciated.
t

tall-school-18125

08/16/2022, 10:29 PM
What command did you use to join the agent node? In order for the agent to connect, it needs the token to be passed in as described in this comment https://github.com/k3s-io/k3s/issues/1523#issuecomment-602098986
n

narrow-action-54485

08/16/2022, 10:33 PM
I used:
Copy code
curl -sfL <https://get.k3s.io> | K3S_URL=https://$K3S_URL:6443 K3S_TOKEN=$K3S_TOKEN sh -s -
and triple checked that $K3S_URL and $K3S_TOKEN are correctly set with values from the master node
b

brainy-postman-1566

08/16/2022, 11:09 PM
pretty sure the value of K3S_TOKEN should just be : K3S_TOKEN=$K3S_TOKEN when referencing an env var...
and of course always a good idea to ensure it resolves to the value you expect using echo $K3S_TOKEN in shell.
n

narrow-action-54485

08/16/2022, 11:13 PM
that's what I have: K3S_TOKEN=$K3S_TOKEN I think I got it, but in hacky way. This is on AWS EC2. I had the SG open up all traffic between the two nodes. However, something was still missing. After I opened all traffic from anywhere, it worked. Which is horrible practice of course, so I need to figure out which protocol/ports was missing specifically
b

brainy-postman-1566

08/16/2022, 11:23 PM
ah misread that. cool glad you figured it out 👍
t

tall-school-18125

08/17/2022, 6:36 AM
30 Views