how to combine mutiple images ( redis+memcache+python) into 1 single container in a pod

7/30/2019

how to combine multiple images (redis+ memcache +python) into 1 single container in a pod using kubectl command .

do we have any other option instead of creating custom docker image with all required image

-- Ramya S
docker
docker-image
kubectl
kubernetes

1 Answer

7/30/2019

Instead of this, you could run all three containers in a single Kubernetes pod, which is what I would recommend if they are tightly coupled.

It's a good idea to keep each container as small as it needs to be to do one thing.

Just add more containers to your pod spec...

apiVersion: v1
kind: Pod
metadata:
  name: example
spec:
  containers:
    - name: app
      image: python
      ports:
        - containerPort: 80
    - name: key-value-store
      image: redis
      ports:
        - containerPort: 6379
    - name: cache
      image: memcached
      ports:
        - containerPort: 9001
          name: or-whatever-port-memcached-uses

I wouldn't use a pod directly, but the same idea applies to pods created by deployments, daemonsets, etc.

-- switchboard.op
Source: StackOverflow