Skip to content

Instantly share code, notes, and snippets.

@prongbang
Created April 28, 2024 03:42
Show Gist options
  • Save prongbang/c9237dac0ab60e549c315e04caa3a42f to your computer and use it in GitHub Desktop.
Save prongbang/c9237dac0ab60e549c315e04caa3a42f to your computer and use it in GitHub Desktop.
# Create a MicroK8s cluster
https://microk8s.io/docs/clustering
## Example
- Adding a node
```shell
microk8s add-node
```
- NOT THE NODE YOU RAN add-node FROM
```shell
From the node you wish to join to this cluster, run the following:
microk8s join 192.168.1.230:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05
Use the '--worker' flag to join a node as a worker not running the control plane, eg:
microk8s join 192.168.1.230:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05 --worker
If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join 192.168.1.230:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05
microk8s join 10.23.209.1:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05
microk8s join 172.17.0.1:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05
```
- Joining a node to the cluster should only take a few seconds. Afterwards
you should be able to see the node has joined:
```shell
microk8s kubectl get no
```
- Removing a node
```shell
microk8s leave
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment