From 6c3fe9035f3a7c3326d9d6e245a127c1c9475256 Mon Sep 17 00:00:00 2001 From: manuelbuil Date: Wed, 18 Dec 2024 23:09:39 +0100 Subject: [PATCH] Expand on the datastore explanation Signed-off-by: manuelbuil --- docs/datastore/embedded.md | 43 +++++++++++++++++++ docs/datastore/external.md | 39 +++-------------- .../current/datastore/embedded.md | 1 + sidebars.js | 1 + 4 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 docs/datastore/embedded.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/datastore/embedded.md diff --git a/docs/datastore/embedded.md b/docs/datastore/embedded.md new file mode 100644 index 00000000..75dde106 --- /dev/null +++ b/docs/datastore/embedded.md @@ -0,0 +1,43 @@ +--- +title: Embedded datastore +--- + +Using an embedded datastore means leveraging a database that runs within the Kubernetes cluster, typically as a containerized service, e.g. etcd. This option simplifies deployment and could improve performance and security. The alternative is [external databases](external.md) + +## Datastore options + +:::warning Experimental +RKE2 officially supports Embedded etcd, embedded SQLite is considered experimental +::: + +* **Embedded [Etcd](https://etcd.io/)** + Embedded Etcd is the default datastore, and will be used if no other datastore configuration is present. +* **Embedded [SQLite](https://www.sqlite.org/index.html)** + SQLite cannot be used on clusters with multiple servers. It uses project [kine](https://github.com/k3s-io/kine) + + +## Single Server with SQLite + +### 1. Set `disable-etcd` without the `server` parameter in the config file + +```yaml +disable-etcd: true +``` + +### 2. Install RKE2 +```bash +curl -sfL https://get.rke2.io | sh - +``` + +### 3. Enable rke2-server service +```sh +systemctl enable rke2-server.service +``` + +### 4. start the rke2-server service + +```sh +systemctl start rke2-server.service +``` + +You can follow the server starting by `kubectl get nodes` to see the server get the `Ready` status. See [Cluster access](../cluster_access.md) for more info about how to access RKE2. \ No newline at end of file diff --git a/docs/datastore/external.md b/docs/datastore/external.md index 354bbdfd..dce39f46 100644 --- a/docs/datastore/external.md +++ b/docs/datastore/external.md @@ -1,19 +1,17 @@ --- -title: External DB +title: External datastore --- +Using an external datastore means leveraging a database that resides outside the Kubernetes cluster. Instead of being contained within the cluster, Kubernetes access the external datastore over the network. This approach could be common for organizations with existing database infrastructure or those who have more experience operating an enterprise-grade SQL database like MySQL or PostgreSQL. The project [kine](https://github.com/k3s-io/kine) is used for SQL databases. The alternative to external datastore is [embedded datastore](embedded.md). + ## Datastore options :::warning Experimental -RKE2 officially supports Embedded etcd, other external datastores are experimental. +RKE2 external datastores support is experimental. ::: -* **Embedded [Etcd](https://etcd.io/)** - Embedded Etcd is the default datastore, and will be used if no other datastore configuration is present. -* **Embedded [SQLite](https://www.sqlite.org/index.html)** - SQLite cannot be used on clusters with multiple servers. + * **External Database** - The following external datastores: * [etcd](https://etcd.io/) (certified against version 3.5.4) * [MySQL](https://www.mysql.com) (certified against versions 5.7 and 8.0) * [MariaDB](https://mariadb.org/) (certified against version 10.6.8) @@ -23,8 +21,6 @@ RKE2 officially supports Embedded etcd, other external datastores are experiment RKE2 requires prepared statements support from the DB. This means that connection poolers such as [PgBouncer](https://www.pgbouncer.org/faq.html#how-to-use-prepared-statements-with-transaction-pooling) may require additional configuration to work with RKE2. ::: -### SQLite Configuration Parameters -If you wish to use SQLite as the database for your RKE2 server, you must set `disable-etcd` option without a `server` option for RKE2 to knows that it needs to disable etcd and run with SQLite. ### External Datastore Configuration Parameters If you wish to use an external datastore such as PostgreSQL, MySQL, or etcd you must set the `datastore-endpoint` config so that RKE2 knows how to connect to it. You may also specify parameters to configure the authentication and encryption of the connection. The below table summarizes these options: @@ -85,31 +81,6 @@ As mentioned, the format of the value passed to the `datastore-endpoint` paramet -## Single Server with SQLite - -### 1. Set `disable-etcd` without the `server` parameter in the config file - -```yaml -disable-etcd: true -``` - -### 2. Install RKE2 -```bash -curl -sfL https://get.rke2.io | sh - -``` - -### 3. Enable rke2-server service -```sh -systemctl enable rke2-server.service -``` - -### 4. start the rke2-server service - -```sh -systemctl start rke2-server.service -``` - -You can follow the server starting by `kubectl get nodes` to see the server get the `Ready` status. See [Cluster access](../cluster_access.md) for more info about how to access RKE2. ## External database diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/datastore/embedded.md b/i18n/zh/docusaurus-plugin-content-docs/current/datastore/embedded.md new file mode 100644 index 00000000..16976aae --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/datastore/embedded.md @@ -0,0 +1 @@ +该页面尚未翻译 diff --git a/sidebars.js b/sidebars.js index 2afe3e61..8d7b0219 100644 --- a/sidebars.js +++ b/sidebars.js @@ -48,6 +48,7 @@ module.exports = { type: 'category', label: 'Datastore', items: [ + 'datastore/embedded', 'datastore/external', 'datastore/backup_restore', ],