100-Days-Of-DevOps-Challenge-KodeKloud

Print Environment Variables

The Nautilus DevOps team is working on to setup some pre-requisites for an application that will send the greetings to different users. There is a sample deployment, that needs to be tested. Below is a scenario which needs to be configured on Kubernetes cluster. Please find below more details about it.

Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.

Steps

  1. Create a k3s-pod.yml using this YAML file
  2. Let’s run the following command to create the pod:

     kubectl apply -f k3s-pod.yml
    
  3. Verify results

     kubectl logs -f print-env-greeting
    

    It should print the environment variables as per command we have used in the container

Good to Know?

Environment Variables

Variable Sources

Best Practices

Pod Lifecycle