Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TODO: Once this is pushed up to master, remove the "checkout" step.

Step 1: Bring up an empty cluster

From the project root, execute the following command to bring up a blank cluster:

. ./cluster/k8s/localdev/kube-up-local.sh

Step 2: Bring up all services

This step MUST be done before the controllers can be started. Create the 3 necessary services using the following command:

kubectl create -f services/

Why must this be done first?

Starting these services creates a bunch of environment variables containing ip/port/protocol of the service that are then injected into controllers/pods that match the selector. Any pods started after these services will have these environment variables injected into their pod's environment. This allows us to set values in the controller specification(s) like this one, for example:

        - name: RABBITMQ_URI
          value: "amqp://guest:guest@$(CLOWDER_RABBITMQ_PORT_5672_TCP_ADDR):$(CLOWDER_RABBITMQ_PORT_5672_TCP_PORT)/%2F"

Step

...

3: Bring up any controllers (in order)

1.)  To bring up a MongoDB controller and pod, run the following command:

kubectl create -f controllers/mongodb-controller.yaml

 

2a.)  (Optional)  Run Run this command to start ElasticSearch

...

kubectl create -f controllers/clowder-controller.yaml

Step 4: Clowder GUI

Wait a minute or so for Clowder to start. Once it has started, you should be able to navigate your browser to port 30291 of your OpenStack VM's IP.

Clowder's controller specification describes a "NodePort" (port 30291) that exposes our cluster to the public internet.

Stopping the Cluster

To shut down the cluster, simply perform all steps above in reverse with delete instead of create.

From the services/ncsa/clowder, execute the following commands to shut down the whole cluster:

kubectl delete -f controllers/
kubectl delete -f services/
cd ../../..
. ./cluster/k8s/localdev/kube-down-local.sh

Tip and Tricks

Helper Scripts

A few helper scripts are available in ${baseDir}/cluster/k8s/localdev/ to assist with debugging pods.

These scripts assume:

  • The entire cluster is running locally
  • Only a single pod replica per controller 
  • Containers inside of controlled pods must have a name that matches the pod's template
    • For example, if RC creates pods that named clowder-clowder-HASH, the scripts can only attempt to read the clowder-clowder container within this pod.

env.sh

A naive script to save some typing whilst debugging service/pod linkage, this script will print any environment variables present in the target container.

Example usage:

. env.sh clowder-clowder

The above command will locate the clowder-clowder-* pod and, assuming there is only one, print out the environment variable's from the clowder-clowder container within the pod.

exec.sh

A naive script to save some typing whilst debugging service/pods in general, this script will execute an arbitrary command in the target container.

Example usage:

. exec.sh clowder-clowder "curl -L localhost:9000"

The above command will locate the clowder-clowder-* pod and, assuming there is only one, will execute the given command inside of the clowder-clowder container within the pod.

logs.sh

A naive script to save some typing whilst debugging service/pods in general, this script will execute an arbitrary command in the target container.

Example usage:

. logs.sh clowder-clowder

The above command will locate the clowder-clowder-* pod and, assuming there is only one, will execute the given command inside of the clowder-clowder container within the pod.

Scaling Extractors

Use the following command to scale up or down an extractor on the fly:

...