ExamGecko
Question list
Search
Search

List of questions

Search

Question 37 - CKA discussion

Report
Export

Create a pod that having 3 containers in it? (Multi-Container)

A.
See the solution below.
Answers
A.
See the solution below.
Suggested answer: A

Explanation:

image=nginx, image=redis, image=consul

Name nginx container as "nginx-container"

Name redis container as "redis-container"

Name consul container as "consul-container"

Create a pod manifest file for a container and append container section for rest of the images

kubectl run multi-container --generator=run-pod/v1 --image=nginx --

dry-run -o yaml > multi-container.yaml

# then

vim multi-container.yaml

apiVersion: v1

kind: Pod

metadata:

labels:

run: multi-container

name: multi-container

spec:

containers:

- image: nginx

name: nginx-container

- image: redis

name: redis-container

- image: consul

name: consul-container

restartPolicy: Always

asked 18/09/2024
BETTE SLETTER
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first