canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.
https://microk8s.io
Apache License 2.0
8.5k stars 773 forks source link

LaunchConfiguration Documentation for join is not correct or misleading #4582

Open benkeil opened 3 months ago

benkeil commented 3 months ago

Summary

When following the documentation on how to join node via LaunchConfiguration, it's not clear how exactly the configuration must look like.

On the master node I have

persistentClusterToken: "32-char-token"

and on the worker nodes

join:
  url: "10.0.1.1:25000/32-char-token"
  worker: true

When joining the worker responds

$ sudo microk8s join 10.0.1.1:25000/32-char-token --worker
Contacting cluster at 10.0.1.1
Connection failed. Invalid token (500).

Here https://microk8s.io/docs/ref-launch-config is nothing written about a hash at the end of the URL, here https://github.com/canonical/microk8s-cluster-agent/blob/main/pkg/k8sinit/testdata/schema/full.yaml it is. What is the hash? How can I auto generate the Launch Configuration to allow joins?

What Should Happen Instead?

Reproduction Steps

Introspection Report

Can you suggest a fix?

Are you interested in contributing with a fix?

eaudetcobello commented 2 months ago

Hi @benkeil,

The hash at the end of the token is used to verify the identity of the joining node. It's optional and if it's absent, no verification is done. You can also specify it and not perform verification with the --skip-verify flag. I agree with you the documentation could be updated.

I think what happened in your case is that your persistent token was not correctly registered on the master node so any joins using this token result in a 500 error.

Could you please try the steps here? https://microk8s.io/docs/add-launch-config#h-1-when-deploying-a-cluster. You can either override the default configuration or use snap set.