With this exercise we will learn about the two different ways that you can break out a string into multiple lines within a YAML document, and explain what the functional difference is between the two different methods.
With the example below, you can see that we use the ">" character to tell YAML that we want to represent the the next few lines as a "single line" for the output. This means that new-line characters will not be preserved.
With the example below, you can see that we use the "|" character to tell YAML that we want to keep all new-lines (line breaks) for the output. Again, this means that new-line characters will be preserved.
-
Open the file
l1_e4.yaml
and supply the appripiate scalar (values) to the two keys provided. -
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-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.