Print Environment Variables Task Failed

Hi @Inderpreet @kodekloud-support3 @KodeKloud

Could you please verify my work. I have done all the tasks correctly, still my work shows as failed.
email: ramashish.sharma@gmail.com

Attaching screenshots:
k7

Hello, ramashish.sharma
In the shared screenshot clearly mentioned it. Use command “echo” but mistakenly you added into the args field. That’s why task marked failed.

command:
     - echo
args:
  - <arguments>

Thanks for the input player001…

Feedback to @KodeKloud @Inderpreet

This question is really misleading, you see the sentence *Use command echo AND Configure args as",

so this question can be understood in two ways as per below.

  1. we have to use command “echo” and update in args.
  2. we have to directly use command “echo” and another args.

either add this as points
a. use command echo
b. use args to configure "Welcome… "

Hello,
This is my pod.yml

apiVersion: v1
kind: Pod
metadata:
  name: print-envars-greeting
spec:
  containers:
  - name: print-envars-container
    image: bash
    env:
    - name: GREETING
      value: "Welcome to"
    - name: COMPANY
      value: "Nautilus"
    - name: GROUP
      value: "Ltd"
    command: ["echo"]
    args: ["$(GREETING) $(COMPANY) $(GROUP)"]

It is not starting container “CrashLoopBackOff” error.
I tried command as ["/bin/echo"]
Tried it without command, including “echo” within args.
Container is not starting.
What might me the issue?
@mmumshad, @Inderpreet, @KodeKloud

Hello, @Mederbek
There is no issue. Task is only to set the environment variable. I think you can submit the task even pod is in “CrashLoopBackOff”. But make sure given data is in correct format.

1 Like

I really want to know, why it is giving “CrashLoopBackOff” and not starting container ? @Inderpreet, @KodeKloud

Hello, @Mederbek
Because we only gave the image “bash” and inside the “bash” image there is no parent process defined which keeps running the pod after creation. Same thing for the “busybox” image. But if you wanna see the different example, then you can choose the “nginx” image, where a parent process is defined inside the image and that it keeps running the pod after creation.
If you want the pod to be in a running condition for a time of period then you can assign command: [“sleep”, “10000”] in the pod.spec.containers!!
Below link will be helpful to you.

1 Like

Thanks @player001, guess it’s clear now.