Manage Qserv deployment

Prerequisites

For all setups

  • Access to a Kubernetes v1.14.2+ cluster via a valid KUBECONFIG file.
  • Dynamic volume provisionning need to be available on the Kubernetes cluster (for example kind for or GKE).

For a development workstation

  • Ubuntu LTS is recommended

  • 8 cores, 16 GB RAM, 30GB for the partition hosting docker entities (images, volumes, containers, etc). Use df command as below to find its size.

    sudo df –sh /var/lib/docker # or /var/snap/docker/common/var-lib-docker/
    
  • Internet access without proxy

  • sudo access

  • Install dependencies below:

    sudo apt-get install curl docker.io git vim
    
  • Add current user to docker group and restart gnome session

    sudo usermod -a -G docker <USER>
    
  • Install Kubernetes locally using this simple k8s install script, based on kind.

Deploy qserv-operator

# Deploy qserv-operator in current namespace
curl -fsSL https://raw.githubusercontent.com/lsst/qserv-operator/master/deploy/qserv.sh | bash -s --install-kubedb

The --install-kubedb option enable qserv-operator to set-up a Redis cluster for managing its secondary index (OnjectID,ChunkId). It can be skipped for a regular Qserv installation.

Deploy a qserv instance

Deployments below are recommended for development purpose, or continuous integration. Qserv install customization is handled with Kustomize, which is a template engine allowing to customize kubernetes Yaml files. Kustomize is integrated with kubectl (-k option).

with default settings

# Install a qserv instance with default settings inside default namespace
kubectl apply -k https://github.com/lsst/qserv-operator/overlays/dev --namespace='default'

with a Redis cluster

# Install a qserv instance plus a Redis cluster inside default namespace
# This overlay is used on Travis-CI, o, top of kind
kubectl apply -k https://github.com/lsst/qserv-operator/ci-redis --namespace='default'

Undeploy a qserv instance

First list all Qserv instances running in a given namespace

kubectl get qserv -n "<namespace>"

It will output something like:

NAME            AGE
qserv   59m

Then delete this Qserv instance

kubectl delete qserv qserv -n "<namespace>"

To delete all Qserv instances inside a namespace:

kubectl delete qserv --all -n "<namespace>"

All qserv storage will remain untouch by this operation.

Deploy a qserv instance with custom settings

Example are available, see below:

# Install a qserv instance with custom settings
kubectl apply -k https://github.com/lsst/qserv-operator/overlays/ncsa_dev --namespace='qserv-prod'

In order to create a customized Qserv instance, create a Kustomize overlay using instructions below:

git clone https://github.com/lsst/qserv-operator.git
cd qserv-operator
cp -r overlays/dev/ overlays/<customized-overlay>

Then add custom setting, for example container image versions, by editing overlays/<customized-overlay>/qserv.yaml:

apiVersion: qserv.lsst.org/v1alpha1
kind: Qserv
metadata:
  name: qserv
spec:
  storageclass: "standard"
  storagecapacity: "1Gi"
  # Used by czar and worker pods
  worker:
    replicas: 3
    image: "qserv/qserv:ad8405c"
  replication:
      image: "qserv/replica:tools-w.2018.16-1171-gcbabd53"
      dbimage: "mariadb:10.2.16"
  xrootd:
    image: "qserv/qserv:ad8405c"

It is possible to use any recent Qserv image generated by Qserv Travis-CI

And finally create customized Qserv instance:

kubectl apply -k overlays/my-qserv/ --namespace='<namespace>'

Launch integration tests

./run-integration-tests.sh