Note We at AxonIQ are aware that many of our customers run Axon Server in Kubernetes or want to run it there. The files in this directory are to help you on your way, but be advised that a single StatefulSet
for a cluster is not the recommended way for a production deployment. For more information, please read this article.
The deploy-axonserver.sh
script will use the templates in this directory to generate de axonserver.properties
ConfigMap, license secret, system-token secret, and all deployment descriptors, given a service name and Kubernetes namespace.
To deploy using a "LoadBalancer
" service for the UI, use:
$ ./deploy-axonserver.sh axonserver test-ee
Generating files
Generating axonserver-ing.yml
Generating axonserver-sts.yml
Generating axonserver-svc.yml
Generating axonserver.properties
Creating Namespace if needed
namespace/test-ee created
Creating/updating Secrets and ConfigMap
secret/axoniq-license created
secret/axonserver-token created
configmap/axonserver-properties created
Deploying/updating StatefulSet
statefulset.apps/axonserver created
$ kubectl apply -f axonserver-svc.yml -n test-ee
service/axonserver-gui created
service/axonserver-enterprise created
$
To deploy with an Ingress, use:
$ ./deploy-axonserver.sh axonserver test-ee
Generating files
Generating axonserver-ing.yml
Generating axonserver-sts.yml
Generating axonserver-svc.yml
Generating axonserver.properties
Creating Namespace if needed
namespace/test-ee created
Creating/updating Secrets and ConfigMap
secret/axoniq-license created
secret/axonserver-token created
configmap/axonserver-properties created
Deploying/updating StatefulSet
statefulset.apps/axonserver created
$ kubectl apply -f axonserver-ing.yml -n test-ee
service/axonserver-gui created
service/axonserver created
ingress.networking.k8s.io/axonserver-enterprise created
$
The Ingress supplied maps to hostname "axonserver
", so please make sure that is defined in your hosts file. To create your first user, you can do the following:
$ ../../axonserver-cli.jar users -t $(cat ../../axonserver.token) -S http://axonserver:80
Name
$ ../../axonserver-cli.jar register-user -t $(cat ../../axonserver.token) -S http://axonserver:80 -u admin -p test -r ADMIN@_admin
$ ../../axonserver-cli.jar users -t $(cat ../../axonserver.token) -S http://axonserver:80
Name
admin
$
You can now login with username "admin
" and password "test
", and in the "Overview" tab watch how the cluster grows when you scale it to 3 nodes with:
$ kubectl scale sts axonserver -n test-ee --replicas=3
statefulset.apps/axonserver scaled
$