Below are the exact words of a question that came up in an online test.
Create an single container app running in a pod named "bla-bla" with
any 3 of the four images listed below. Images: nginx + redis+
memcached.
I’m not sure whether this is a wordplay or a typo but what I would like to know is whether there is any syntax for launching multiple images in a single container? I know this can be done by having multiple containers within a single pod but according to the wordings in the question, I don’t think that is what they expect. I saw this same exact question in Kubernetes official forum but no answer there too. Hence posting it here so it can reach a wider audience.
Forum Question: https://discuss.kubernetes.io/t/can-we-have-a-single-container-with-multiple-image-like-nginx-redis-alpine/12017
2
Answers
If you are looking for a single command like "kubectl run bla-bla –image xyz" I dont think there is one.
Easiest way imo is to do something like that.
I don’t see the problem with the question. It asks to create a single "container app running in a pod", not a "single container".
So single pod with multiple containers is the answer. Here is the example.