Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 22.3 KB

README.md

File metadata and controls

37 lines (25 loc) · 22.3 KB

Exercise 2 - Make your first mapping

Exercise Description

YAML documents, at a high level, have three basic primatives (structures) that make up the structure of a YAML document:

  • Scalars (strings, numbers, dates, etc...)
  • Mappings (key/value pairs, hash maps, dictionaries)
  • and Sequences (lists, arrays)

In this exercise, we will practice creating some mappings. Below is a graphical example of some of the different types of mappings you can expect to see:

Mapping Examples

As you can see in the picture above, a mapping is essentially a key/value pair. The "value" can be either a sequence (this is something we talk about in the next exercise), a scalar, or another mapping.

Exercise Instructions

  1. Open the file l1_e2.yaml and supply the create three mappings that have the following requirements. (NOTE: Please make the mappings in the order as they are listed):

    1. Mapping with a key called MyName with an assigned scalar of type string.
    2. Mapping with a key called Age with an assigned scalar of type integer.
    3. Mapping with a key called HasHobbies with an assigned scalar of type boolean.
  2. Open the terminal within VS Code, press the following keys together: ctrl + shift + `

  3. Change directory to this exercise folder with the following command: cd ~/Kubernetes_Labs/lab1/exercise-2

  4. After supplying all the values, run the following command to check your work: ./check-work


After completing the this exercise, please click on the button below to go to the next exercise where you'll learn about sequences.
Next Exercise