Uploaded image for project: 'National Data Service'
  1. National Data Service
  2. NDS-104

Split out monolith Clowder Pod for scalability

XMLWordPrintableJSON

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • NDS Workshop 5
    • None
    • Development
    • None
    • CoreOS with K8

      NDS-82 provided us with a spec for a single large Kubernetes pod (group of Docker containers):

      apiVersion: v1
      kind: Pod
      metadata:
        name: test-clowder
        labels:
          name: clowder
      spec:
        containers:
          - name: clowder-mongodb
            image: mongo:latest
            ports:
              -  containerPort: 27017
                 name: "mongo-port"
          - name: clowder-rabbitmq
            image: rabbitmq:management
            ports:
              - containerPort: 5672
                name: "msg-bus"
              - containerPort: 15672
                name: "mgmt-port"
          - name: clowder-clowder
            image: clowder/clowder
            ports:
            - containerPort: 9000
              name: "clowder-ui"
            env:
            - name: SMTP_HOST
              value: "smtp.ncsa.illinois.edu"
            - name: CLOWDER_BRANCH
              value: "CATS-CORE0"
            - name: CLOWDER_BUILD
              value: "latestSuccessful"
            - name: CLOWDER_UPDATE
              value: "NO"
            - name: RABBITMQ_URI
              value: "amqp://guest:guest@localhost:5672/%2F"
            - name: RABBITMQ_EXCHANGE
              value: "clowder"
            - name: RABBITMQ_MGMT_PORT
              value: "15672"
          - name: clowder-image-preview
            image: clowder/image-preview
            env:
            - name: RABBITMQ_URI
              value: "amqp://guest:guest@localhost:5672/%2F"
            - name: RABBITMQ_EXCHANGE
              value: "clowder"
            - name: RABBITMQ_VHOST
              value: "%2F"
            - name: RABBITMQ_QUEUE
              value: "ncsa.image.preview"
            - name: RABBITMQ_PORT_5672_TCP_ADDR
              value: "127.0.0.1"
            - name: RABBITMQ_PORT_5672_TCP_PORT
              value: "5672"
            - name: RABBITMQ_PORT_15672_TCP_ADDR
              value: "127.0.0.1"
            - name: RABBITMQ_PORT_15672_TCP_PORT
              value: "15672"
          - name: clowder-video-preview
            image: clowder/video-preview
            env:
            - name: RABBITMQ_URI
              value: "amqp://guest:guest@localhost:5672/%2F"
            - name: RABBITMQ_EXCHANGE
              value: "clowder"
            - name: RABBITMQ_VHOST
              value: "%2F"
            - name: RABBITMQ_QUEUE
              value: "ncsa.video.preview"
            - name: RABBITMQ_PORT_5672_TCP_ADDR
              value: "127.0.0.1"
            - name: RABBITMQ_PORT_5672_TCP_PORT
              value: "5672"
          - name: clowder-plantcv
            image: clowder/plantcv
            env:
            - name: RABBITMQ_URI
              value: "amqp://guest:guest@localhost:5672/%2F"
            - name: RABBITMQ_EXCHANGE
              value: "clowder"
            - name: RABBITMQ_VHOST
              value: "%2F"
            - name: RABBITMQ_QUEUE
              value: "terra.plantcv"
            - name: RABBITMQ_PORT_5672_TCP_ADDR
              value: "127.0.0.1"
            - name: RABBITMQ_PORT_5672_TCP_PORT
              value: "5672"

      This story is complete when we have a set of configuration files that will bring up the necessary Replication Controller(s) and Service(s) in order to scale out this configuration properly.

      Necessary replication controllers (RCs):
      This is essentially settings up the environment that we would like Kubernetes to enforce. We specify a number of images (each with ports and/or environment variables to expose/inject) and Kubernetes ensures that they are always running. We can even, if we so choose, easily scale up the number of replicas of each type:

      • mongodb, replicas == 1: ensures that exactly one instance of MongoDB is always running
        • If the database is getting bogged down, this could potentially be scaled up
      • rabbitmq, replicas == 1: ensures that exactly one instance of RabbitMQ is always running
        • If queues are always full, this could potentially be scaled up
      • clowder, replicas == 1: ensures that exactly one instance of Clowder is always running
        • This can possibly be scaled up to handle multiple users, but that may rely on the internals of Clowder.
      • image-preview, replicas == 1: ensures that exactly one instance of the Image Preview Extractor is always running
      • video-preview, replicas == 1: ensures that exactly one instance of the Video Preview Extractor is always running
        • Extractors can be easily scaled up in this fashion simply by feeding in the new number of replicas to uphold.
      • plantcv, replicas == 1: ensures that exactly one instance of the PlantCV Extractor is always running.
        • This extractor is extraneous to the "Basic Clowder" setup.

      Necessary Services (SVCs):
      These are anything that will need to be accessed by another pod or externally from outside of the cluster.

      • rabbitmq: clowder and the image extractors need to be able to connect to RabbitMQ, and RabbitMQ needs to expose its management interface on port 15672 (by default)
      • mongodb: clowder needs to be able to connect to the running mongodb instance
      • clowder: clowder needs a service in order to expose its port 9000 web ui

      If anything above is incorrect or does not make any sense, please do not hesitate to let me know.

              lambert8 Sara Lambert
              lambert8 Sara Lambert
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: