Project to run k8s cluster tests on Jmix 2+ app.
Common:
- JDK 21
- Docker
- kubectl
Rancher Desktop:
- Rancher Desktop installed and running with Kubernetes enabled
- Container engine:
dockerd (moby)so locally built images are shared with k3s rancher-desktopkubectl context available
Minikube:
- minikube with
qemu2driver - about 6 GB RAM and 2 CPUs
Remote cluster:
KUBECONFIG_CONTENTcontains the remote kubeconfig file contentkubetestcredexists injmix-cluster-tests
The tests use the remote cluster when the KUBECONFIG_CONTENT environment variable is set,
and the local kubeconfig otherwise.
If KUBECONFIG_CONTENT is set in your shell but the run must go to a local cluster, add
-DlocalCluster=true:
./gradlew test -DlocalCluster=true --tests io.jmix.samples.cluster2.TestRunner.clusterTestsTo forward the pod debug port 5006 to local ports starting from 50001, add
-DdebugPods=true.
Make sure Rancher Desktop is running and the rancher-desktop kubectl context exists. Then build the app image and deploy:
./rancher_cluster.shThe script does NOT push to the registry by default — k3s pulls the freshly built image directly from the shared local Docker daemon, and the deployment's
imagePullPolicy is patched to IfNotPresent at deploy time.
Rebuild and redeploy only (skip namespace/manifests re-apply):
./rancher_cluster.sh --skip-deployRun tests:
./gradlew test --tests io.jmix.samples.cluster2.TestRunner.clusterTestsCleanup cluster:
kubectl delete -f ./k8s --namespace=jmix-cluster-tests --ignore-not-found=true
kubectl delete namespace jmix-cluster-testsFull setup if the cluster is not installed yet:
./minikube_cluster.shOR: Rebuild and redeploy the image into an existing cluster:
./minikube_cluster.sh -rRun tests:
./gradlew test --tests io.jmix.samples.cluster2.TestRunner.clusterTestsPut the remote kubeconfig file content into KUBECONFIG_CONTENT, then run:
./remote_cluster.sh --apply
./gradlew test --tests io.jmix.samples.cluster2.TestRunner.clusterTests