Skip to content

Commit

Permalink
Fix wrong controller port used for pre-generated tokens command
Browse files Browse the repository at this point in the history
The port number of controller used in the custom CA cert doc's pre-generated tokens section is wrong. It's using `6443`, that's for `kube-apiserver`. But what we need here is `9443` actually (the k0s-api). Took me a while debugging to find out that k0s is trying to join the controller server with a wrong port

Signed-off-by: Fang-Pen Lin <[email protected]>
  • Loading branch information
fangpenlin committed Sep 23, 2023
1 parent 1a260ef commit 9e0d9c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/custom-ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ k0s token pre-shared --role worker --cert /var/lib/k0s/pki/ca.crt --url https://

The command above generates a join token and a Secret. A Secret should be deployed to the cluster to authorize the token.
For example, you can put the Secret under the [manifest](manifests.md) directory and it will be deployed automatically.

Please note that if you are generating a join token for a controller, the port number needs to be 9443 instead of 6443.
Controller bootstrapping requires talking to the k0s-apiserver instead of the kube-apiserver.
Here's an example of a command for pre-generating a token for a controller.

```shell
k0s token pre-shared --role controller --cert /var/lib/k0s/pki/ca.crt --url https://<controller-ip>:9443/
```

0 comments on commit 9e0d9c6

Please sign in to comment.