Validating the YAML in your custom resource file
About this task
A good check before you apply the custom resource (CR) is to validate the YAML is executable. The web has many tools that you can use, but YAML Lint is simple and reliable.
If you want to use a command line tool, yq is a lightweight tool to help you check your YAML files. For more information, see yq - portable yaml processor.
When yq is installed, you can run the following command to verify that the custom resource has no errors.
yq <custom-resource-file>.yaml
Procedure
- Go to YAML Lint.
- Copy and paste the contents of your CR file (without your security parameters) into the gray text box, and click Go.
Results
The tool reports whether the YAML is valid. If the YAML is valid, it strips out the comments and
displays the configuration in a UTF-8 format. Skim the configuration again and check for any values
that still show "<Required>"
. If you kept the comments in your CR, checking
it without these lines can make it easier to read.
If the YAML is not valid, the tool generates a message and indicates the line where the error is found.
What to do next
Correct any errors that are reported, and when your CR file has no errors make sure that the CR that you intend to use includes your security parameters.
Apply the CR by following the steps in Applying the custom resource manually.