The document lists commands and instructions for running XQA inside Kubernetes on Ubuntu 18.04 using microk8s.
sudo snap install microk8s --classic
sudo snap alias microk8s.kubectl kubectl
microk8s.enable dashboard registry istio
sudo microk8s.start
microk8s.status
sudo ufw default allow routed
# IP of dashboard
kubectl get all --all-namespaces | grep "service/kubernetes-dashboard"
# get token for login
kubectl -n kube-system get secret | grep "kubernetes-dashboard-token-"
# using: hex value - i.e. 95bt2
kubectl -n kube-system describe secret kubernetes-dashboard-token-<...>
cd xqa-documentaton/k8s
./pull.sh
./tag.sh
./push.sh
kubectl create namespace xqa
- cd xqa-documentaton/k8s
kubectl create -f xqa-00-db.yml
kubectl create -f xqa-00-message-broker.yml
kubectl create -f xqa-01-shard.yml
kubectl create -f xqa-02-db-amqp.yml
kubectl create -f xqa-02-ingest-balancer.yml
kubectl create -f xqa-02-query-balancer.yml
kubectl create -f xqa-02-query-ui.yml
# cluster IP's & ports for services
kubectl --namespace=xqa get svc
# pod IP's & ports
kubectl --namespace=xqa get ep
# assuming xqa-test-data cloned
docker run --name="xqa-ingest" -v $HOME/GIT_REPOS/xqa-test-data:/xml jameshnsears/xqa-ingest:latest -message_broker_host <xqa-message-broker cluster ip|pod ip> -path /xml
docker rm -f xqa-ingest
psql -h <cluster ip|pod ip> -p 5432 -U xqa -d xqa
select * from events;
http://<cluster ip|pod ip>:8161/
curl http://<xqa-query-balancer cluster ip|pod ip>:9090/xquery -X POST -H "Content-Type: application/json" -d '{"xqueryRequest":"count(/)"}'
http://<cluster ip|pod ip>
kubectl delete namespace xqa
sudo microk8s.reset
or
sudo microk8s.stop
sudo snap remove microk8s
snap unalias kubectl