Source Build Guide - 0.18 and Up
For organizations who prefer to build the software directly from source code, they can compile the Altinity Kubernetes Operator for ClickHouse® and install it into a Docker container through the following process. The following procedure is available for versions of the operator 0.18.0 and up.
Binary Build
Binary Build Requirements
go-lang
compiler: Go.- Go
mod
Package Manager. - The source code from the Altinity Kubernetes Operator for ClickHouse repository. This can be downloaded using
git clone https://github.com/altinity/clickhouse-operator
.
Binary Build Instructions
-
Switch working dir to
clickhouse-operator
. -
Link all packages with the command:
echo {root_password} | sudo -S -k apt install -y golang
. -
Build the sources with
go build -o ./clickhouse-operator cmd/operator/main.go
.
This creates the Altinity Kubernetes Operator for ClickHouse binary. This binary is only used within a Kubernetes environment.
Docker Image Build and Usage
Docker Build Requirements
kubernetes
: https://kubernetes.io/docker
: https://www.docker.com/- Complete the Binary Build Instructions
Install Docker Buildx CLI plugin
-
Download Docker Buildx binary file releases page on GitHub
-
Create folder structure for plugin
mkdir -p ~/.docker/cli-plugins/
-
Rename the relevant binary and copy it to the destination matching your OS
mv buildx-v0.7.1.linux-amd64 ~/.docker/cli-plugins/docker-buildx
-
On Unix environments, it may also be necessary to make it executable with
chmod +x
:chmod +x ~/.docker/cli-plugins/docker-buildx
-
Set buildx as the default builder
docker buildx install
-
Create config.json file to enable the plugin
touch ~/.docker/config.json
-
Create config.json file to enable the plugin
echo "{"experimental": "enabled"}" >> ~/.docker/config.json
Docker Build Instructions
-
Switch working dir to
clickhouse-operator
-
Build docker image with
docker
:docker build -f dockerfile/operator/Dockerfile -t altinity/clickhouse-operator:dev .
-
Register freshly build
docker
image insidekubernetes
environment with the following:docker save altinity/clickhouse-operator | (eval $(minikube docker-env) && docker load)
-
Install the Altinity Kubernetes Operator for ClickHouse as described in either the Basic Build or Custom Build.