A Kubernetes operator to deploy Xrootd at scale, in order to ease and fully automate deployment and management of XRootD clusters.
- Docker
- kubectl
- Access to a Kubernetes cluster:
- For production, use bare-metal clusters or public cloud platforms.
- For development, use local K8S Cluster
- Kind - use a simple script
- Or, K3S
- Configure kubectl to use relevant K8S Cluster
- Browse operatorhub.io and install xrootd-operator.
- Click on the "Install" button and follow the instructions.
- You can also install the operator using a release script, downloadable as an asset with each release.
- Either:
- Download the script,
install.sh
, manually and run it in a shell. - Run the script directly in bash:
OP_VERSION=0.2.1 # specify the intended version here bash <(curl -L https://github.com/xrootd/xrootd-k8s-operator/releases/download/$OP_VERSION/install.sh)
- Download the script,
- Same prerequisites for Installation
- Go v1.13+
- operator-sdk
- Run
make manager
to locally build operator binary andmake run
to run it against the configured Kubernetes cluster. - Run
make build
to build operator image from scratch and loads it in the k8s cluster. - The build command can be configured with the cluster's name and provider to target where the built operator image will be loaded. Set the following environment variables:
CLUSTER_PROVIDER=(kind/k3s/minishift)
CLUSTER_NAME=<cluster name>
- Run
make deploy
to deploy the operator image in the cluster, along with applying the required roles, service accounts etc. - To uninstall the CRDs, run
make uninstall
. To cleanup everything, including the operator deployment, runmake undeploy
.
Xrootd Operator is integrated with OLM and configured to use Bundle format.
- To generate OLM CSV manifests and bundle metadata, run
make bundle
. - To build the operator bundle image, run
make bundle-build
.
- Unit Tests: Run the unit tests with
make test
. - Integration Tests: Run the suite of e2e tests with
make test-e2e
.
- For local development, it's recommended to use CodeReady Containers since it supports Openshift v4+. Minishift is a suitable alternative, however it only supports till OpenShift v3.
- To test operator via scripted approach,
make deploy
works. - To test operator using OLM, follow testing guide for deployment using custom images.
TODO: Testing bundles is still not officially supported.
NOTE: Minishift uses Kubernetes v1.11.x, so it only supports till OLM v0.14.x (because later OLM versions uses apiextensions.k8s.io/v1 for CRD manifests)
- Make sure the xrootd-operator is up and runnning in your K8S cluster (otherwise follow Installation/Development steps):
- To check the status, run
kubectl describe pod -l name=xrootd-operator
- To check the status, run
- Example manifests to deploy Xrootd instance are at manifests folder.
- To apply any manifest, simply use
kubectl apply
:- For example, to apply base sample manifest, run
kubectl apply -k manifests/base
- For example, to apply base sample manifest, run
- Check operator logs:
kubectl logs -l name=xrootd-operator
- Create issue and if needed, provide operator logs too.