Skip to content

Support multiple container in one pod for Kubernetes #62

@stevefan1999-personal

Description

@stevefan1999-personal

Synopsis

We tried to patch pod template before launching, but since ContainerProxy only assumed Docker use cases, that is, configurations are based on one container (as the majority are using Docker backend instead), but in Kubernetes we have one pod associate with multiple containers. This causes major headaches in configurating container specifications.

Use cases

We wanted to provide add-on services to include prebaked services such as MySQL, Postgres, Oracle databases, and sometimes Docker-in-Docker, or run multiple concurrent services in one ShinyProxy instance. Due to the current limitation, we are forced to create combinations of Docker images that contained those services, and launch the services via a customized init system inside the container. This is very clumsy and unnecessary, and using multiple containers/sidecars are way more elegant.

Workaround

There are no currently well known workaround. Pod patches will supposedly work, but the proxy config parameters from ShinyProxy itself (such as container-env and container-cmd) will not be effective.

Extra reason to consider

This will also benefit users who are using Docker Swarm as ShinyProxy clustering solution, since they can also use the Docker Stack as an analogy to Kubernetes Pod, so there are two birds in one stone.

Proposed solution

Let the user specify multiple containers when they are using K8S/Docker Swarm backend, example:

proxy:
  specs:
    - containers:
	  - image: php:7.4
	  - image: mycourse/comp1234/mysql:preloaded
	  - image: nginx
	    name: nginx
	    env: [{PORT: "8080"}]
      description: Application to demostrate multiple containers
      display-name: Hello Application
      id: 01_app_stack
      port: 8080 # this will associate with container-front-facing from then on
      container-front-facing: nginx # then ContainerProxy will search for container where containers[*].name == "nginx"

If the container backend is Docker, then throw an UnsupportedOperationException, since there is no way to run multiple containers in Docker container, yet but strictly speaking, it is possible if you use Docker namespace, that is, create multiple networks and spawn the pods there, and then delete the containers inside the network when the ShinyProxy instance terminates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions