Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 additions & 0 deletions docs/kubernetes-operator/01_overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
position: 1
slug: /clickhouse-operator/overview
title: 'ClickHouse Operator'
keywords: ['kubernetes']
description: 'Overview page for the ClickHouse Operator - a Kubernetes operator that automates the deployment, configuration, and management of ClickHouse clusters and ClickHouse Keeper clusters on Kubernetes.'
doc_type: 'guide'
sidebar_label: 'Overview'
---

The ClickHouse Operator is a Kubernetes operator that automates the deployment, configuration, and management of ClickHouse clusters and ClickHouse Keeper clusters on Kubernetes.
It provides declarative cluster management through custom resources, enabling users to easily create highly-available ClickHouse deployments.

The Operator handles the full lifecycle of ClickHouse clusters including scaling, upgrades, and configuration management.

## Features {#features}

- **ClickHouse Cluster Management**: Create and manage ClickHouse clusters
- **ClickHouse Keeper Integration**: Built-in support for ClickHouse Keeper clusters for distributed coordination
- **Storage Provisioning**: Customizable persistent volume claims with storage class selection
- **High Availability**: Fault tolerant installations for ClickHouse and Keeper clusters
- **Security**: Built-in security features TLS/SSL support for secure cluster communication
- **Monitoring**: Prometheus metrics integration for observability

## Installation {#installation}

Choose your preferred installation method:

- [Manifests Installation](./02_install/kubectl.mdx) - Install using kubectl/kustomize
- [Helm Installation](./02_install/helm.mdx) - Install using Helm charts
- [Operator Lifecycle Manager (OLM) Installation](./02_install/olm.mdx) - Install using OLM

## Guides {#guides}

- **[Introduction](./03_guides/01_introduction.mdx)** - General overview of ClickHouse Operator concepts
- **[Configuration Guide](./03_guides/02_configuration.mdx)** - Configure ClickHouse and Keeper clusters

## Reference {#reference}

- **[API Reference](./04_api_reference.mdx)** - Complete API documentation for custom resources
4 changes: 4 additions & 0 deletions docs/kubernetes-operator/02_install/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
position: 2
label: 'Install'
collapsible: true
collapsed: true
66 changes: 66 additions & 0 deletions docs/kubernetes-operator/02_install/helm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
slug: /clickhouse-operator/install/helm
title: 'Install the ClickHouse Operator with Helm'
keywords: ['kubernetes']
description: 'This guide covers installing the ClickHouse Operator using Helm charts.'
doc_type: 'guide'
sidebar_label: 'Helm'
---

This guide covers installing the ClickHouse Operator using Helm charts.

## Prerequisites {#prerequisites}

- Kubernetes cluster v1.33.0 or later
- Helm v3.0 or later
- kubectl configured to communicate with your cluster

## Install Helm {#install-helm}

If you don't have Helm installed:

```bash
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
```

Verify installation:

```bash
helm version
```

## Install the Operator {#install-the-operator}

:::note
By default Helm chart deploys ClickHouse Operator with webhooks enabled and requires cert-manager installed.
:::

### From OCI Helm repository {#from-oci-helm-repository}

Install the latest release
```bash
helm install clickhouse-operator oci://ghcr.io/clickhouse/clickhouse-operator-helm \
--create-namespace \
-n clickhouse-operator-system
```

Install a specific operator version
```bash
helm install clickhouse-operator oci://ghcr.io/clickhouse/clickhouse-operator-helm \
--create-namespace \
-n clickhouse-operator-system \
--set-json="manager.container.tag=<operator version>
```

### From Local Chart {#from-local-chart}

Clone the repository and install from the local chart:

```bash
git clone https://github.com/ClickHouse/clickhouse-operator.git
cd clickhouse-operator
helm install clickhouse-operator ./dist/chart
```

