Wednesday, July 8, 2020

Kubernetes Tutorial

Kubernetes Tutorial Kubernetes Tutorial A Comprehensive Guide For Kubernetes Back Home Categories Online Courses Mock Interviews Webinars NEW Community Write for Us Categories Artificial Intelligence AI vs Machine Learning vs Deep LearningMachine Learning AlgorithmsArtificial Intelligence TutorialWhat is Deep LearningDeep Learning TutorialInstall TensorFlowDeep Learning with PythonBackpropagationTensorFlow TutorialConvolutional Neural Network TutorialVIEW ALL BI and Visualization What is TableauTableau TutorialTableau Interview QuestionsWhat is InformaticaInformatica Interview QuestionsPower BI TutorialPower BI Interview QuestionsOLTP vs OLAPQlikView TutorialAdvanced Excel Formulas TutorialVIEW ALL Big Data What is HadoopHadoop ArchitectureHadoop TutorialHadoop Interview QuestionsHadoop EcosystemData Science vs Big Data vs Data AnalyticsWhat is Big DataMapReduce TutorialPig TutorialSpark TutorialSpark Interview QuestionsBig Data TutorialHive TutorialVIEW ALL Blockchain Blockchain TutorialWhat is BlockchainHyperledger FabricWhat Is EthereumEthereum TutorialB lockchain ApplicationsSolidity TutorialBlockchain ProgrammingHow Blockchain WorksVIEW ALL Cloud Computing What is AWSAWS TutorialAWS CertificationAzure Interview QuestionsAzure TutorialWhat Is Cloud ComputingWhat Is SalesforceIoT TutorialSalesforce TutorialSalesforce Interview QuestionsVIEW ALL Cyber Security Cloud SecurityWhat is CryptographyNmap TutorialSQL Injection AttacksHow To Install Kali LinuxHow to become an Ethical Hacker?Footprinting in Ethical HackingNetwork Scanning for Ethical HackingARP SpoofingApplication SecurityVIEW ALL Data Science Python Pandas TutorialWhat is Machine LearningMachine Learning TutorialMachine Learning ProjectsMachine Learning Interview QuestionsWhat Is Data ScienceSAS TutorialR TutorialData Science ProjectsHow to become a data scientistData Science Interview QuestionsData Scientist SalaryVIEW ALL Data Warehousing and ETL What is Data WarehouseDimension Table in Data WarehousingData Warehousing Interview QuestionsData warehouse architectureTalend T utorialTalend ETL ToolTalend Interview QuestionsFact Table and its TypesInformatica TransformationsInformatica TutorialVIEW ALL Databases What is MySQLMySQL Data TypesSQL JoinsSQL Data TypesWhat is MongoDBMongoDB Interview QuestionsMySQL TutorialSQL Interview QuestionsSQL CommandsMySQL Interview QuestionsVIEW ALL DevOps What is DevOpsDevOps vs AgileDevOps ToolsDevOps TutorialHow To Become A DevOps EngineerDevOps Interview QuestionsWhat Is DockerDocker TutorialDocker Interview QuestionsWhat Is ChefWhat Is KubernetesKubernetes TutorialVIEW ALL Front End Web Development What is JavaScript â€" All You Need To Know About JavaScriptJavaScript TutorialJavaScript Interview QuestionsJavaScript FrameworksAngular TutorialAngular Interview QuestionsWhat is REST API?React TutorialReact vs AngularjQuery TutorialNode TutorialReact Interview QuestionsVIEW ALL Mobile Development Android TutorialAndroid Interview QuestionsAndroid ArchitectureAndroid SQLite DatabaseProgramming A ... Kubernetes (10 B logs) Become a Certified Professional AWS Global Infrastructure Introduction To DevOps What is DevOps? A Beginner's Guide To Understanding DevOps And Its EvolutionWhat Are Important Pre-Requisites For DevOps Professionals?DevOps in various domains â€" How DevOps solves the problem?DevOps Real Time Scenarios â€" Know What Happens Real TimeWaterfall vs Agile: Which Is Better For You And Why?DevOps vs Agile! Everything You Need To KnowMystery of DevOpsInfrastructure as Code â€" What is it and Why is it it important?Linux commands in DevOps: Must Know For Every DevOps ProfessionalDevOps Tutorial : Introduction To DevOpsTop 10 DevOps Tools You Must Know In 2020Understanding DevOps Tools Development, Testing Deployment Technologies Involved In DevOps Git A Comprehensive Guide For Kubernetes Last updated on Nov 27,2019 20.3K Views Sahiti Kappagantula Bookmark 4 / 8 Blog from Kubernetes Become a Certified Professional Kubernetes is a platform that eliminates the manual proces ses involved in deploying containerized applications. In this blog on Kubernetes Tutorial, you will go through all the concepts related to this multi-container management solution.The following topics will be covered in this tutorial:Challenges Without Container OrchestrationDocker Swarm or KubernetesWhat is Kubernetes?Kubernetes FeaturesKubernetes ArchitectureKubernetes Case-StudyHands-OnNow, before moving forward in this blog, let me just quickly brief you about containerization.So, before containers came into existence, the developersand the testers always had a tiff between them. This usually, happened because what worked on the dev side, would not work on the testing side. Both of them existed in different environments. Now, to avoid such scenarioscontainers were introduced so that both the Developers and Testers were on the same page.Handling a large number of containers all together was also a problem. Sometimes while running containers, on the product side, few issues were r aised, which were not present at the development stage. This kind of scenarios introduced the Container Orchestration System. Before I deep dive into the orchestration system, let me just quickly list down the challenges faced without this system.Kubernetes Tutorial: Challenges Without Container OrchestrationAs you can see in the above diagram when multiple services run inside containers, you may want to scale these containers. In large scale industries, this is really tough to do. Thats because it would increase the cost to maintain services, and thecomplexity to run them side by side.Now, to avoid setting up services manually overcome the challenges, something big was needed. This is where Container Orchestration Engine comes into the picture.This engine, lets usorganize multiple containers, in such a way that all the underlying machines are launched, containers are healthy and distributed in a clustered environment. In todays world, there are mainly two such engines: Kubernetes Docker Swarm.Kubernetes Tutorial:Kubernetes vs Docker SwarmKubernetesandDocker Swarmare leading container orchestration tools in todays market. So before using them in prod, you should know what exactly they are and how they work.Further, in the blog, I am going to deep dive into Kubernetes, but to know aboutDocker you can click here.As you can refer to the above image, Kubernetes, when compared with Docker Swarm owns a great active community and empowers auto-scaling in many organizations. Similarly,Docker Swarm has an easy to start cluster when compared to Kubernetes, but it is limited to the Docker APIs capabilities.Well, folks, these are not the only differences between these top tools. If you wish to know the detailed differences between both these container orchestration tools, you can click here. Interested To Know More About Kubernetes? Learn Now If I could choose my pick between the two, then it would have to be Kubernetes since, containers need to be managed and connecte d to the outside world for tasks such as scheduling, load balancing, and distribution.But, if you think logically, Docker Swarm would make a better option, as it runs on top of Docker right? If I were you, I would have definitely got confused about which tool to use. But hey, Kubernetes being an undisputed leader in the market and also does run on top of Docker containers with better functionalities. Now, that you have understood the need for Kubernetes, its a good time, that I tell you What is Kubernetes?Kubernetes Tutorial:What is Kubernetes?Kubernetes is an open-source system that handles the work of scheduling containers onto a compute cluster and manages the workloads to ensure they run as the user intends.Being the Googles brainchild, it offers excellent community and works brilliantly with all the cloud providers to become amulti-container management solution.Kubernetes Tutorial:Kubernetes FeaturesThe features of Kubernetes, are as follows:Automated Scheduling: Kubernetes pro vides advanced scheduler to launch container on cluster nodes based on their resource requirements and other constraints, while not sacrificing availability.Self Healing Capabilities: Kubernetes allows to replaces and reschedules containers when nodes die. It also kills containers that dont respond to user-defined health check and doesnt advertise them to clients until they are ready to serve.Automated rollouts rollback:Kubernetes rolls out changes to the application or its configuration while monitoring application health to ensure it doesnt kill all your instances at the same time. If something goes wrong, with Kubernetes you can rollback the change. Horizontal Scaling Load Balancing: Kubernetes can scale up and scale down the application as per the requirementswith a simple command, using a UI, or automatically based on CPU usage.Kubernetes Tutorial:Kubernetes ArchitectureKubernetes Architecture has the following main components:Master nodesWorker/Slave nodesI am going to discu ss each one of them one by one. So, initially lets start by understanding the Master Node.Master NodeThe master node is responsible for the management of Kubernetes cluster. It is mainly the entry point for all administrative tasks. There can be more than one master node in the cluster to check for fault tolerance.As you can see in the above diagram, the master node has various components like API Server, Controller Manager, Scheduler and ETCD.API Server:The API server is the entry point for all the REST commands used to control the cluster.Controller Manager: Is a daemon that regulates the Kubernetes cluster, and manages different non-terminating control loops.Scheduler:The scheduler schedules the tasks to slave nodes. It stores theresource usage information for each slave node.ETCD:ETCD is a simple, distributed, consistent key-value store. Its mainly used for shared configuration and service discovery.Worker/Slave nodesWorker nodes contain all the necessary services to manage the networking between the containers, communicate with the master node, and assign resources to the scheduled containers.As you can see in the above diagram, the worker node has various components like Docker Container, Kubelet, Kube-proxy, and Pods.Docker Container: Docker runs on each of the worker nodes, and runs the configured podsKubelet:Kubelet gets the configuration of a Pod from the API server and ensures that the described containers are up and running.Kube-proxy: Kube-proxy acts as a network proxy and a load balancer for a service on a single worker nodePods:A pod is one or more containers that logically run togetheron nodes.If you want a detailed explanation of all the components of Kubernetes Architecture, then you can refer to our blog on Kubernetes Architecture. Want To Get Certified In Kubernetes? View Batches Now Kubernetes Tutorial:Kubernetes Case-StudyYahoo!JAPANis a web services provider headquartered in Sunnyvale, California. As the company aimed to virtualize the hardware, companystarted usingOpenStackin 2012. Their internal environment changed very quickly. However, due to the progress of cloud and container technology, the company wanted the capability to launch services on various platforms.Problem: How to create images for all required platforms from one application code, and deploy those images onto each platform?For your better understanding, refer to the below image. When the code is changed at the code registry, then bare metal images, Docker containers, and VM images are created by continuous integration tools, pushed into the image registry, and then deployed to each infrastructure platform. Now, let us focus on container workflow to understand how they used Kubernetes as a deployment platform. Refer to the below image to sneak peek into platform architecture.OpenStack instances are used, with Docker, Kubernetes, Calico, etcd on top of it to perform various operations like Container Networking, Container Registry, and so on.When yo u have a number of clusters, then it becomes hard to manage them right?So, they just wanted to create a simple, base OpenStack cluster to provide the basic functionality needed for Kubernetes and make the OpenStack environment easier to manage.By the combination of Image creation workflow and Kubernetes, they built the below toolchain which makes it easy from code push to deployment. This kind of toolchain made sure that all factors for production deployment such as multi-tenancy, authentication, storage, networking, service discoverywere considered.Thats how folks, Yahoo! JAPANbuilt an automation toolchain for one-click code deployment to Kubernetes running on OpenStack, with help from Google and Solinea.Kubernetes Tutorial: Hands-OnIn this Hands-On, I will show you how to create a deployment and a service. I am using an Amazon EC2 instance, to use Kubernetes. Well, Amazon has come up withAmazon Elastic Container Service for Kubernetes(Amazon EKS), which allows them to create Kuber netes clusters in the cloud very quickly and easily. If you wish to learn more about it, you can refer to the blog here.Step 1: First create a folder inside which you will create your deployment and service. After that, use an editor and open a Deployment file. mkdir handsOn cd handsOn vi Deploy.yaml Step 2: Once you open the deployment file, mention all the specifications for the application you want to deploy. Here I am trying to deploy an httpd application. apiVersion: apps/v1 #Defines the API Version kind: Deployment #Kinds parameter defines which kind of file is it, over here it is Deployment metadata: name: dep1 #Stores the name of the deployment spec: # Under Specifications, you mention all the specifications for the deployment replicas: 3 # Number of replicas would be 3 selector: matchLabels: app: httpd #Label name which would be searched is httpd template: metadata: labels: app: httpd #Template name would be httpd spec: # Under Specifications, you mention all the specifications for the containers containers: - name: httpd #Name of the containers would be httpd image: httpd:latest #The image which has to be downloaded is httpd:latest ports: - containerPort: 80 #The application would be exposed on port 80 Step 3: After you write your deployment file, apply the deployment using the following command. kubectl apply -f Deploy.yaml Here -f is a flag name used for the file name.Step 4: Now, once the deployment is applied, get the list of pods running. kubectl get pods -o wide Here, -o wide are used to know on which node is the deployment running.Step 5: After you have created a deployment, now you have to create a service. For that again use an editor and open a blank service.yaml file. vi service.yaml Step 6: Once you open a service file, mention all the specifications for the service. apiVersion: v1 #Defines the API Version kind: Service #Kinds parameter defines which kind of file is it, over here it is Service metadata: name: netsvc #Stores the name of the service spec: # Under Specifications, you mention all the specifications for the service type: NodePort selector: app: httpd ports: -protocol: TCP port: 80 targetPort: 8084 #Target Port number is 8084 Step 7:After you write your service file, apply the service file using the following command. kubectl apply -f service.yaml Step 8: Now, once your service is applied to check whether the service is running or not use the following command. kubectl get svc Step 9: Now, to see the specifications of service, and check which Endpoint it is binded to, use the following command. kubectl describe svc name of the service Step 10: Now since we are using amazon ec2 instance, to fetch the webpage and check the output, use the following command. curl ip-address If you found this Kubernetes Tutorial blog relevant, check out theKubernetes Certification Trainingby Edureka,a trusted online learning companywith a network of more than250,000satisfied learnersspread acrossthe globe.Got a question for us? Please mention it in the comments section of Kubernetes Tutorial and I will get back to you.Recommended videos for you Devops : Automate Your Infrastructure With Puppet Watch Now Ansible Tutorial For Beginners Ansible Playbook Watch Now What is Git A Complete Git Tutorial For Beginners Watch Now Puppet Tutorial DevOps Tool For Configuration Management Watch Now Continuous Integration With Jenkins Watch Now DevOps Tutorial For Beginners Watch Now 5 Best Practices In DevOps Culture Watch Now What is DevOps A Beginners Guide To DevOps Watch Now What is Docker DevOps Tool For Containerization Watch Now DevOps-Redefining your IT Strategy Watch Now DevOps is Going to Replace SDLC! Learn Why Watch Now What is Jenkins? Continuous Integration With Jen kins Watch Now Top DevOps Interview Questions And Answers Watch NowRecommended blogs for you Linux commands in DevOps: Must Know For Every DevOps Professional Read Article Top 6 DevOps Skills That Organizations Are Looking For Read Article Azure Pipelines : Learn How To Create Azure Pipelines Read Article Understanding DevOps Tools Development, Testing Deployment Technologies Involved In DevOps Read Article Who Is A DevOps Engineer? DevOps Engineer Roles And Responsibilities Read Article Infrastructure as Code What is it and Why is it it important? Read Article Git bisect: How to identify a bug in your code? Read Article Install Ansible Ansible Installation In Two Easy Steps Read Article What Is Agile Methodology Know the What and How? Read Article What is Docker Container? Containerize Your Application Using Docker Read Article DevOps vs Agile! Everything You Need To Know Read Article How To Use GitHub Developers Collaboration Using GitHub Read Article Nagios Tutorial Cont inuous Monitoring With Nagios Read Article Jenkins Tutorial | Continuous Integration Using Jenkins | Edureka Read Article AWS CodeStar Tutorial: First Glance At AWS CodeStar Read Article Jenkins Master and Slave Architecture A Complete Guide Read Article Jenkins Git Integration Useful for Every DevOps Professional Read Article Install Docker Docker Installation On Ubuntu And CentOS Read Article Gitting Ahead: Hacking Git and GitHub Part 2 Read Article Jenkins vs Bamboo Battle Of The Best CI/CD Tools Read Article Comments 0 Comments Trending Courses in DevOps DevOps Certification Training72k Enrolled LearnersWeekend/WeekdayLive Class Reviews 5 (28700)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.