diff --git a/.artifacthub/clickhouse-cluster-helm/artifacthub-repo.yml b/.artifacthub/clickhouse-cluster-helm/artifacthub-repo.yml index a00b703bb..3dbeb3a42 100644 --- a/.artifacthub/clickhouse-cluster-helm/artifacthub-repo.yml +++ b/.artifacthub/clickhouse-cluster-helm/artifacthub-repo.yml @@ -3,3 +3,9 @@ repositoryID: ebc56c06-8f5a-4e88-9289-78ad9efd9acd owners: - name: ClickHouse email: artifacthub-admin@clickhouse.com +# Charts built from every commit on main (X.Y.Z-N.) are pushed to the same OCI repository as releases. +# Artifact Hub picks the latest version by semver precedence, so without this rule it shows such a build, +# and not the latest release, as the default version of the package. +ignore: + - name: clickhouse-cluster-helm + version: '^\d+\.\d+\.\d+-' diff --git a/.artifacthub/clickhouse-operator-helm/artifacthub-repo.yml b/.artifacthub/clickhouse-operator-helm/artifacthub-repo.yml index cce76331f..a4e791003 100644 --- a/.artifacthub/clickhouse-operator-helm/artifacthub-repo.yml +++ b/.artifacthub/clickhouse-operator-helm/artifacthub-repo.yml @@ -3,3 +3,9 @@ repositoryID: 0bb8d2ba-64a2-4c71-9fac-4db152686131 owners: - name: ClickHouse email: artifacthub-admin@clickhouse.com +# Charts built from every commit on main (X.Y.Z-N.) are pushed to the same OCI repository as releases. +# Artifact Hub picks the latest version by semver precedence, so without this rule it shows such a build, +# and not the latest release, as the default version of the package. +ignore: + - name: clickhouse-operator-helm + version: '^\d+\.\d+\.\d+-' diff --git a/config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml b/config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml index 05b22e5e8..71fc16672 100644 --- a/config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml @@ -161,7 +161,48 @@ spec: description: | 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. - displayName: clickhouse-operator + + ## Features + + - **ClickHouse cluster management**: create, scale, upgrade, and reconfigure ClickHouse clusters with shards and replicas + - **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 of ClickHouse and Keeper clusters + - **Security**: TLS support for secure cluster communication + - **Monitoring**: Prometheus metrics for observability + + ## Getting started + + Create a Keeper cluster and a ClickHouse cluster that uses it: + + ```yaml + apiVersion: clickhouse.com/v1alpha1 + kind: KeeperCluster + metadata: + name: sample + spec: + replicas: 3 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi + --- + apiVersion: clickhouse.com/v1alpha1 + kind: ClickHouseCluster + metadata: + name: sample + spec: + replicas: 2 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi + keeperClusterRef: + name: sample + ``` + + See the [documentation](https://clickhouse.com/docs/clickhouse-operator/overview) for the guides and the API reference. + displayName: ClickHouse Operator icon: - base64data: PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiPgogIDxwYXRoIGQ9Ik0xODc1LjUzLDExODguNjljLTM5LjQ5LTUtMTA0Ljc3LTMuMDktMTQwLjIzLTE5LjI1LTEzLjQ4LTYuMTQtMTUuMjktMTkuMjktMjAuNzgtMjIuNjktMy40NC0yLjEyLTIxLjIxLTQuODUtMjEuOTYtNS43MSw3LjU0LTU1LjgxLDguMTgtMTEyLjE2LDIuMjUtMTY3LjcxLTExLjkyLTExMS44OS01MC40OC0yMjAuNDgtMTEyLjcyLTMxNC42LS4xNi0uOTcuMzUtMi4xLDEuMjctMy4zMiwzLjU3LTQuNywxMy4zNS0xMC44MSwxNS42LTE1LjIyLDIuNjEtNS4xM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zMuNjYsMCw2LjU5LDIuOTksNi41OSw2LjY1Wk0xMzc5Ljc0LDE0ODkuMTFjLTE0LjU0LDEyLjkxLTMyLjM5LDI4LjA2LTQ4LjQ2LDM4Ljc3LTMuNzQsMi40Ny0xNy4yMywxMy40OS0yMC40MywxMC42bC03LjA3LTE3Ljc3LTQyLjExLTEwNS43OWM2OS4yMy00OC41NSwxMjQuNDItMTE1Ljc0LDE1OC4yOS0xOTQuM2wxMTEuMzksMTkuMzUsMTMuMTgsMi4yOWMtMzQuMzYsOTQuNDItOTAuNTQsMTgwLjkyLTE2NC43OSwyNDYuODVaTTE1NzYuNDksMTA5Ny45M2wtMTIuMDEtMy41OS0xMDcuNzYtMzIuMjhjLjM5LTcuNjMuNTgtMTUuMy41OC0yMy4wMywwLTgxLjcyLTIxLjM3LTE1OC40NS01OC44MS0yMjQuOTFsODAuOS03NC43MywxNC43Ny0xMy42NWM0Ljk4LTEuMDcsMi45OSwxLjM0LDQuMTQsMy4yNSw2NC44MSwxMDguMjUsOTAuNzYsMjQyLjU5LDc4LjE5LDM2OC45NFoiLz4KPC9zdmc+ mediatype: image/svg+xml @@ -181,6 +222,10 @@ spec: keywords: - clickhouse - database + - keeper + - olap + - analytics + - sql links: - name: Sources url: https://github.com/ClickHouse/clickhouse-operator diff --git a/dist/chart-cluster/Chart.yaml b/dist/chart-cluster/Chart.yaml index a1f7ff5bd..cc534efe9 100644 --- a/dist/chart-cluster/Chart.yaml +++ b/dist/chart-cluster/Chart.yaml @@ -13,8 +13,22 @@ keywords: - database - clickhouse - keeper + - olap + - analytics maintainers: - name: ClickHouse Team email: operator@clickhouse.com home: https://github.com/ClickHouse/clickhouse-operator +sources: + - https://github.com/ClickHouse/clickhouse-operator icon: "https://clickhouse.com/docs/img/clickhouse-operator-logo.svg" +annotations: + artifacthub.io/category: database + artifacthub.io/license: Apache-2.0 + artifacthub.io/links: | + - name: Documentation + url: https://clickhouse.com/docs/clickhouse-operator/overview + - name: support + url: https://github.com/ClickHouse/clickhouse-operator/issues + artifacthub.io/recommendations: | + - url: https://artifacthub.io/packages/helm/clickhouse-operator/clickhouse-operator-helm diff --git a/dist/chart-cluster/README.md b/dist/chart-cluster/README.md new file mode 100644 index 000000000..9b2b75dac --- /dev/null +++ b/dist/chart-cluster/README.md @@ -0,0 +1,92 @@ +# ClickHouse cluster Helm chart + +This chart creates a [ClickHouse](https://clickhouse.com) cluster and a ClickHouse Keeper cluster managed by the [ClickHouse Operator](https://github.com/ClickHouse/clickhouse-operator), the official Kubernetes operator for ClickHouse. + +The chart only renders the `ClickHouseCluster` and `KeeperCluster` custom resources. +The operator does the provisioning, so install the [`clickhouse-operator-helm`](https://artifacthub.io/packages/helm/clickhouse-operator/clickhouse-operator-helm) chart first. + +## Prerequisites + +- Kubernetes 1.28 or later +- Helm 3.8 or later, for OCI registry support +- The ClickHouse Operator installed in the cluster, preferably the same version as this chart + +## Install + +```sh +helm install ch oci://ghcr.io/clickhouse/clickhouse-cluster-helm \ + --namespace clickhouse --create-namespace +``` + +Add `--version ` to install a specific release of the chart, and use the same version for the operator chart. + +By default the chart creates a Keeper cluster with three replicas and a ClickHouse cluster with one shard and three replicas, and points ClickHouse at that Keeper cluster. + +Check the result: + +```sh +kubectl --namespace clickhouse get clickhouseclusters,keeperclusters +``` + +## Configuration + +`clickhouse.spec` and `keeper.spec` are passed into the `ClickHouseCluster` and `KeeperCluster` resources as they are, so every field of the [API reference](https://clickhouse.com/docs/clickhouse-operator/reference/api-reference) can be set there. +The most commonly used values are listed below. +See [`values.yaml`](https://github.com/ClickHouse/clickhouse-operator/blob/main/dist/chart-cluster/values.yaml) for the full list. + +| Value | Default | Description | +|---|---|---| +| `imageTag` | `""` | Image tag of ClickHouse and ClickHouse Keeper. Defaults to the chart `appVersion`. | +| `global.imageRegistry` | `""` | Registry prefix prepended to every image rendered by the chart. | +| `clickhouse.enabled` | `true` | Create the `ClickHouseCluster` resource. | +| `clickhouse.image.repository` | `docker.io/clickhouse/clickhouse-server` | ClickHouse server image. | +| `clickhouse.meta.name` | `""` | Name of the `ClickHouseCluster`. Defaults to the release name. | +| `clickhouse.spec.shards` | `1` | Number of shards. | +| `clickhouse.spec.replicas` | `3` | Number of replicas in every shard. | +| `clickhouse.spec.dataVolumeClaimSpec` | unset | Persistent storage of the ClickHouse data. | +| `clickhouse.spec.settings` | `{}` | Configuration of the ClickHouse server. | +| `clickhouse.spec.externalKeeper` | unset | A Keeper ensemble that the operator doesn't manage. | +| `keeper.enabled` | `true` | Create the `KeeperCluster` resource. | +| `keeper.image.repository` | `docker.io/clickhouse/clickhouse-keeper` | ClickHouse Keeper image. | +| `keeper.meta.name` | `""` | Name of the `KeeperCluster`. Defaults to the release name. | +| `keeper.spec.replicas` | `3` | Number of Keeper replicas. | +| `keeper.spec.dataVolumeClaimSpec` | unset | Persistent storage of the Keeper data. | + +For example, to pin the version and request storage: + +```yaml +imageTag: "26.8" +clickhouse: + spec: + replicas: 2 + dataVolumeClaimSpec: + resources: + requests: + storage: 100Gi +keeper: + spec: + dataVolumeClaimSpec: + resources: + requests: + storage: 10Gi +``` + +```sh +helm install ch oci://ghcr.io/clickhouse/clickhouse-cluster-helm \ + --namespace clickhouse --create-namespace \ + --values values.yaml +``` + +## Uninstall + +```sh +helm uninstall ch --namespace clickhouse +``` + +## Documentation and support + +- [Overview](https://clickhouse.com/docs/clickhouse-operator/overview) +- [Introduction to the custom resources](https://clickhouse.com/docs/clickhouse-operator/guides/introduction) +- [Configuration guide](https://clickhouse.com/docs/clickhouse-operator/guides/configuration) +- [API reference](https://clickhouse.com/docs/clickhouse-operator/reference/api-reference) +- [Issues](https://github.com/ClickHouse/clickhouse-operator/issues) diff --git a/dist/chart/Chart.yaml b/dist/chart/Chart.yaml index 5650b4356..dacc3f1c3 100644 --- a/dist/chart/Chart.yaml +++ b/dist/chart/Chart.yaml @@ -10,8 +10,60 @@ description: | keywords: - database - clickhouse + - keeper + - operator + - olap + - analytics maintainers: - name: ClickHouse Team email: operator@clickhouse.com home: https://github.com/ClickHouse/clickhouse-operator +sources: + - https://github.com/ClickHouse/clickhouse-operator icon: "https://clickhouse.com/docs/img/clickhouse-operator-logo.svg" +annotations: + artifacthub.io/category: database + artifacthub.io/license: Apache-2.0 + artifacthub.io/operator: "true" + artifacthub.io/operatorCapabilities: Full Lifecycle + artifacthub.io/links: | + - name: Documentation + url: https://clickhouse.com/docs/clickhouse-operator/overview + - name: support + url: https://github.com/ClickHouse/clickhouse-operator/issues + artifacthub.io/recommendations: | + - url: https://artifacthub.io/packages/helm/clickhouse-cluster-helm/clickhouse-cluster-helm + artifacthub.io/crds: | + - kind: ClickHouseCluster + version: v1alpha1 + name: clickhouseclusters.clickhouse.com + displayName: ClickHouse Cluster + description: A ClickHouse cluster with the requested number of shards and replicas. + - kind: KeeperCluster + version: v1alpha1 + name: keeperclusters.clickhouse.com + displayName: Keeper Cluster + description: A ClickHouse Keeper cluster that ClickHouse uses for coordination. + artifacthub.io/crdsExamples: | + - apiVersion: clickhouse.com/v1alpha1 + kind: KeeperCluster + metadata: + name: sample + spec: + replicas: 3 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi + - apiVersion: clickhouse.com/v1alpha1 + kind: ClickHouseCluster + metadata: + name: sample + spec: + replicas: 2 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi + keeperClusterRef: + name: sample diff --git a/dist/chart/README.md b/dist/chart/README.md new file mode 100644 index 000000000..8e2227485 --- /dev/null +++ b/dist/chart/README.md @@ -0,0 +1,129 @@ +# ClickHouse Operator Helm chart + +The [ClickHouse Operator](https://github.com/ClickHouse/clickhouse-operator) is the official Kubernetes operator for [ClickHouse](https://clickhouse.com). +It automates the deployment, configuration, and management of ClickHouse clusters and ClickHouse Keeper clusters through the `ClickHouseCluster` and `KeeperCluster` custom resources. + +This chart installs the operator itself: the controller manager, the custom resource definitions, RBAC, and the admission webhooks. +To create a cluster, use the [`clickhouse-cluster-helm`](https://artifacthub.io/packages/helm/clickhouse-cluster-helm/clickhouse-cluster-helm) chart or apply the custom resources directly. + +## Prerequisites + +- Kubernetes 1.28 or later +- Helm 3.8 or later, for OCI registry support +- [cert-manager](https://cert-manager.io), which issues the certificates for the admission webhooks and the metrics endpoint in the default configuration + +## Install + +Install cert-manager if the cluster doesn't have it yet: + +```sh +helm install cert-manager oci://quay.io/jetstack/charts/cert-manager \ + --namespace cert-manager --create-namespace \ + --set crds.enabled=true +``` + +Install the operator: + +```sh +helm install clickhouse-operator oci://ghcr.io/clickhouse/clickhouse-operator-helm \ + --namespace clickhouse-operator-system --create-namespace +``` + +Add `--version ` to install a specific release of the chart. + +## Create a cluster + +With the cluster chart: + +```sh +helm install ch oci://ghcr.io/clickhouse/clickhouse-cluster-helm \ + --namespace clickhouse --create-namespace +``` + +Or with custom resources: + +```yaml +apiVersion: clickhouse.com/v1alpha1 +kind: KeeperCluster +metadata: + name: sample +spec: + replicas: 3 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi +--- +apiVersion: clickhouse.com/v1alpha1 +kind: ClickHouseCluster +metadata: + name: sample +spec: + replicas: 2 + dataVolumeClaimSpec: + resources: + requests: + storage: 1Gi + keeperClusterRef: + name: sample +``` + +Check the result: + +```sh +kubectl get clickhouseclusters,keeperclusters +``` + +More examples are in the [`examples`](https://github.com/ClickHouse/clickhouse-operator/tree/main/examples) directory. + +## Configuration + +The most commonly used values are listed below. +See [`values.yaml`](https://github.com/ClickHouse/clickhouse-operator/blob/main/dist/chart/values.yaml) for the full list. + +| Value | Default | Description | +|---|---|---| +| `controller.watchNamespaces` | `[]` | Namespaces to watch. Empty watches all namespaces. | +| `controller.pdbManagement.enabled` | `true` | Create and manage PodDisruptionBudgets for the clusters. | +| `controller.networkPolicyManagement.enabled` | `true` | Create and manage NetworkPolicies for the clusters. | +| `manager.replicas` | `1` | Number of controller manager replicas. | +| `manager.image.repository` | `ghcr.io/clickhouse/clickhouse-operator` | Controller manager image. | +| `manager.image.tag` | `""` | Image tag. Defaults to the chart `appVersion`. | +| `manager.resources` | see `values.yaml` | Resource requests and limits of the controller manager. | +| `global.imageRegistry` | `""` | Registry prefix prepended to every image rendered by the chart. | +| `rbac.namespaced` | `false` | Use a Role and RoleBinding in the release namespace, not cluster-wide RBAC. | +| `crd.enabled` | `true` | Install the custom resource definitions with the chart. | +| `crd.keep` | `true` | Keep the custom resource definitions when the chart is uninstalled. | +| `webhook.enabled` | `true` | Enable the admission webhooks. | +| `certManager.enabled` | `true` | Use cert-manager for the webhook and metrics certificates. | +| `metrics.enabled` | `true` | Expose the controller `/metrics` endpoint. | +| `metrics.secure` | `true` | Serve metrics over HTTPS with authentication and authorization. | +| `prometheus.enabled` | `false` | Create a Prometheus `ServiceMonitor`. Requires the Prometheus Operator. | +| `networkPolicy.enabled` | `false` | Restrict ingress to the metrics and webhook ports with NetworkPolicies. | + +To watch only the release namespace with namespace-scoped RBAC: + +```yaml +controller: + watchNamespaces: + - "{{ .Release.Namespace }}" +rbac: + namespaced: true +``` + +## Uninstall + +```sh +helm uninstall clickhouse-operator --namespace clickhouse-operator-system +``` + +While `crd.keep` is `true`, the custom resource definitions and the existing `ClickHouseCluster` and `KeeperCluster` resources stay in the cluster after the uninstall. + +## Documentation and support + +- [Overview](https://clickhouse.com/docs/clickhouse-operator/overview) +- [Install with Helm](https://clickhouse.com/docs/clickhouse-operator/install/helm) +- [Introduction to the custom resources](https://clickhouse.com/docs/clickhouse-operator/guides/introduction) +- [Configuration guide](https://clickhouse.com/docs/clickhouse-operator/guides/configuration) +- [API reference](https://clickhouse.com/docs/clickhouse-operator/reference/api-reference) +- [Issues](https://github.com/ClickHouse/clickhouse-operator/issues)