This is a Kubernetes operator to manage Infinispan clusters.
- go 1.15 or higher.
- Docker | Podman
- Operator SDK 1.3.2
- A running Kubernetes cluster
For details on how to use the operator, please read the official operator documentation.
To build the go binary locally, execute:
make manager
To create a container and push to a remote repository execute:
make operator-build operator-push IMG=<image_name:tag>
By default the Makefile uses
docker
to create images. If another container tool is desired, this can be configured by settingCONTAINER_TOOL=podman
.
The following commands will generate and install the CRDs to the local cluster before starting the operator. To only execute the operator, simply omit the install
target.
To watch all namespaces:
make install run
To watch specific namespaces:
make install run WATCH_NAMESPACE=namespace1,namespace2
To deploy the operator to the cluster you're currently connected to, execute:
make deploy IMG=<image_name:tag> DEPLOYMENT_NAMESPACE=<namespace>
This will update the config/manager/manager.yaml
to utilise the specified image and will create all of the required
resources on the kubernetes cluster in the $DEPLOYMENT_NAMESPACE
namespace.
The OLM bundle manifests are created by executing make bundle VERSION=<latest-version>
.
This will create a bundle/
dir in your local repositoray containing the bundle metadata and manifests, as well as a
bundle.Dockerfile
for generating the image.
The bundle image can be created and pushed to a repository with:
make bundle-build bundle-push VERSION=<latest-version> IMG=<operator-image> BUNDLE_IMG=<bundle-image>
make unit-test
The different categories of integration tests can be executed with the following commands:
make test
make batch-test
make multinamespace-test
make backuprestore-test
The target cluster should be specified by exporting or explicitly providing KUBECONFIG
, e.g. make test KUBECONFIG=/path/to/admin.kubeconfig
.
The followin variables can be exported or provided as part of the make *test
call.
Variable | Purpose |
---|---|
TEST_NAME |
Specify a single test to run |
TESTING_NAMESPACE |
Specify the namespace/project for running test |
RUN_LOCAL_OPERATOR |
Specify whether run operator locally or use the predefined installation |
EXPOSE_SERVICE_TYPE |
Specify expose service type. NodePort | LoadBalancer | Route . |
PARALLEL_COUNT |
Specify parallel test running count. Default is one, i.e. no parallel tests enabled. |
Cross-Site tests require you to create two k8s Kind clusters or utilize already prepared OKD clusters:
$ source scripts/ci/configure-xsite.sh $KIND_VERSION $METALLB_VERSION
Actual $KIND_VERSION
and $METALLB_VERSION
values can be explored inside the Jenkinsfile
file
To test locally in running Kind clusters, run:
$ go test -v ./test/e2e/xsite/ -timeout 30m
TODO