This Blog lists different ways to set up and run Kubernetes. So when you install Kubernetes, choose an installation type based on ease of maintenance, security, control, available resources, and expertise required to operate and manage a cluster.
You can deploy a Kubernetes cluster on a local machine, cloud, or choose a managed Kubernetes cluster. Kubernetes is composed of a minimum of 1 master node and 1 worker node. So it’s advisable to learn Kubernetes Architecture before you start with the installation procedure.
In this blog, I’ve Covered:
- Everything from Scratch (Hard Way)
- Unmanaged (Installer Based)
- Kubernetes for Development
- Kubernetes in Production
- Managed Kubernetes (Platform Based)
Kubernetes Architecture
Everything from Scratch (Kubernetes The Hard Way) ^
Kubernetes The Hard Way is optimized for learning, which means taking the long route to ensure you understand each task required to bootstrap a Kubernetes cluster. This is for someone planning to support a production Kubernetes cluster and wants to understand how everything fits together. This is not for people looking for a fully automated command to bring up a Kubernetes cluster. The guide uses the API server certificate for etcd as it uses a stacked etcd configuration. We will generate separate certificates and keys for etcd as we are running an external etcd setup.
We will place the etcd cluster behind a load balancer that gives us multiple advantages.
- The etcd nodes can have ephemeral IPs.
- You can add and remove etcd nodes according to your requirements.
- NGINX provides an auto health check of its back-end members, and it would not send traffic to an unhealthy etcd instance avoiding runtime issues.
- You don’t need to update the control plane configuration if you make changes to the etcd cluster (such as adding or removing etcd nodes).
We will allow only the desired traffic and block the rest of it. That is required to protect our cluster from unauthorized access. We will encrypt secrets at rest on the etcd cluster as suggested in the original guide.
Note: Check our blog to learn Kubernetes the Hard Way
Unmanaged Kubernetes Installation (Installer Based) ^
In unmanaged Kuberenets installation, everything has to be managed by ourselves, which means that both the master node and worker node are managed by us. It is not managed by a cloud vendor hence, known as unmanaged or installer-based.
- kubeadm
- Kops
- Kubespray
Check this out: Since Kubernetes is the most ‘hot & trending‘ in the containerization world, most of the IT professionals are Kubernetes certification aspirants because of the undisputed value it holds. Let’s come to the good news, Certified Kubernetes Administrator (CKA)
Also Do Read : our blog on Kubernetes Dashboard for an overview.
Create a Kubernetes Cluster using Kubeadm
It is a tool built to provide kubeadm init and kubeadm join as best-practice “fast paths” for creating Kubernetes clusters. It performs the actions necessary to get a minimum viable cluster up and running. By design, it cares only about bootstrapping, not about provisioning machines. We can use kubeadm for creating a production-grade Kubernetes environment. Check out our Three Node Kubernetes Cluster blog for the same.
This is the first step to learn Kubernetes. We will cover all this in detail in our CKA Training Program.
Create a Kubernetes Cluster using Kops
Kubernetes Operations, or Kops, is an open-source project used to set up Kubernetes clusters easily and swiftly. It’s considered the “kubectl” way of creating clusters. Kops allows deployment of highly available Kubernetes clusters on AWS.
Check out: Docker & Certified Kubernetes Administrator (CKA). A Kubernetes certification makes your resume look good and stand out from the competition. As companies rely more and more on Kubernetes, your expertise will be an immediate asset.
Create a Kubernetes Cluster Using Kubespray
Kubernetes clusters can be created using various automation tools. Kubespray is a combination of Kubernetes and Ansible. That means we can install Kubernetes using Ansible. We can also deploy clusters using kubespray
cloud compute services like EC2 (AWS). Kubespray provides deployment flexibility. It allows you to deploy a cluster quickly and customize all aspects of the implementation.
Kubernetes for Development ^
This is used for the single node or a quick setup for Kubernetes. For the development purpose, we put everything on a single node. This is limited to one node.
- Kubernetes using Minikube
- Kubernetes using Docker for Desktop
Also read: Container (Docker) vs Virtual Machines (VM) to understand what is their difference.
Kubernetes using Minikube (Single Host)
It is the name of a go program and is a lightweight Kubernetes implementation that builds a Kubernetes cluster in a single host with a set of small resources to run a small Kubernetes deployment. It is meant for testing scenarios of Kubernetes (creating pods, services, managing storage, network ingress rules, etc) but in the local environment for the developer or administrator to test. It’s not meant for production use, since it runs a virtual box, installs Docker, and then deploys the essential Kubernetes containers. It is used to learn Kubernetes. Production systems should use Kubernetes clusters with 3 master nodes to achieve high availability.
Minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes. All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away: minikube start.
Note: Know more about Minikube
Kubernetes Using Docker for Desktop
Kubernetes with Docker Desktop is for a single node. It is available for Windows, Mac. We use this locally on our systems. We do it as a developer sandbox. This is convenient and easy to install and is primarily used for testing purposes. But docker desktop can’t be used for the production.
Read This blog in which we provide you with an overview of Helm and Helm Charts description and why is it beneficial. If you are new to Kubernetes, it will be helpful to read Kubernetes Introduction and Its architecture first to familiarize yourself with the basics concept.
Kubernetes in Production ^
When developers begin to experiment with Kubernetes, they would like to deploy Kubernetes on a set of servers. A production-ready Kubernetes environment is one that is ready to start serving traffic so for this, we need more than a single node cluster. Hence, at a minimum, we would need one master node and 2 worker nodes. These are the ways Kubernetes is used in production.
- Managed Kubernetes Service Ensures SLA and Simplifies Operations.
- It is used in Cluster Monitoring and Logging.
- Kubernetes is used as Registry and Package Management — Helm/Terraform.
- This is used in CI/CD Toolchain for DevOps.
- Cluster Provisioning and Load Balancing
- It is used for security purposes.
- This is used in Governance.
Also see: This blog covers the important part of Kubernetes which is Kubernetes Network Policy
Managed Kubernetes (EKS, AKS, GKE, OKE) ^
In Managed Kubernetes the nodes are managed by the cloud vendor or managed Kubernetes platform or the platform which basically gives us the Kubernetes configuration It is when third-party providers take over responsibility for some or all of the work necessary for the successful set-up and operation of K8s. The popular 3rd party providers are –
- Elastic Kubernetes Service (EKS)
- Azure Kubernetes Service (AKS)
- Google Kubernetes Engine (GKE)
- Oracle Kubernetes Engine (OKE)
Also Read: Kubernetes Labels and Kubernetes Annotations are one of the main components which provide a way for adding additional metadata to our Kubernetes Objects.
Amazon Elastic Kubernetes Service (EKS)
EKS runs Kubernetes on multiple AWS availability zones for high-availability, and AWS manages complete infrastructure. EKS is the best place to run Kubernetes for several reasons. First, you can choose to run your EKS clusters using AWS Fargate, which is a serverless compute for containers. EKS automatically applies the latest security patches to your cluster control plane.
Some of the great EKS features are:
- Manage through web UI or CLI.
- Optimized AMI with NVIDIA drivers for advanced computational power.
- Run a cluster behind AWS load balancer.
Note: know more about Elastic Kubernetes Service
Azure Kubernetes Service (AKS)
Azure offers multiple ways to provision a cluster – web console, command line, Azure resource manager, Terraform. You can take advantage of Azure traffic manager to route the application requests to the nearest data centers for a fast response. Deploy and manage containerized applications more easily with a fully-managed Kubernetes service. Unite your development and operations teams on a single platform to rapidly build, deliver, and scale applications with confidence.
One down-side of EKS is that it is currently unable to support hybrid cloud configurations.
Note: know more about Azure Kubernetes Service
Google Kubernetes Engine (GKE)
Since K8s was created by Google engineers for in-house container orchestration, it makes sense that GKE is one of the most advanced managed platforms available. Designed for use on Google Cloud, it includes functionality for operation in hybrid environments as well. It allows you to transfer microservices with minimal configuration changes, create private image repositories via an integrated image builder, and manage authentication and access rights through an integrated console.
Note: know more about Google Kubernetes Engine
Oracle Kubernetes Engine (OKE)
Oracle Cloud Infrastructure Container Engine for Kubernetes is a fully-managed, scalable, and highly available service that you can use to deploy your containerized applications to the cloud. Use Container Engine for Kubernetes (OKE) when your development team wants to reliably build, deploy, and manage cloud-native applications.
Note: know more about Oracle Kubernetes Engine
We cover Amazon Elastic Kubernetes Service (EKS), Azure Kubernetes Service (AKS), Oracle Kubernetes Engine (OKE) in our Certified Kubernetes Administrator (CKA) and Certified Kubernetes Application Developer training program.
Related/References
- Visit our YouTube channel on “Docker & Kubernetes”
- Kubernetes Architecture: An Introduction to Kubernetes Components
- How To Setup A Three Node Kubernetes Cluster For CKA: Step By Step
- Kubernetes vs Docker – Understand the Difference
- Certified Kubernetes Administrator (CKA) Certification Exam
- Certified Kubernetes Administrator (CKA): Step-by-Step Activity Guide (Hands-on Lab)
- Docker Compose Overview & Steps to Install Docker Compose
- Install Docker on Windows, Ubuntu and Mac: A Complete Step-by-Step Guide
- Docker Container Lifecycle Management: Create, Run, Pause, Stop And Delete
- CKA Certification Exam (Certified Kubernetes Administrator)
Join FREE Masterclass
Discover the Power of Kubernetes, Docker & DevOps – Join Our Free Masterclass. Unlock the secrets of Kubernetes, Docker, and DevOps in our exclusive, no-cost masterclass. Take the first step towards building highly sought-after skills and securing lucrative job opportunities. Click on the below image to Register Our FREE Masterclass Now!
Leave a Reply