You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

Order of Operations

  1. MongoDB must be running first
  2. Optional - If you intend on using search:
    1. Start ElasticSearch
  3. Optional - If you intend on using extractors:
    1. Next, start the RabbitMQ
    2. Start any extractors that you want
  4. Finally, start Clowder itself

Required Environment Variables

Default / acceptable values are in paranethesis.

These values are already specified inside of the controllers/*-controller.yaml files.

 

Clowder

The following environment variables MUST BE SET in order to start Clowder:

  • SMTP_HOST: (smtp.ncsa.illinois.edu) The SMTP server that Clowder should use to send e-mail
  • CLOWDER_BRANCH: (CATS-CORE0) Which branch should Clowder use to execute?
  • CLOWDER_BUILD: (latestSuccessful) Which build should Clowder use to execute?
  • CLOWDER_UPDATE: (NO) Whether or not to push updates back upstream
  • MONGO_URI: (mongodb://[user[:password]@]MONGO_SERVICE_IP_ADDR:PORT/clowder) The URI that should be used to connect to MongoDB
  • RABBITMQ_URI: (amqp://guest:guest@RABBIT_SERVICE_IP_ADDR:PORT/%2F) The URI that should be used to connect to RabbitMQ
  • RABBITMQ_EXCHANGE: (clowder) The name of the RabbitMQ exchange that should be used
  • RABBITMQ_MGMT_PORT: (15672) The port that should be used to access the management web UI for RabbitMQ

Extractors

The following environment variables MUST BE SET in order to start the extractors:

  • RABBITMQ_URI: (amqp://guest:guest@RABBIT_SERVICE_IP_ADDR:PORT/%2F) The URI that should be used to connect to RabbitMQ
  • RABBITMQ_EXCHANGE: (clowder) The name of the RabbitMQ exchange that should be used
  • RABBITMQ_VHOST: (%2F) The virtual host (URI segment) of RabbitMQ
  • RABBITMQ_QUEUE: (varies) The queue that this extractor should watch for work to do
  • RABBITMQ_PORT_5672_TCP_ADDR: (SERVICE_IP_ADDR) The address of RabbitMQ's message bus
  • RABBITMQ_PORT_5672_TCP_PORT: (5672) The port that RabbitMQ is using for its message bus
  • RABBITMQ_PORT_15672_TCP_ADDR: (SERVICE_IP_ADDR) The address of RabbitMQ's management interface
  • RABBITMQ_PORT_15672_TCP_PORT: (15672) The port that RabbitMQ is using for its management interface

Bootstrapping Clowder in Kubernetes

Step 0: Clone Source Repository

git clone https://github.com/nds-org/nds-labs
cd nds-labs/
git fetch --all
git checkout lambert-dev

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

Step 1: 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/

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 like this:

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

Step 2: Bring up any controllers (in order)

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

kubectl create -f controllers/phase-1

 

2.)  

Decide if you wish to use search, and run this command if you do:

kubectl create -f controllers/phase-2-optional/elasticsearch-controller.yaml

Decide if you want to use extractors, run this command as well, followed by commands to start your desired extractors:

kubectl create -f controllers/phase-2-optional/rabbitmq-controller.yaml
kubectl create -f controllers/phase-2-optional/extractors/EXTRACTOR-1-controller.yaml
kubectl create -f controllers/phase-2-optional/extractors/EXTRACTOR-2-controller.yaml
   .   .   .
kubectl create -f controllers/phase-2-optional/extractors/EXTRACTOR-N-controller.yaml

 

3.)  Run this command last to bring up Clowder itself:

kubectl create -f controllers/phase-3

Tip and Tricks

Scaling Extractors

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

kubectl scale --current-replicas=1 --replicas=2 rc clowder-image-preview

NOTE: --current-replicas is optional, but highly recommended when scaling down a controller.

Hot-swapping Extractors

Using the "Pseudo Pod Restart" technique requires a Replication Controller enforcing a particular pod configuration. Simply take the RC name (clowder-clowder) and the current number of replicas as N and use the command below:

kubectl scale --current-replicas=N --replicas=N rc clowder-clowder

NOTE: In order to avoid needlessly changing the current configuration, we recommend fixing --replicas == --current-replicas, but this need not be true if you intend to scale up the controller anyways.

 

  • No labels