| title | Arbiter |
|---|
The external-arbiter-operator (Arbiter) works with Rook-provisioned Ceph clusters to deploy external arbiters (monitors) that are not managed by Rook but that participate in consensus.
The operator also monitors the remote cluster to verify its availability and ensure that the tenant has sufficient permissions to handle the deployment of Arbiter.
The following tools are required on your development machine:
sedopensslmakegitgolanglima(or another method to provision Kubernetes locally, such as Minikube)kubectldocker(or any compatible container engine, such as Podman)helm
The remaining dependencies are provisioned via Go tools, including the Kubebuilder toolset.
What follows is a quick walkthrough on how to prepare the environment, run the operator locally, and deploy an external monitor.
# Clone the Rook repository: https://github.com/rook/rook
#Run `make deps`:
make deps
# Create OSD for Ceph
limactl disk create osd --size=8G
# Create VM instance
limactl create --name=k8s ./contrib/vm.yaml
# Start VM
limactl start k8s
# Use kubeconfig provided by VM
export KUBECONFIG="${HOME}/.lima/k8s/copied-from-guest/kubeconfig.yaml"# Install cert-manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.19.2/cert-manager.yaml
# Install Rook operator
kubectl apply -f ./rook/deploy/examples/crds.yaml
kubectl apply -f ./rook/deploy/examples/common.yaml
kubectl apply -f ./rook/deploy/examples/operator.yaml
kubectl apply -f ./rook/deploy/examples/csi-operator.yaml
# Create Ceph cluster
kubectl apply -f ./rook/deploy/examples/cluster-test.yaml
# (Optional) Install Ceph toolbox
kubectl apply -f ./rook/deploy/examples/toolbox.yaml# Build image
limactl shell k8s sudo nerdctl --namespace k8s.io build \
-t localhost:5000/cobaltcore-dev/external-arbiter-operator:latest \
-f ./Dockerfile .
# Dry run operator install via Helm
helm install --dry-run --create-namespace --namespace arbiter-operator \
--values ./contrib/charts/external-arbiter-operator/local.yaml \
arbiter-operator ./contrib/charts/external-arbiter-operator
# Install operator via Helm chart
helm install --create-namespace --namespace arbiter-operator \
--values ./contrib/charts/external-arbiter-operator/local.yaml \
arbiter-operator ./contrib/charts/external-arbiter-operator# Create namespace, user, role, rolebinding, kubeconfig and secret for arbiter
./hack/configure-k8s-user.sh
# Create secret with remote cluster access configuration
kubectl apply -f ./contrib/k8s/examples/secret.yaml -n arbiter-operator
# Create remote cluster resource
kubectl apply -f ./contrib/k8s/examples/remote-cluster.yaml -n arbiter-operator
# Create remote arbiter resource
kubectl apply -f ./contrib/k8s/examples/remote-arbiter.yaml -n arbiter-operator
# Watch until Arbiter is ready
kubectl get remotearbiter -n arbiter-operator -w
# Check that Arbiter has joined quorum
kubectl exec deployment/rook-ceph-tools -n rook-ceph -it -- ceph mon dump# Remove Helm chart
helm uninstall --namespace arbiter-operator arbiter-operator
# Stop VM
limactl stop k8s
# Delete VM
limactl delete k8sUseful make commands for development:
# Build binary
make
# Prettify project, run linters, etc.
make pretty
# Run tests
make test
# Regenerate Kubernetes resources
make gen
# Copy CRD definitions to Helm chart
make helmDeployment manifests are managed by Helm. The values.yaml file lists all
available configuration options.
The following example resources are provided:
secret.yaml- Kubeconfig secret for arbiter installationremote-cluster.yaml- RemoteCluster resource definitionremote-arbiter.yaml- RemoteArbiter resource definition
Before running the operator, ensure the following conditions are met:
- A Ceph cluster operated by Rook is already up and running on the source Kubernetes cluster
- Resources (pods, services) from the target (arbiter) cluster are reachable from the source (operator/Rook) cluster and vice versa
- Create a user on the target cluster.
- Create the target namespace on the target cluster.
- Grant the user permissions to manage deployments, secrets, configmaps, their statuses, and finalizers.
- Provision the target user kubeconfig on the source cluster via secret.
- Deploy the operator on the source cluster.
- Create a RemoteCluster resource on the source cluster, referencing the target user kubeconfig secret.
- Create a RemoteArbiter resource on the source cluster, referencing the RemoteCluster.
- Watch until resources are ready.
- Verify that the arbiter has joined the quorum by running
ceph mon dump.