apiVersion: apps/v1 kind: Deployment metadata: name: httpd labels: dc: IN env: dev spec: replicas: 3 selector: matchLabels: env: dev template: metadata: name: pod1 labels: env: dev spec: containers: - name: mycon1 image: httpd ports: - containerPort: 80 Here is a simple YAML file for deployment object.
Also we have a CronJob, which runs Pods on a time-based schedule.Īmong all objects, most used is deployment object. When the task is completed, Job will then terminate all those Pods. The Job controller creates one or more Pods required to run a task. DaemonSet ensures that a specific Pod is always running on all or some subset of the nodes. If you need to run certain Pods on all the nodes within the cluster or on a selection of nodes, use DaemonSet. StatefulSet have unique persistent identities with stable network identity and persistent disk storage. If you need to deploy applications that maintain local state, StatefulSet is a better option. They are responsible for rollouts and rollbacks. Along with that, it has many other features. We can write expressions using set properties which are more elastic and convenient. They use set properties to select pods whereas replication controllers use equality property. They are modified version of Replication controllers. If a pod goes down, replication controller creates another pod.It uses labels to detect pods.They are no longer preferred. Its main functionality is to provide load-balancing to podsĪs we know the details of master and worker nodes, we learn about types of objects that are deployed on nodes. It is reponsible for networking among pods in a node. kubelet launches and maintains pods in a node. To run a pod, we need kubelet installed in a node. The cloud controller manager lets you link your cluster into your cloud provider’s API and lets you manage your cluster from cloud. It interacts with the cloud and inherits their specific functionality. It can act like a backup store of the cluster data. It contains all meta-data of the cluster. There are many controllers in it like node-controller to control number of node, replication-controller to maintain required replicas of pods. It’s basic functionality is to monitor pod. It schedules the deployment of pods in nodes. This component is responsible for deployments of pods. kube-api-server listens to kubectl commands and then it passess it to the required component. This component is connected to other components in master. Master node consists of many components.Master node is also called as control plane. NOTE: Master node is often referred as Master and other nodes are referred as worker nodes or simply nodes. Now lets talk about Master Node configuration. With this, we can create a pod which runs httpd container inside it. To run file, we use command kubectl create -f pod.yaml The same can be done with YAML file apiVersion: v1 kind: Pod metadata: name: mypod1 spec: containers: - name: httpd image: httpd They are by using kubectl commands and by using yaml files.įor example, to create a pod running httpd container using kubectl, the command is kubectl run -image=httpd There are two ways to create anything in kubernetes.
We can control pods with kubectl command. So basically, kubernetes job is to manage pods. But we generally run only one container in a pod. A node can have multiple pods and a pod can have multiple containers. Pods contain containers in which application runs. Pods are considered as basic execution unit in a kubernetes cluster. Nodes are nothing but compute instances.These compute instances contains pods. We can interact with cluster using this command. It is a CLI command used for controlling clusters. Deployments in worker nodes are controlled by Master node. We deploy our applications in worker nodes. A cluster contains two types of components:. Its easy to setup minikube in your laptop.
So, to manage those containers at a large scale, we use kubernetes.
All the developers are using containers to build their applications. As we know, Docker revolutionized container technology. And a way to approach microservices architecture is through containerization technology. At present, all applications are adapting Microservices architecture over Monolithic architecture. Main purpose of kubernetes is to manage container deployments. Kubernetes is container orchestration engine.