Custom Installation Guide

How to install a customized clickhouse-operator

Users who need to customize their clickhouse-operator namespace or can not directly connect to Github from the installation environment can perform a custom install.


The clickhouse-operator for Kubernetes has the following requirements:


Script Install into Namespace

By default, the clickhouse-operator installed into the kube-system namespace when using the Basic Installation instructions. To install into a different namespace use the following command replacing {custom namespace here} with the namespace to use:

curl -s | OPERATOR_NAMESPACE={custom_namespace_here} bash

For example, to install into the namespace test-clickhouse-operator namespace, use:

curl -s | OPERATOR_NAMESPACE=test-clickhouse-operator bash
Setup ClickHouse Operator into 'test-clickhouse-operator' namespace
No 'test-clickhouse-operator' namespace found. Going to create
namespace/test-clickhouse-operator created configured configured configured
serviceaccount/clickhouse-operator created unchanged unchanged
configmap/etc-clickhouse-operator-files created
configmap/etc-clickhouse-operator-confd-files created
configmap/etc-clickhouse-operator-configd-files created
configmap/etc-clickhouse-operator-templatesd-files created
configmap/etc-clickhouse-operator-usersd-files created
deployment.apps/clickhouse-operator created
service/clickhouse-operator-metrics created

If no OPERATOR_NAMESPACE value is set, then the clickhouse-operator will be installed into clickhouse-operator.

Manual Install into Namespace

For organizations that can not access github directly from the environment they are installing the clickhouse-operator in, they can perform a manual install through the following steps:

  1. Download the install template file: clickhouse-operator-install-template.yaml.

  2. Edit the file and set OPERATOR_NAMESPACE value.

  3. Use the following commands, replacing {your file name} with the name of your YAML file:

    kubectl apply -f {your file name}

    For example:

    kubectl apply -f customtemplate.yaml

Alternatively, instead of using the install template, enter the following into your console (bash is used below, modify depending on your particular shell). Change the OPERATOR_NAMESPACE value to match your namespace.

# Namespace to install operator into
# Namespace to install metrics-exporter into

# Operator's docker image
# Metrics exporter's docker image

# Setup clickhouse-operator into specified namespace
kubectl apply --namespace="${OPERATOR_NAMESPACE}" -f <( \
    curl -s | \
        envsubst \

Verify Installation

To verify the clickhouse-operator is running in your namespace, use the following command:

kubectl get pods -n clickhouse-operator
NAME                                READY   STATUS    RESTARTS   AGE
clickhouse-operator-8cff468-qzp6k   2/2     Running   0          4s
Last modified 2021.12.14: PR updates and fixes.