### Configuration options {#configuration-options}
For advanced configuration options, refer to the [values.yaml](https://github.com/ClickHouse/clickhouse-operator/blob/main/dist/chart/values.yaml) file in the Helm chart
92 changes: 92 additions & 0 deletions docs/kubernetes-operator/02_install/kubectl.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
slug: /clickhouse-operator/install/kubectl
title: 'Install the ClickHouse Operator with kubectl'
keywords: ['kubernetes']
description: 'This guide covers installing the ClickHouse Operator using kubectl and manifest files.'
doc_type: 'guide'
sidebar_label: 'kubectl'
---

This guide covers installing the ClickHouse Operator using kubectl and manifest files.

## Prerequisites {#prerequisites}

- Kubernetes cluster v1.33.0 or later
- kubectl v1.33.0 or later
- Cluster admin permissions

## Install from Release Manifests {#install-from-release-manifests}

:::note
Requires cert-manager to issue webhook certificates.
:::

Install the operator and CRDs from the latest release:

```bash
kubectl apply -f https://github.com/ClickHouse/clickhouse-operator/releases/download/latest/clickhouse-operator.yaml
```

This will:
1. Create the `clickhouse-operator-system` namespace
2. Install CustomResourceDefinitions (CRDs) for ClickHouseCluster and KeeperCluster
3. Create necessary ServiceAccounts, Roles, and RoleBindings
4. Deploy the operator controller manager
5. Register webhooks for resource validation and defaulting
6. Configure SSL certificates using cert-manager
7. Enable metrics endpoint

## Verify Installation {#verify-installation}

Check that the operator is running:

```bash
kubectl get pods -n clickhouse-operator-system
```

Expected output:
```
NAME READY STATUS RESTARTS AGE
clickhouse-operator-controller-manager-xxxxxxxxxx 1/1 Running 0 1m
```

Verify the CRDs are installed:

```bash
kubectl get crd | grep clickhouse.com
```

Expected output:
```
clickhouseclusters.clickhouse.com 2025-01-06T00:00:00Z
keeperclusters.clickhouse.com 2025-01-06T00:00:00Z
```

## Configure Custom Deployment Options {#configure-custom-deployment-options}

If you want to configure operator deployment options, follow the steps below.

### 1. Clone the Repository {#clone-the-repository}

```bash
git clone https://github.com/ClickHouse/clickhouse-operator.git
cd clickhouse-operator
```

### 2. Configure installation options {#configure-installation-options}

Edit config/default/kustomization.yaml to enable/disable features as needed.

* To disable webhooks, comment out the `[WEBHOOK]` and `[CERTMANAGER]` sections.
* To enable secure metrics endpoint, comment out `[METRICS]` sections and uncomment `[METRICS SECURE]` and `[CERTMANAGER]` sections.
* To enable ServiceMonitor for Prometheus Operator, uncomment the `[PROMETHEUS]` section.
* To enable operator network policies, uncomment the `[NETWORK POLICY]` section.

### 3. Build and Deploy {#build-and-deploy}

Build the operator manifests and apply them:

```bash
make build-installer VERSION=<required operator version> [IMG=<custom registry path>]
kubectl apply -k dist/install.yaml
```
99 changes: 99 additions & 0 deletions docs/kubernetes-operator/02_install/olm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
slug: /clickhouse-operator/install/olm
title: 'Install the ClickHouse Operator with Operator Lifecycle Manager (OLM)'
keywords: ['kubernetes']
description: 'This guide covers installing the ClickHouse Operator using kubectl and manifest files.'
doc_type: 'guide'
sidebar_label: 'OLM'
---

This guide covers installing the ClickHouse Operator using Operator Lifecycle Manager (OLM).

## Prerequisites {#prerequisites}

- Kubernetes cluster version 1.33.0 or later
- kubectl configured to access your cluster
- Cluster admin permissions
- Installed OLM (Operator Lifecycle Manager)

## Install OLM {#install-olm}

If OLM is not already installed in your cluster, install it:

```bash
# Check if OLM is installed
kubectl get ns olm

# If not installed, install OLM
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.28.0/install.sh | bash -s v0.28.0
```

## Install the Operator {#install-the-operator}

### Install from GitHub Catalog {#install-from-github-catalog}

```bash
# Create the operator namespace
kubectl create namespace clickhouse-operator-system

# Create a CatalogSource
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: clickhouse-operator-catalog
namespace: clickhouse-operator-system
spec:
sourceType: grpc
image: ghcr.io/clickhouse/clickhouse-operator-catalog:latest
displayName: ClickHouse Operator
publisher: ClickHouse
updateStrategy:
registryPoll:
interval: 30m
EOF

# Create the OperatorGroup
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: clickhouse-operator-group
namespace: clickhouse-operator-system
EOF

# Create the Subscription
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: clickhouse-operator
namespace: clickhouse-operator-system
spec:
channel: stable
name: clickhouse-operator
source: clickhouse-operator-catalog
sourceNamespace: clickhouse-operator-system
installPlanApproval: Automatic
EOF
```
## Uninstall {#uninstall}

```bash
# Delete the subscription
kubectl delete subscription clickhouse-operator -n clickhouse-operator-system
# Find all associated resources
kubectl get operator clickhouse-operator.clickhouse-operator-system -o=jsonpath="{.status.components.refs}" | jq 'map({kind, name})'
# Delete associated resources (CRDs, Deployments, etc.)
kubectl delete <resource> <name> [-n <namespace>] # Repeat for each resource found

# Delete the OperatorGroup (optional):
kubectl delete operatorgroup clickhouse-operator-group -n clickhouse-operator-system
# Delete the Operator view
kubectl delete operator clickhouse-operator.clickhouse-operator-system
```
More info about uninstalling can be found in the [OLM documentation](https://olm.operatorframework.io/docs/tasks/uninstall-operator/).

## Additional Resources {#additional-resources}

- [Operator Lifecycle Manager Documentation](https://olm.operatorframework.io/docs)
Loading