Kubernetes’ core concepts center on its objects (K8s). Working with K8s requires knowledge of the behavior of simple items. This article will overview the most common K8s things and their functions.
Primitives and controllers are the two types of objects.
Primitives are simple things that stand in for more complex aspects and descriptions of a setting. The most basic building blocks are as follows:
Referring to Domains and Subdomains
Objects may be organized into different namespaces for different users, teams, and projects. Separate entities exist in each namespace. Names are only used once within a given namespace.
Furthermore, namespaces provide a foundation for access control by enabling you to give permissions to numerous teams for individual namespaces. Limiting the total amount of available resources in a given namespace is another common usage for namespaces.
You may ask kubectl to look for namespaces for you. It will provide a list of all cluster namespaces. To see the pods using a specific namespace, you may also use the kubectl command.
In the context of Kubernetes, a “node” is a natural or virtual worker computer on which services like kubelet, kube proxy, and Docker are executed. You may designate nodes with a particular workload affinity and set limitations using annotations and labels. Kubelet registers nodes and periodically sends out “keepalive” checks to guarantee that nodes continue to function together.
Put, a pod is a cluster of storage units. A group of processes that share a name and execute on the same node constitutes a pod. The containers on a node are launched when a pod is assigned to it by the scheduler. Each container, or pod, is given its virtual IP address so that they may communicate with one another via the cluster’s physical network.
Once a pod has been created and started, it cannot be modified or relocated. A pod must be shut down, transferred to a new node, and then resumed with the fusion of the new node to be relocated.
Using the abstraction that Volume provides, you may expose and mount various forms of block and file storage to containers. The following data types may be stored on a volume:
Cloud File Systems: Amazon Elastic Block Store (EBS), Microsoft Azure Block Store (Azure blob store), Git NFS Gluster File System Ceph
Secrets and Setup Diagrams
The keys and values that make up your application’s configuration are stored in objects called config maps or secrets. Parameters for your container’s configuration may be stored in a Config Map, which can then be mapped to environment variables in the container’s temporary files.
Passwords, certificates, private keys, and tokens are all examples of secret information that must be sent along. K8s make a great effort to protect this information while it is in storage. In reality, K8s may encrypt sensitive data in the database at the user’s request, with the resultant encrypted data never being stored elsewhere other than in etcd on persistent stores.
The pods are made available to the public by the services. They are the final, unmovable state of a set of pods. Services are abstractions that permit a particular group of pods based on a policy. The service is a logical entity representing a shared L3 load balancer with a single dedicated IP address.
Once a service object is created in the K8s API, the kube proxy modifies the IP and NF tables on all active nodes to route traffic to the fixed IP address of the pod in the set.
Actors in Control
In contrast to Primitives, which stand for a collection of environmental changes, Controllers instruct K8s to do some operation on a given instance of a primitive. The most common controller objects are as follows.
DaemonSet will start a pod on each node in your cluster. Whenever a new pod is added, DaemonSet will launch immediately.
A StatefulSet StatefulSet provides permanent volume management enhancements to a collection of pods.
The service will handle incoming traffic when a user connects to Ingress. Comparable to services. However, Ingress operates at a far more advanced degree of traffic control. Together, Ingress and Services form a closed system, with Ingress primarily dealing with virtual host names and HTTP pathways.
A Job is a collection of one-off tasks executed in your cluster’s pods. Following the addition of a new position, a pod will implement the necessary factions.
Definitions of Objects
Definitions of objects are often written out in text files using the YAML markup language. The metadata that is always a part of their definitions includes:
Particular attention should be paid to the name.
Findable and selectable labels
- Status – the object’s current standing in the cluster
- Quality – the object’s current situation in the cluster
- Spec – the object’s detailed specifications and description
- Annotations – free-form supplementary information
K8s object basics training is an ongoing process.
The more you know about what each component does, the more efficiently you can deploy your K8s containers—the ability to deploy K8s in various settings without compromising the platform’s management capabilities.