what is a deployment? A Kubernetes Deployment is used to tell Kubernetes how to create or modify instances of the pods that hold a containerized application. Deployments can scale the number of replica pods, enable the rollout of updated code in a controlled manner, or roll back to an earlier deployment version if necessary. How to create a deployment? using Command Prompt: kubectl create deployment my-webdep --image=nginx --replicas=1 --port=80 using yml file: For that create a folder and inside that create a yml file as deployment.yml and paste the following command in that apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels: app: nginx replicas: 1 # tells deployment to run 2 pods matching the template template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: ...
Kubernetes Architecture and Components: It follows the client-server architecture, from a high level, a Kubernetes environment consists of a control plane (master) , a distributed storage system for keeping the cluster state consistent ( etcd ), and a number of cluster nodes (Kubelets). We will now explore the individual components of a standard Kubernetes cluster to understand the process in greater detail. What is Master Node in Kubernetes Architecture? The Kubernetes Master (Master Node) receives input from a CLI (Command-Line Interface) or UI (User Interface) via an API. These are the commands you provide to Kubernetes. You define pods, replica sets, and services that you want Kubernetes to maintain. For example, which container image to use, which ports to expose, and how many pod replicas to run. You also provide the parameters of the desired state for the application(s) running in that cluster. API Server: The API Server is the front-end...