Kubernetes CI application/Variable number of containers in a pod

10/6/2016

Use case:
This is a CI application where we want to run about 100 different test suites every 24 hours.
The test suites consist of a test client which communicates with test servers.
The test client runs a distinct script per suite and depending on the test suite there will be from 1 to 8 test servers.
The time needed for the suites varies from 5 minutes to 8 hours and I would like a fresh instantiation of the test client and test servers for each test suite run.
I have a Docker image for the test client and I can create Docker images on the fly for software which will be loaded on the test server i.e.. both test client test servers are Docker-able.

I think the combination of 1 test client and n test servers are nicely encapsulated in a pod and I can queue the 100 test suites to the pods and scale up the pods and hardware as needed.
Requests to the pod would indicate which test suite to run and the number of test servers.
What I do not have a grasp of is how to have the pod create the test client and test server containers.

Would a wrapper pod container which creates the test client and server containers work?

-- EricC
kubernetes

1 Answer

10/17/2016

You could have a look at Jobs (http://kubernetes.io/docs/user-guide/jobs/). Jobs are intended to be a one-off type run that allow you to run jobs that don't need to be running all the time like a service.

You can define the number of container that make up the job, then run that against the cluster. You might need some local scripts or tooling to help manage the different test suites / runs.

Also, you can now schedule jobs (in 1.4) to run at specific times: http://kubernetes.io/docs/user-guide/scheduled-jobs/

-- Steve Sloka
Source: StackOverflow