ArangoDB
ArangoDB is used for multiple backend services.
Prerequisites
- Have a
configured (kubectl access)
GKE access. - Setup cluster admin access.
- Setup custom storage class to use
SSD
disk. - This guide assumes only one ArangoDB server instance for each cluster.
Fresh Install
ArangoDB custom resource definition (CRD)
Version: 1.0.6
Install two charts, a CRD
and deployment controller
.
helm install https://github.com/arangodb/kube-arangodb/releases/download/1.0.6/kube-arangodb-crd-1.0.6.tgzhelm install https://github.com/arangodb/kube-arangodb/releases/download/1.0.6/kube-arangodb-1.0.6.tgz \--set=operator.features.deploymentReplications=false --namespace dictybase
In the second step we are disabling deployment replication.
Install arangodb server (single deployment)
helm repo updatehelm install dictybase/arangodb --namespace dictybase --set arangodb.dbservers.storageClass=fast \--set arangodb.single.storage=50Gi
Here we are using the custom storage class and have also
set up the storage space. ArangoDB version 3.6.5
is also installed by
default. To see what else you can customize, check out the chart
README.
Upgrade existing ArangoDB server
Upgrade server instance
By default the chart will install the ArangoDB version 3.6.5
. To use another,
pick a different version.
helm repo updatehelm upgrade [RELEASE NAME] dictybase/arangodb --set=image.tag=[VERSION] --namespace dictybase
Very important notes
- Storage space of the database can only be increased, decreasing it is not
possible (apparently PVC cannot be shrinked). The pod must be restarted to
increase the storage.
kubectl delete pod [POD NAME] -n dictybase
- Use the helm chart directly to upgrade for patch versions (3.6.3 -> 3.6.5). To upgrade the minor versions (3.6.5 -> 3.7.2), you should backup and restore the database content in addition to the Helm chart upgrade process.
Remove deployment (NOT CRD)
To upgrade the operator to the latest version with Helm, you have to delete the previous deployment and then install the latest.
HOWEVER: You must not delete the custom resource definitions (CRDs), or your ArangoDB deployments will be deleted!
Therefore, you have to use helm ls
to find the deployments for the
operator (kube-arangodb
) and use helm delete
to delete them using the
automatically generated deployment names. Here is an example of a helm list
output:
% helm lsNAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACEsteely-mule 1 Sun Mar 31 21:11:07 2019 DEPLOYED kube-arangodb-crd-1.0.6 defaultvetoed-ladybird 1 Mon Apr 8 11:36:58 2019 DEPLOYED kube-arangodb-1.0.6 default
So here, you would have to enter
helm delete vetoed-ladybird
Make sure not to delete steely-mule
. See official
README for
more information. If wanting to upgrade to several releases ahead, it is
advised to upgrade incrementally (i.e. 1.0.3
to 1.0.5
to 1.0.6
, etc.).
Upgrade CRD and install new Deployment
Upgrade the existing CRD (optional).
helm upgrade [RELEASE NAME] https://github.com/arangodb/kube-arangodb/releases/download/[VERSION]/kube-arangodb-crd-[VERSION].tgz
Next, install the operator for ArangoDeployment
while making sure to disable deployment replication.
helm install https://github.com/arangodb/kube-arangodb/releases/download/[VERSION]/kube-arangodb-[VERSION].tgz \--set=operator.features.deploymentReplications=false --namespace dictybase
Verify that everything is working as expected, then proceed to the next version. Repeat as necessary.
Create new databases (in existing server instance)
database:names:- annotation- auth- order- stockuser: georgepassword: costanzagrant: rw
helm install dictybase/arango-create-database --namespace dictybase -f config.yaml
Note: this chart is capable of creating both databases and users in one shot.
If the user george
in this example does not exist, this chart will create the
user and grant them rw
permissions for the databases listed. If the user does
exist, this will update their grant privileges to rw
or whatever you specify.
You can add more database names in the names
parameters as necessary. Existing
ones will be skipped and new ones will be created.