-
Notifications
You must be signed in to change notification settings - Fork 797
Add url and token params for kubernetes templates #4505
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
Changes from all commits
de27ea8
49f81cf
0cbff88
6ad4fd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,8 +66,12 @@ See also <https://github.com/rootless-containers/usernetes>. | |
|
|
||
| A multi-node cluster can be created by creating multiple VMs connected via the [`lima:user-v2`](../../../config/network/user-v2.md) network. | ||
|
|
||
| As of Lima v2.0, the built-in `k8s` template is designed to support multi-node mode. | ||
| The following templates are designed to support multi-node mode: | ||
| - `k8s` (since Lima v2.0) | ||
| - `k3s` (since Lima v2.1) | ||
|
|
||
| {{< tabpane text=true >}} | ||
| {{% tab header="Lima v2.0" %}} | ||
| ```bash | ||
| limactl start --name k8s-0 --network lima:user-v2 template:k8s | ||
| limactl shell k8s-0 sudo kubeadm token create --print-join-command | ||
|
|
@@ -78,4 +82,33 @@ limactl shell k8s-0 sudo kubeadm token create --print-join-command | |
| limactl start --name k8s-1 --network lima:user-v2 template:k8s | ||
| limactl shell k8s-1 sudo bash -euxc "kubeadm reset --force ; ip link delete cni0 ; ip link delete flannel.1 ; rm -rf /var/lib/cni /etc/cni" | ||
| limactl shell k8s-1 sudo <JOIN_COMMAND_FROM_ABOVE> | ||
| ``` | ||
afbjorklund marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
| {{% /tab %}} | ||
| {{% tab header="Lima v2.1 (k8s)" %}} | ||
| ```bash | ||
| limactl start --name k8s-0 --network lima:user-v2 template:k8s | ||
| limactl shell k8s-0 sudo kubeadm token create --print-join-command | ||
| # (The parameters for the start command printed here) | ||
| ``` | ||
|
|
||
| ```bash | ||
| limactl start --name k8s-1 --network lima:user-v2 template:k8s \ | ||
| --set '.param.url="https://<ADDRESS_FROM_ABOVE>" | .param.token="<TOKEN_FROM_ABOVE>" | \ | ||
| .param.discoveryTokenCaCertHash="<DISCOVERY_TOKEN_CA_CERT_HASH_FROM_ABOVE>"' | ||
| ``` | ||
| {{% /tab %}} | ||
| {{% tab header="Lima v2.1 (k3s)" %}} | ||
| ```bash | ||
| limactl start --name k3s-0 --network lima:user-v2 template:k3s | ||
| printf "https://lima-%s.internal:6443\n" k3s-0 | ||
| # (The url for the start command printed here) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This printf does not seem needed?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is only needed when you change k3s-0, like in the test - but it was a workaround for the missing address i.e. the k3s node creation doesn't record the endpoint IP anywhere, so I resorted to constructing it myself |
||
| limactl shell k3s-0 sudo cat /var/lib/rancher/k3s/server/node-token | ||
| # (The token for the start command printed here) | ||
| ``` | ||
|
|
||
| ```bash | ||
| limactl start --name k3s-1 --network lima:user-v2 template:k3s \ | ||
| --set '.param.url="<URL_FROM_ABOVE>" | .param.token="<TOKEN_FROM_ABOVE>"' | ||
| ``` | ||
| {{% /tab %}} | ||
| {{< /tabpane >}} | ||
Uh oh!
There was an error while loading. Please reload this page.