The next primitave YAML data structure that we'll talk about is a sequence. One way of explaining what a sequence is, is that a sequence is YAML's way of organizing data in an array (or list depending on what your preferred programming language is).
Below are a few different way's that you can create a sequence:
---
MyHobbies:
- hiking
- fishing
- swimming
---
MyHobbies: ["hiking", "fishing", "swimming"]
---
AboutMe:
- InfoType: FirstName
Value: Mike
- InfoType: Age
Value: 30
- InfoType: Hobby
Value: Hiking
- InfoType: Hobby
Value: Fishing
- InfoType: Hobby
Value: Swimming
-
Open the file
l1_e3.yaml
and supply the appripiate scalar (values) to all the keys. -
Open the terminal within VS Code, press the following keys together:
ctrl + shift + `
-
Change directory to this exercise folder with the following command:
cd ~/Kubernetes_Labs/lab1/exercise-3
-
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.