Verify clickhouse-operator-install-bundle.yaml file availability.
In is located in deploy/operator
folder inside clickhouse-operator
sources.
Operator installation process is quite straightforward and consists of one main step - deploy ClickHouse operator. We'll apply operator manifest directly from github repo
kubectl apply -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator/clickhouse-operator-install-bundle.yaml
The following results are expected:
customresourcedefinition.apiextensions.k8s.io/clickhouseinstallations.clickhouse.altinity.com created
serviceaccount/clickhouse-operator created
clusterrolebinding.rbac.authorization.k8s.io/clickhouse-operator created
deployment.apps/clickhouse-operator configured
Operator is deployed in kube-system namespace
kubectl get pods --namespace kube-system
Expected results:
NAME READY STATUS RESTARTS AGE
...
clickhouse-operator-5c46dfc7bd-7cz5l 1/1 Running 0 43m
...
Let's walk over all resources created along with ClickHouse operator, which are:
- Custom Resource Definition
- Service account
- Cluster Role Binding
- Deployment
customresourcedefinition.apiextensions.k8s.io/clickhouseinstallations.clickhouse.altinity.com created
New Custom Resource Definition named ClickHouseInstallation is created.
k8s API is extended with new kind ClickHouseInstallation
and we'll be able to manage k8s resource of kind: ClickHouseInstallation
serviceaccount/clickhouse-operator created
New Service Account named clickhouse-operator is created.
A service account provides an identity used to contact the apiserver
by the processes that run in a Pod.
Processes in containers inside pods can contact the apiserver
, and when they do, they are authenticated as a particular Service Account
- clickhouse-operator
in this case.
clusterrolebinding.rbac.authorization.k8s.io/clickhouse-operator created
New CluserRoleBinding named clickhouse-operator is created. A role binding grants the permissions defined in a role to a set of users. It holds a reference to the role being granted to the list of subjects (users, groups, or service accounts). In this case Role
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
is being granted to
subjects:
- kind: ServiceAccount
name: clickhouse-operator
namespace: kube-system
clickhouse-operator
Service Account created earlier.
Permissions are granted cluster-wide with a ClusterRoleBinding
.
deployment.apps/clickhouse-operator configured
New Deployment named clickhouse-operator is created.
ClickHouse operator app would be run by this deployment in kube-system
namespace.
Check Custom Resource Definition
kubectl get customresourcedefinitions
Expected result
NAME CREATED AT
...
clickhouseinstallations.clickhouse.altinity.com 2019-01-25T10:17:57Z
...
Check Service Account
kubectl get serviceaccounts -n kube-system
Expected result
NAME SECRETS AGE
...
clickhouse-operator 1 27h
...
Check Cluster Role Binding
kubectl get clusterrolebinding
Expected result
NAME AGE
...
clickhouse-operator 31m
...
Check deployment
kubectl get deployments --namespace kube-system
Expected result
NAME READY UP-TO-DATE AVAILABLE AGE
...
clickhouse-operator 1/1 1 1 31m
...