YAML’s official definition is a “human-friendly, data serialization standard for all programming languages.” YAML’s main advantage over other similar formats like JSON or XML is its human readability. YAML was specifically designed to be easily readable and editable by humans. This makes it ideal for dual human-machine use cases such as log files, configuration files, inter-process messages, and in this case, also for Kubernetes config and definition files.
In Yaml we need to know 3 types of structure - String, Listing, and Mapping, It is written in key-value format.
Normal method Pod creation:-
With the help of --dry-run we can get the information of yaml from etcd, it will not execute the instruction.
We have created test pod and redirected the output in pod.yml and , when we run pod.yml file in API , we get test pod created.
Create a pod named sachin using the File method in namespace kube-system:-
pod.yml file:-
API understands the instructions based on api-resources as per the table below, API will be communicated based on versions v1 during the resource development, we can not run api-version as v2 for kind pod /etc.
kubectl explain pod - will give you the complete information regarding api-version, listing, mapping , string operations of Yaml, We can get the complete information with this command.
the following configuration file creates two containers: a redis
key-value store image, and a django
frontend image.
Thanks for visting on Hashnode for reading the blog, Hope this find useful.