Kubernetes: Key Concepts for Beginners and Pros
This guide explains the basics of Kubernetes, how it works, and what a Kubernetes developer can do with its features.

The buzz around Kubernetes has only increased in recent years, especially among data engineers and DevOps. According to a 2019 Cloud Native Computing Foundation (CNCF) survey, 78% of respondents used Kubernetes, up from 58% the previous year. That makes this framework one of the most popular ways to run containers.
Despite its widespread popularity, many developers still find it challenging. So, questions about Kubernetes services and how to best use them are quite common.
In that light, this Kubernetes tutorial explains some Kubernetes basics, including its features and components. It also discusses how these components come together to form a functional framework.
What is Kubernetes?
Kubernetes is an open-source system that automates containerized applications’ deployment, scaling, and management. Google designed Kubernetes, but the Cloud Native Computing Foundation (CNCF) now maintains it.
Kubernetes works with frameworks like Docker containers to provide a robust and scalable platform for running applications. It can also run on top of various cloud platforms, such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.
That makes Kubernetes a popular choice for a number of different deployments, from single-node to large, multi-cluster setups. It’s also used for serverless deployments.
Some common terminologies in Kubernetes include:
- A Kubernetes cluster has a set of worker machines called nodes.
- Nodes are physical or virtual machines that run containerized applications.
- Pods are the logical host for a container.
- The worker node hosts pods that are components of the application workload.
- The primary node manages the worker nodes and the pods in the cluster.
- Minikube is a small, single-node Kubernetes cluster that helps you run Kubernetes locally on your laptop or desktop computer. Use it for development, testing, and troubleshooting.
Need an introduction to Docker? Refer to our article on Docker basics.
Kubernetes features
- Automated scheduling
- Self-healing capabilities
- Horizontal scaling
- Load balancing
- Configuration management
- Batch execution
Kubernetes’ design offers a self-service environment for developers to deploy and scale their applications. The following are several characteristics of the Kubernetes framework.
Automated scheduling
A key feature of Kubernetes is its automated scheduling capabilities. When you deploy a new application or service, Kubernetes automatically schedules it onto the right nodes in your cluster.
This can help optimize your cluster and ensure that your applications run on the best possible nodes. It can also help prevent issues like overloaded nodes or underutilized resources.
Self-healing capabilities
Kubernetes is a self-healing system. This means that if a node in a Kubernetes cluster goes down, the Kubernetes controller will automatically launch a new instance of the node. This ensures that your applications are always up and running, even in the event of a node failure.
Horizontal scaling
Kubernetes’ ability to scale horizontally means you can add more nodes to your Kubernetes cluster as your needs grow. It eliminates the downtime common with increasing your Kubernetes cluster’s capacity by increasing the pods to the desired state and autoscaling.
This is generally more efficient and cost-effective than vertical scaling, which involves adding more resources to a single node.
Load balancing
By load balancing, Kubernetes can ensure that each node in the cluster receives a steady stream of traffic, even if some nodes are under greater demand than others. That improves the cluster’s overall performance and prevents any single node from becoming overloaded.
Kubernetes achieves load balancing by using a feature called “Labels.” By assigning labels to pods, Kubernetes can control which pods receive traffic from the microservices.
Configuration management
This feature allows Kubernetes to manage configurations for your application, keeping your application’s various settings in sync across all your servers.
Kubernetes also offers a secret management feature, such as passwords and API keys, to secure sensitive information and ward off intruders.
Batch execution
Batch execution lets you run a series of jobs in parallel, which is useful when you need to process a large amount of data or run a series of tasks that can be completed independently. This feature ensures the system can process large datasets without significant downtime.
Related: Kubernetes Essentials: Pods vs. Nodes
How Kubernetes works
Kubernetes 1.0 provided a viable open-source orchestrator. The framework’s purpose was to automate the hosting and deploying of containers to enable better communication between various parts of applications.
Several Kubernetes components work together to make that possible. The principal components include nodes, pods, and servers.
Understanding Kubernetes architecture
The Kubernetes cluster has a set of nodes that host applications in the form of containers. These nodes come in two forms: primary nodes and worker nodes.
Think of the cluster like a control ship unloading containers into various smaller ships. The worker node loads containers into pods, while the primary node oversees the entire process and manages the Kubernetes cluster.
That includes storing information about different nodes, planning which container goes where, and so on. The primary node does this using control plane components.
One component is the ETCD, a database that tracks and stores information about the primary and worker nodes’ activities. Another component is the Kube-scheduler.
A scheduler identifies the right node to place a container based on several metrics, including the container’s resource requirements and the worker node’s capacity.
The containers get destroyed during the entire process of loading and unloading the nodes, and several other issues can arise. That’s where controllers come in.
- The controller-manager is responsible for keeping the cluster running smoothly. It also deploys and manages applications on the cluster.
- The node controller onboards new nodes and replaces damaged or unavailable nodes. It also performs other maintenance routines on nodes.
- The replication controller ensures the desired number of containers are running in a replication group at all times.
This entire process of Kubernetes operations is complex, with several components working simultaneously. These individual parts all need constant interaction to perform optimally. That is where the Kube-apiserver comes in.
The Kube-apiserver, working the front end of the control panel, orchestrates all the operations in a cluster and exposes the Kubernetes API. Exposing this API and IP address also allows the worker nodes to communicate with the server.
A Kubelet handles the transfer of information between various parts of the Kubernetes architecture. It runs on each node, listens for instructions from the Kube-apiserver, and executes them. That may involve deploying or destroying containers on the nodes.
All along, the Kube-proxy service helps establish interaction between several worker nodes.
For example, you may have a web server in one container running in one of the nodes and a database server in a container running on a different node. With the Kube-proxy service, both nodes can establish communication with each other.
How to use Kubernetes clusters
We take you through the steps to set up Kubernetes clusters.
1. Download updates from the Kubernetes repository. To do that, type the following commands on both the primary and worker nodes.
--CODE language-markup--
~ Sudo su
~ Apt-get update
2. Install Docker for both primary and worker nodes. Remember, Kubernetes works on containerized applications. You’ll need to install a container runtime engine like Docker or Container D on every node in a cluster.
Type the following commands to begin the installation.
--CODE language-markup--
~ apt-get install docker.io #install docker
~ apt-get update && apt-get install -y apt-transport-https curl
3. Download Kubernetes essentials using the codes below. Running that command pulls the latest available configuration file from the Kubernetes repository.
--CODE language-markup--
~ curl -s https://packages.cloud.google.com/apr/doc/apt-key.gpg | apt-key add -
~ cat < /etc/apt/sources.list.d/kubernetes.list
~ deb https://apt.kubernetes.io/ kubernetes-xenial main
~ EOF
~ apt-get update
4. Install kubeadm. This is a toolkit that helps you bootstrap a Kubernetes cluster. It’s designed to make it easy to set up a Kubernetes cluster by automating much of the process.
--CODE language-markup--
~ apt-get install -y kubelet kubeadm kubectl
The next step after downloading is to run Kubeadm. Initializing this tool is the first step toward creating a Kubernetes cluster. You can do that by running this command.
--CODE language-markup--
~ kubeadm init --apiserver-advertise-address=<enetr_your_master’s_private_ip_here> --pod-network-cidr=192.168.0.0/16 --ignore-preflight-errors=NumCPU
At this point, a token will appear on the primary node. Copy that key and paste it into the worker node. Once you do that, you should see a message like this on the command line interface (CLI):
--CODE language-markup--
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connected details.
Run ‘kubectl get nodes’ on the control=plane to see this node join the cluster.
root@ip-172-31-31-214:/home/ubuntu#
5. Exit the root directory and create a new folder for the Kubernetes configurations. Next, you’ll need to grant necessary permissions as they create access for the new installation to work.
--CODE language-markup--
~ Ctrl + D (to exitroot directory)
~ mkdir -p $HOME/.kube
~ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
~ sudo chown $(id -u):$(id -g) $HOME/.kube/config
~ kubectl get nodes
6. Install relevant network plugins. These are necessary to allow communication between nodes in the system. The following command will help you download the appropriate plugins:
--CODE language-markup--
~ kubectl apply -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml
7. Double-check the entire process to confirm that the components are ready. This command helps you run the task:
--CODE language-markup--
~ kubectl get pods --all-namespaces
If everything went well, the following should appear on your CLI:
--CODE language-markup--
5m48s
ubuntu@ip-172-31-33-138:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-172-31-31-214 Ready <none> 2m21s vl1.15.1
ip-172-31-31-138 Ready master 7m37s vl1.15.1
ubuntu@ip-172-31-33-138:~$
Kubernetes deployment examples
Kubernetes deployment is the process of putting your containerized application into production. That involves creating a cluster of Kubernetes nodes and configuring them to work with your application.
It also entails determining an application’s lifecycle by defining the number of Kubernetes pods the app should have, which container images to use, and more.
You can deploy Kubernetes in various environments, from on-premise data centers to public clouds. This section gives an overview of some Kubernetes deployment examples
- Run stateless web servers like NGINX. A stateless server doesn’t store any data locally. This server works for applications that can run on any server and don’t need any specific data to be stored on that server.
Related: How to run NGINX on Docker
--CODE language-markup--
apiversion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
metchLabels:
run: my-app
template:
metadata:
labels:
run: my-app
spec:
containers:
- name: hello-app
image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
Source: Cloud.Google.com
- Create a deployment to roll out a ReplicaSet. A ReplicaSet is a group of identical pods that provide high availability and redundancy. Creating a deployment to roll out a replica set is a two-step process.
First, you’ll need to have a Kubernetes cluster up and running. Once you have a Kubernetes cluster, create a deployment Kubernetes object. You can do that with the kubectl command tool.
--CODE language-markup--
kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
The deployment object defines the ReplicaSet you want to deploy. You can run this after a few minutes to check the deployment status.
--CODE language-markup--
kubectl rollout status deployment/nginx-deployment
Once all replicas are ready, check the ReplicaSet by running kubectl get rs. If you got it right, you should have an output similar to the CLI below.
--CODE language-markup--
NAME DESIRED CURRENT READY AGE
nginx-deployment-75675f5897 3 3 3 18s
This output shows five fields, each passing unique information.
- NAME gives the names of the ReplicaSets in the namespace.
- DESIRED shows the number of replicas of the application. You’ll typically input the desired number of replicas when creating a deployment.
- CURRENT tells the number of replicas that are running.
- READY shows how many of the replicas the user can use at a time.
- AGE tells how long you’ve run the application.
Hire a developer or work as one yourself
Kubernetes is a container orchestration tool that can help you manage your applications and resources. If you’re new to Kubernetes, you’ll want to learn Kubernetes basics to get the most out of it. Once you’re familiar with key concepts, you can start using Kubernetes to its full potential.
Then, find freelance Docker jobs by leveraging the Upwork platform. Just sign up on the platform, create a profile, upload your resume, and apply to job postings. If you need help with Kubernetes, consider hiring an independent Docker developer.











.png)
.avif)

.avif)





