Activity: Injecting Data into Applications

Scenario

You are assigned the task of making a Kubernetes installation for a simple application with self-awareness. In this installation, the application should collect all the runtime information from Kubernetes and write to its logs.

Aim

With the successful deployment, there should be a pod running in Kubernetes with only one container. In this container, all available runtime information should be injected as environment variables. Also, the application should log runtime information.

Prerequisites

Use the Kubernetes Downward API to collect runtime information.

Steps for Completion

  1. Create a pod definition with one container:
    • Define the environment variables from the Downward API.
    • Create a shell script to write the environment variables.
  2. Deploy the pod.
  3. Check the status of the pod.
  4. Check the logs of the container.

All of the code files for the activities in this chapter are provided on GitHub in the Lesson-1 folder at https://goo.gl/gM8W3p.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.47.203