YAML (Yet Another Markup Language) is a superset of JSON, which means that it has all the functionality of JSON, but it also extends this functionality to some degree. It is very strict about the indentations
YAML Configuration File is the main tool for creating and configuring components in the Kubernetes cluster. There are a few required fields in every Kubernetes YAML file:
Concerning NetIQ Access manager, you will come across mostly the following types of objects
Service specification (spec): We define a selector which makes a connection between the service and the deployment. Service must know which pods belong to that service and the selector of the label helps here.
Pod specification (spec): We define
The way the connection is established is by using labels and selectors. In metadata, we supply components like deployment or pod a key-value pair. The metadata part contains the labels and the specification part contains selectors.
Here are some of the properties you will see for a container:
Let us look at an example of a StatefulSet governed by a Service
selector: #Which pods are managed by this StatefulSet service?
matchLabels: #This must match the labels we set on the pod
replicas: 3 #How many copies of each pod do we want?
updateStrategy: #How do want to update the pods?
template: #This template field is a regular pod configuration
labels: #Set labels on the pod
- name: container-name
- containerPort: 80
- name: pvc-name
accessModes: [ "ReadWriteOnce" ]
storage: 1Gi #Capacity of the volume
Using the following commands I will get the resulting or the updated configuration of the deployment. All these configurations are automatically added and updated constantly by Kubernetes. For example, it says how many replicas are running, what the state of those replicas, and some other information. This part can also be helpful when debugging whether the current state of the deployment is matching from the expected YAML configuration file we deployed on the K8s cluster.
If the deployment is not part of default namespace, you will have to add -n <namespace> in all the commands. For example kubectl get pods -n <namespace>
If you are wondering how to get the name of the required object, you can use kubectl get <object> command.
I have taken out snippets from NetIQ Access Manager docker deployment by running the above-mentioned commands for better understanding but these are just for illustration as the docker support is under heavy development.
- name: port-8443
- name: admin_name
- name: admin_password
- name: ac_ip
- mountPath: /opt/novell/devman/jcc/conf/runtime
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- name: idp-storage
- name: default-token-g922m
- ip: 10.1.1.1
To conclude: Many applications require multiple resources to be created, such as a Deployment and a Service. Management of multiple resources can be simplified by grouping them in the same file (separated by --- in YAML).
I have added links to a couple of large configuration files. These YAML files are intuitive and also quite logically structured.