The question is:
kubectl config use-context cluster1
In the ckad-multi-containers namespace, create a pod named tres-containers-pod, which has 3 containers matching the below requirements:
• The first container named primero runs busybox:1.28 image and has OR-DER=FIRST environment variable.
• The second container named segundo runs nginx:1.17 image and is exposed at port 8080.
• The last container named tercero runs busybox:1.31.1 image and has OR-DER=THIRD environment variable.
NOTE: All pod containers should be in the running state.
• Is the primero container running?
• Is the primero container use busybox:1.28 image?
• Is the primero container environment variable well configured?
• Does the segundo container running?
• Does the segundo container use nginx:1.17 image?
• Is the segundo container expose at port 8080?
• Is the tercero container running?
• Is the tercero container use busybox:1.31.1 image?
• Is the tercero container environment variable well configured?
And the recommended solution is:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: primero
name: tres-containers-pod
namespace: ckad-multi-containers
spec:
containers:
- env:
- name: ORDER
value: FIRST
image: busybox:1.28
name: primero
command: - /bin/sh
- -c
- sleep 3600;
resources: {}
- name: ORDER
- image: nginx:1.17
name: segundo
ports:- containerPort: 8080
resources: {}
- containerPort: 8080
- env:
- name: ORDER
value: THIRD
image: busybox:1.31.1
name: tercero
command: - /bin/sh
- -c
- sleep 3600;
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
- name: ORDER
I would like to know why the following solution not adequate is and why I got a CrashLoopBackOff error.
apiVersion: v1
kind: Pod
metadata:
name: tres-containers-pod
namespace: ckad-multi-containers
spec:
containers:
- name: primero
image: busybox:1.28
env:- name: ORDER
value: “FIRST”
- name: ORDER
- name: segundo
image: nginx:1.17
ports:- containerPort: 8080
- name: tercero
image: busybox:1.31.1
env:- name: ORDER
value: “THIRD”
- name: ORDER