Articles → DOCKER → Create A Pod With Multiple Images In Kubernetes

Create A Pod With Multiple Images In Kubernetes






Prerequisite




  1. Kind tool
  2. Create a multinode cluster
  3. Install Kubectl using the following command: -
snap install kubectl --classic




  1. Install Kubeadm
  2. Create the control-plane node using the kubeadm init command
  3. Create the worker node(s) using the kubeadm join command



Create A Pod With Multiple Images




apiVersion: v1
kind: Pod
metadata:
  name: python-redis-pod
spec:
  containers:
  - name: python-container
    image: python:3.9
    command: ["python", "-c"]
    args:
      - |
        import time
        while True:
          print("Python Application is running")
          time.sleep(5)

  - name: redis-container
    image: redis:latest
    ports:
    - containerPort: 6379




kubectl apply -f python-redis-pod.yaml




Picture showing creating the pod with multiple image using the kubectl apply command




Picture showing the pod is created with multiple images



Posted By  -  Karan Gupta
 
Posted On  -  Thursday, February 8, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250