Skip to content

Commit 4d8aab6

Browse files
Related Projects Page (k3s-io#211)
* Added 'Related Projects' page Daniel Lombardi <lombardi.daniel.o@gmail.com> Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
1 parent 40e7e02 commit 4d8aab6

File tree

4 files changed

+53
-25
lines changed

4 files changed

+53
-25
lines changed

docs/datastore/ha-embedded.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ Embedded etcd (HA) may have performance issues on slower disks such as Raspberry
1111
HA embedded etcd cluster must be comprised of an odd number of server nodes for etcd to maintain quorum. For a cluster with n servers, quorum is (n/2)+1. For any odd-sized cluster, adding one node will always increase the number of nodes necessary for quorum. Although adding a node to an odd-sized cluster appears better since there are more machines, the fault tolerance is worse since exactly the same number of nodes may fail without losing quorum but there are more nodes that can fail.
1212
:::
1313

14+
:::note
15+
To rapidly deploy large HA clusters, see [Related Projects](/related-projects)
16+
:::
17+
1418
An HA K3s cluster with embedded etcd is composed of:
1519

16-
* Three or more **server nodes** that will serve the Kubernetes API and run other control plane services, as well as host the embedded etcd datastore.
17-
* Optional: Zero or more **agent nodes** that are designated to run your apps and services
18-
* Optional: A **fixed registration address** for agent nodes to register with the cluster
20+
- Three or more **server nodes** that will serve the Kubernetes API and run other control plane services, as well as host the embedded etcd datastore.
21+
- Optional: Zero or more **agent nodes** that are designated to run your apps and services
22+
- Optional: A **fixed registration address** for agent nodes to register with the cluster
1923

2024
To get started, first launch a server node with the `cluster-init` flag to enable clustering and a token that will be used as a shared secret to join additional servers to the cluster.
2125

@@ -26,6 +30,7 @@ curl -sfL https://get.k3s.io | K3S_TOKEN=SECRET sh -s - server \
2630
```
2731

2832
After launching the first server, join the second and third servers to the cluster using the shared secret:
33+
2934
```bash
3035
curl -sfL https://get.k3s.io | K3S_TOKEN=SECRET sh -s - server \
3136
--server https://<ip or hostname of server1>:6443 \
@@ -48,11 +53,11 @@ Now you have a highly available control plane. Any successfully clustered server
4853
curl -sfL https://get.k3s.io | K3S_TOKEN=SECRET sh -s - agent --server https://<ip or hostname of server>:6443
4954
```
5055

51-
There are a few config flags that must be the same in all server nodes:
56+
There are a few config flags that must be the same in all server nodes:
5257

53-
* Network related flags: `--cluster-dns`, `--cluster-domain`, `--cluster-cidr`, `--service-cidr`
54-
* Flags controlling the deployment of certain components: `--disable-helm-controller`, `--disable-kube-proxy`, `--disable-network-policy` and any component passed to `--disable`
55-
* Feature related flags: `--secrets-encryption`
58+
- Network related flags: `--cluster-dns`, `--cluster-domain`, `--cluster-cidr`, `--service-cidr`
59+
- Flags controlling the deployment of certain components: `--disable-helm-controller`, `--disable-kube-proxy`, `--disable-network-policy` and any component passed to `--disable`
60+
- Feature related flags: `--secrets-encryption`
5661

5762
## Existing single-node clusters
5863

@@ -63,4 +68,3 @@ Available as of [v1.22.2+k3s1](https://github.com/k3s-io/k3s/releases/tag/v1.22.
6368
If you have an existing cluster using the default embedded SQLite database, you can convert it to etcd by simply restarting your K3s server with the `--cluster-init` flag. Once you've done that, you'll be able to add additional instances as described above.
6469

6570
If an etcd datastore is found on disk either because that node has either initialized or joined a cluster already, the datastore arguments (`--cluster-init`, `--server`, `--datastore-endpoint`, etc) are ignored.
66-

docs/datastore/ha.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ weight: 30
55

66
This section describes how to install a high-availability K3s cluster with an external database.
77

8+
:::note
9+
To rapidly deploy large HA clusters, see [Related Projects](/related-projects)
10+
:::
11+
812
Single server clusters can meet a variety of use cases, but for environments where uptime of the Kubernetes control plane is critical, you can run K3s in an HA configuration. An HA K3s cluster is composed of:
913

10-
* Two or more **server nodes** that will serve the Kubernetes API and run other control plane services
11-
* An **external datastore** (as opposed to the embedded SQLite datastore used in single-server setups)
12-
* Optional: Zero or more **agent nodes** that are designated to run your apps and services
13-
* Optional: A **fixed registration address** for agent nodes to register with the cluster
14+
- Two or more **server nodes** that will serve the Kubernetes API and run other control plane services
15+
- An **external datastore** (as opposed to the embedded SQLite datastore used in single-server setups)
16+
- Optional: Zero or more **agent nodes** that are designated to run your apps and services
17+
- Optional: A **fixed registration address** for agent nodes to register with the cluster
1418

1519
For more details on how these components work together, refer to the [architecture section.](../architecture/architecture.md#high-availability-k3s)
1620

@@ -19,9 +23,11 @@ For more details on how these components work together, refer to the [architectu
1923
Setting up an HA cluster requires the following steps:
2024

2125
### 1. Create an External Datastore
26+
2227
You will first need to create an external datastore for the cluster. See the [Cluster Datastore Options](datastore.md) documentation for more details.
2328

2429
### 2. Launch Server Nodes
30+
2531
K3s requires two or more server nodes for this HA configuration. See the [Requirements](../installation/requirements.md) guide for minimum machine requirements.
2632

2733
When running the `k3s server` command on these nodes, you must set the `datastore-endpoint` parameter so that K3s knows how to connect to the external datastore. The `token` parameter can also be used to set a deterministic token when adding nodes. When empty, this token will be generated automatically for further use.
@@ -52,6 +58,7 @@ Once you've launched the `k3s server` process on all server nodes, ensure that t
5258
The same example command in Step 2 can be used to join additional server nodes, where the token from the first node needs to be used.
5359

5460
If the first server node was started without the `--token` CLI flag or `K3S_TOKEN` variable, the token value can be retrieved from any server already joined to the cluster:
61+
5562
```bash
5663
cat /var/lib/rancher/k3s/server/token
5764
```
@@ -66,26 +73,25 @@ curl -sfL https://get.k3s.io | sh -s - server \
6673

6774
There are a few config flags that must be the same in all server nodes:
6875

69-
* Network related flags: `--cluster-dns`, `--cluster-domain`, `--cluster-cidr`, `--service-cidr`
70-
* Flags controlling the deployment of certain components: `--disable-helm-controller`, `--disable-kube-proxy`, `--disable-network-policy` and any component passed to `--disable`
71-
* Feature related flags: `--secrets-encryption`
76+
- Network related flags: `--cluster-dns`, `--cluster-domain`, `--cluster-cidr`, `--service-cidr`
77+
- Flags controlling the deployment of certain components: `--disable-helm-controller`, `--disable-kube-proxy`, `--disable-network-policy` and any component passed to `--disable`
78+
- Feature related flags: `--secrets-encryption`
7279

7380
:::note
7481
Ensure that you retain a copy of this token as it is required when restoring from backup and adding nodes. Previously, K3s did not enforce the use of a token when using external SQL datastores.
7582
:::
7683

77-
7884
### 4. Optional: Configure a Fixed Registration Address
7985

8086
Agent nodes need a URL to register against. This can be the IP or hostname of any server node, but in many cases those may change over time. For example, if running your cluster in a cloud that supports scaling groups, nodes may be created and destroyed over time, changing to different IPs from the initial set of server nodes. It would be best to have a stable endpoint in front of the server nodes that will not change over time. This endpoint can be set up using any number approaches, such as:
8187

82-
* A layer-4 (TCP) load balancer
83-
* Round-robin DNS
84-
* Virtual or elastic IP addresses
88+
- A layer-4 (TCP) load balancer
89+
- Round-robin DNS
90+
- Virtual or elastic IP addresses
8591

8692
See [Cluster Loadbalancer](./cluster-loadbalancer.md) for example configurations.
8793

88-
This endpoint can also be used for accessing the Kubernetes API. So you can, for example, modify your [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file to point to it instead of a specific node.
94+
This endpoint can also be used for accessing the Kubernetes API. So you can, for example, modify your [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file to point to it instead of a specific node.
8995

9096
To avoid certificate errors in such a configuration, you should configure the server with the `--tls-san YOUR_IP_OR_HOSTNAME_HERE` option. This option adds an additional hostname or IP as a Subject Alternative Name in the TLS cert, and it can be specified multiple times if you would like to access via both the IP and the hostname.
9197

docs/quick-start/quick-start.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ For information on how K3s components work together, refer to the [architecture
1313
New to Kubernetes? The official Kubernetes docs already have some great tutorials outlining the basics [here](https://kubernetes.io/docs/tutorials/kubernetes-basics/).
1414
:::
1515

16-
Install Script
17-
--------------
16+
## Install Script
17+
1818
K3s provides an installation script that is a convenient way to install it as a service on systemd or openrc based systems. This script is available at https://get.k3s.io. To install K3s using this method, just run:
19+
1920
```bash
2021
curl -sfL https://get.k3s.io | sh -
2122
```
2223

2324
After running this installation:
2425

25-
* The K3s service will be configured to automatically restart after node reboots or if the process crashes or is killed
26-
* Additional utilities will be installed, including `kubectl`, `crictl`, `ctr`, `k3s-killall.sh`, and `k3s-uninstall.sh`
27-
* A [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file will be written to `/etc/rancher/k3s/k3s.yaml` and the kubectl installed by K3s will automatically use it
26+
- The K3s service will be configured to automatically restart after node reboots or if the process crashes or is killed
27+
- Additional utilities will be installed, including `kubectl`, `crictl`, `ctr`, `k3s-killall.sh`, and `k3s-uninstall.sh`
28+
- A [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file will be written to `/etc/rancher/k3s/k3s.yaml` and the kubectl installed by K3s will automatically use it
2829

2930
A single-node server installation is a fully-functional Kubernetes cluster, including all the datastore, control-plane, kubelet, and container runtime components necessary to host workload pods. It is not necessary to add additional server or agents nodes, but you may want to do so to add additional capacity or redundancy to your cluster.
3031

@@ -33,6 +34,7 @@ To install additional agent nodes and add them to the cluster, run the installat
3334
```bash
3435
curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh -
3536
```
37+
3638
Setting the `K3S_URL` parameter causes the installer to configure K3s as an agent, instead of a server. The K3s agent will register with the K3s server listening at the supplied URL. The value to use for `K3S_TOKEN` is stored at `/var/lib/rancher/k3s/server/node-token` on your server node.
3739

3840
:::note
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Related Projects"
3+
weight: 10
4+
---
5+
6+
Projects implementing the K3s distribution are welcome additions to help expand the community. This page will introduce you to a range of projects that are related to K3s and can help you further explore its capabilities and potential applications.
7+
8+
These projects showcase the versatility and adaptability of K3s in various environments, as well as extensions of K3s.
9+
10+
## Bootstrapping a Multi-Node K3s cluster via Ansible
11+
12+
For users seeking to bootstrap a multi-node K3s cluster, we recommend the use of an Ansible script. This approach simplifies the process of setting up a K3s cluester by automating the installation and configuration of each node.
13+
14+
For this, take a look at [k3s-io/k3s-ansible](https://github.com/k3s-io/k3s-ansible) repository. These scripts provides a convenient way to install K3s on your nodes, allowing you to focus on the configuration of your cluster rather than the installation process.
15+
16+
This approach is particularly useful for creating a High Availability (HA) Kubernetes cluster, as it can be customized to suit the specific requirements of the cluster.

0 commit comments

Comments
 (0)