Kubernetes
Before starting the Kubernetes (K8S) cluster, set ArcadeDB Server root password as a secret (replace <password> with the root password you want to use):
$ kubectl create secret generic arcadedb-credentials --from-literal=rootPassword='<password>'
This will set the password in the rootPassword environment variable. The ArcadeDB server will use this password for the root user.
Now you can start a Kubernetes cluster with 3 servers by using the default configuration:
$ kubectl apply -f config/arcadedb-statefulset.yaml
For more information on ArcadeDB Kubernetes config please check.
In order to scale up or down with the number of replicas, use this:
$ kubectl scale statefulsets arcadedb-server --replicas=<new-number-of-replicas>
Where the value of <new-number-of-replicas> is the new number of replicas. Example:
$ kubectl scale statefulsets arcadedb-server --replicas=3
Scaling up and down doesn’t affect current workload. There are no pauses when a server enters/exits from the cluster.
Helm Charts
To facilitate the deployment of ArcadeDB on a Kubernetes cluster a Helm chart can be used.
To install the template chart with the release name my-arcadedb enter:
helm install my-arcadedb ./arcadedb
The command deploys ArcadeDB on the Kubernetes cluster using the default configuration.
To uninstall/delete the my-arcadedb deployment:
helm uninstall my-arcadedb
The command removes all the Kubernetes components associated with the chart and deletes the release. Details about the configurable parameters of the template chart, as well as persistence, ingress, and resource, see the dedicated README.
Troubleshooting
The most common issue with using K8S is with the setting of the root password for the server (see at the beginning of this section).
Following are some useful commands for troubleshooting issues with ArcadeDB and Kubernetes.
Display the status of a pod:
$ kubectl describe pod arcadedb-0
Replace "arcadedb-0" with the server container you want to use.
To display the logs of the first server:
$ kubectl logs arcadedb-0
Replace "arcadedb-0" with the server container you want to use.
To remove all the containers and restart the cluster again, execute these 2 commands:
$ kubectl delete all --all --namespace default
$ kubectl apply -f config/arcadedb-statefulset.yaml