Skip to content
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

docs: merge installation docs #8499

Merged
merged 8 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 172 additions & 0 deletions docs/user_docs/installation/install-addons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
---
title: Install Addons
description: Install KubeBlocks addons with Helm
keywords: [addon, helm, KubeBlocks]
sidebar_position: 4
sidebar_label: Install Addons
---

# Install Addons
shanshanying marked this conversation as resolved.
Show resolved Hide resolved

With the release of KubeBlocks v0.8.0, Addons are decoupled from KubeBlocks and some Addons are not installed by default. If you want to use these Addons, install Addons first by index. Or if you uninstalled some Addons, you can follow the steps in this tutorial to install them again.

This tutorial takes etcd as an example. You can replace etcd with the Addon you need.

The official index repo is [KubeBlocks index](https://github.com/apecloud/block-index). Addons are maintained in the [KubeBlocks Addon repo](https://github.com/apecloud/kubeblocks-addons).

<Tabs>

<TabItem value="Helm" label="Install with Helm" default>

1. (Optional) Add the KubeBlocks repo. If you install KubeBlocks with Helm, just run `helm repo update`.

```bash
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update
```

2. View the Addon versions.

```bash
helm search repo kubeblocks/etcd --devel --versions
```

3. Install the Addon (take etcd as example). Specify a version with `--version`.

```bash
helm install etcd kubeblocks/etcd --namespace kb-system --create-namespace --version x.y.z
```

4. Verify whether this Addon is installed.

The STATUS is `deployed` and this Addon is installed successfully.

```bash
helm list -A
>
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
......
etcd kb-system 1 2024-10-25 07:18:35.294326176 +0000 UTC deployed etcd-0.9.0 v3.5.6
```

5. (Optional) You can run the command below to disable the Addon.

If you have created a related cluster, delete the cluster first.

```bash
helm uninstall etcd --namespace kb-system
```

</TabItem>

<TabItem value="kbcli" label="Install with kbcli">

1. View the index.

kbcli creates an index named `kubeblocks` by default and you can check whether this index is created by running `kbcli addon index list`.

```bash
kbcli addon index list
>
INDEX URL
kubeblocks https://github.com/apecloud/block-index.git
```

If the list is empty or you want to add your index, you can add the index manually by using `kbcli addon index add <index-name> <source>`. For example,

```bash
kbcli addon index add kubeblocks https://github.com/apecloud/block-index.git
```

If you are not sure whether the kubeblocks index is the latest version, you can update it.

```bash
kbcli addon index update kubeblocks
```

2. (Optional) Search whether the Addon exists in the index.

```bash
kbcli addon search etcd
>
ADDON VERSION INDEX
etcd 0.7.0 kubeblocks
etcd 0.8.0 kubeblocks
etcd 0.9.0 kubeblocks
```

3. Install the Addon.

If there are multiple index sources and versions for an Addon, you can specify an index by `--index` and a version by `--version`. The system installs the latest version in the `kubeblocks` index by default.

```bash
kbcli addon install etcd --index kubeblocks --version x.y.z
```

4. Verify whether this Addon is installed.

The STATUS is `Enabled` and this Addon is installed successfully.

```bash
kbcli addon list
>
NAME VERSION PROVIDER STATUS AUTO-INSTALL
etcd 0.9.0 apecloud Enabled true
```

5. (Optional) You can run the command below to disable the Addon.

If you have created a related cluster, delete the cluster first.

```bash
kbcli addon uninstall etcd
shanshanying marked this conversation as resolved.
Show resolved Hide resolved
```

:::note

kbcli supports enable/disable an Addon. When installing KubeBlocks by kbcli, some Addons are installed but remain disabled by default, with their status shown as `Disabled`. For example,

```bash
kbcli addon list
>
NAME VERSION PROVIDER STATUS AUTO-INSTALL
alertmanager-webhook-adaptor 0.1.4 apecloud Disabled false
apecloud-otel-collector 0.1.2-beta.3 apecloud Disabled false
aws-load-balancer-controller 1.4.8 community Disabled false
csi-driver-nfs 4.5.0 community Disabled false
csi-hostpath-driver 0.7.0 community Disabled false
grafana 6.43.5 community Disabled false
llm 0.9.0 community Disabled false
prometheus 15.16.1 community Disabled false
qdrant 0.9.1 community Disabled false
victoria-metrics-agent 0.8.41 community Disabled false
```

You can enable them according to your needs.

* Enable an Addon.

```bash
kbcli addon enable qdrant
```

* Disable an Addon.

```bash
kbcli addon disable qdrant
```

After enabling/disabling an Addon, check the Addon list to verify whether the Addon's status changes as required.

```bash
kbcli addon list
>
NAME VERSION PROVIDER STATUS AUTO-INSTALL
qdrant 0.9.1 community Enabled false
```

:::

</TabItem>

</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Install kbcli
description: Install kbcli
keywords: [install, kbcli,]
sidebar_position: 1
sidebar_position: 2
sidebar_label: Install kbcli
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
---
title: Install KubeBlocks
description: Install KubeBlocks on the existing Kubernetes clusters with Helm
keywords: [taints, affinity, tolerance, install, kbcli, KubeBlocks]
sidebar_position: 1
keywords: [taints, affinity, tolerance, install, kbcli, KubeBlocks, helm]
sidebar_position: 3
sidebar_label: Install KubeBlocks
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Install KubeBlocks
# Install KubeBlocks

KubeBlocks is Kubernetes-native, you can use Helm or kubectl with a YAML file to install it.
The quickest way to try out KubeBlocks is to create a new Kubernetes cluster and install KubeBlocks using the playground. However, production environments are more complex, with applications running in different namespaces and with resource or permission limitations. This document explains how to deploy KubeBlocks on an existing Kubernetes cluster.

KubeBlocks is Kubernetes-native, you can use Helm or kubectl with a YAML file to install it. You can also use kbcli, an intuitive CLI tool, to install KubeBlocks.

To try out KubeBlocks on your local host, you can use the [Playground](./../../try-out-on-playground/try-kubeblocks-on-your-laptop.md) or [create a local Kubernetes test cluster first](./../prerequisite/prepare-a-local-k8s-cluster.md) and then follow the steps in this tutorial to install KubeBlocks.

:::note

If you install KubeBlocks with Helm, to uninstall it, you have to use Helm too.
- Note that you install and uninstall KubeBlocks with the same tool. For example, if you install KubeBlocks with Helm, to uninstall it, you have to use Helm too.
- Make sure you have [kubectl](https://kubernetes.io/docs/tasks/tools/), [Helm](https://helm.sh/docs/intro/install/), or [kbcli](./install-kbcli.md) installed.

Make sure you have [kubectl](https://kubernetes.io/docs/tasks/tools/) and [Helm](https://helm.sh/docs/intro/install/) installed.
:::

## Environment preparation
Expand Down Expand Up @@ -64,9 +66,11 @@ Use Helm and follow the steps below to install KubeBlocks.
```bash
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/vx.y.z/kubeblocks_crds.yaml
```

You can view all versions of kubeblocks, including alpha and beta releases, on the [kubeblocks releases list](https://github.com/apecloud/kubeblocks/releases).

To get stable releases, use this command:

```bash
curl -s "https://api.github.com/repos/apecloud/kubeblocks/releases?per_page=100&page=1" | jq -r '.[] | select(.prerelease == false) | .tag_name' | sort -V -r
```
Expand Down Expand Up @@ -122,12 +126,55 @@ Like any other resource in Kubernetes, KubeBlocks can be installed through a YAM

</TabItem>

<TabItem value="kbcli" label="Install with kbcli">

The command `kbcli kubeblocks install` installs KubeBlocks in the `kb-system` namespace, or you can use the `--namespace` flag to specify one.

```bash
kbcli kubeblocks install
```

If you want to install KubeBlocks with a specified version, follow the steps below.

1. View the available versions.

```bash
kbcli kubeblocks list-versions
```

To include alpha and beta releases, use:

```bash
kbcli kb list-versions --devel --limit=100
```

Or you can view all available versions in [KubeBlocks Release](https://github.com/apecloud/kubeblocks/releases/).
2. Specify a version with `--version` and run the command below.

```bash
kbcli kubeblocks install --version=x.y.z
```

:::note

By default, when installing KubeBlocks, kbcli installs the corresponding version of KubeBlocks. It's important to ensure the major versions of kbcli and KubeBlocks are the same, if you specify a different version explicitly here.

For example, you can install kbcli v0.8.3 with KubeBlocks v0.8.1, but using mismatched major versions, such as kbcli v0.8.3 with KubeBlocks v0.9.0, may lead to errors.

:::

</TabItem>

</Tabs>

## Verify KubeBlocks installation

Run the following command to check whether KubeBlocks is installed successfully.

<Tabs>

<TabItem value="kubectl" label="kubectl" default>

```bash
kubectl -n kb-system get pods
```
Expand All @@ -149,3 +196,29 @@ prometheus-node-exporter-r6kvl 1/1 Running 0
prometheus-pushgateway-8555888c7d-xkgfc 1/1 Running 0 3m56s
prometheus-server-5759b94fc8-686xp 2/2 Running 0 3m56s
```

</TabItem>

<TabItem value="kbcli" label="kbcli">

```bash
kbcli kubeblocks status
```

***Result***

If the KubeBlocks Workloads are all ready, KubeBlocks has been installed successfully.

```bash
KubeBlocks is deployed in namespace: kb-system,version: x.y.z
>
KubeBlocks Workloads:
NAMESPACE KIND NAME READY PODS CPU(CORES) MEMORY(BYTES) CREATED-AT
kb-system Deployment kb-addon-snapshot-controller 1/1 N/A N/A Oct 13,2023 14:27 UTC+0800
kb-system Deployment kubeblocks 1/1 N/A N/A Oct 13,2023 14:26 UTC+0800
kb-system Deployment kubeblocks-dataprotection 1/1 N/A N/A Oct 13,2023 14:26 UTC+0800
```

</TabItem>

</Tabs>

This file was deleted.

52 changes: 0 additions & 52 deletions docs/user_docs/installation/install-with-helm/install-addons.md

This file was deleted.

Loading
Loading