Skip to main content

How to start with Kubernetes for begginer

 

Prior knowledge require: Python or any other language development knowledge. Knows about what is GIT and how it works. Good if you know about Docker.

What can Kubernetes do for you?

With modern web services, users expect applications to be available 24/7, and developers expect to deploy new versions of those applications several times a day. Containerization helps package software to serve these goals, enabling applications to be released and updated in an easy and fast way without downtime. Kubernetes helps you make sure those containerized applications run where and when you want, and helps them find the resources and tools they need to work. Kubernetes is a production-ready, open source platform designed with Google’s accumulated experience in container orchestration, combined with best-of-breed ideas from the community.

So in short, when you need to run your application all round the clock. You need to deploy and update release your application any time or several times. Then Kubernetes comes to rescue it. And now most of the cloud hosting supports it and very easy to deploy as well.

Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.

  • The Kubernetes Master is a collection of three processes that run on a single node in your cluster, which is designated as the master node. Those processes are: kube-apiserverkube-controller-manager and kube-scheduler.
  • Each individual non-master node in your cluster runs two processes:
  • kubelet, which communicates with the Kubernetes Master.
  • kube-proxy, a network proxy which reflects Kubernetes networking services on each node.

The basic Kubernetes objects include:

Kubernetes Master

The Kubernetes master is responsible for maintaining the desired state for your cluster. When you interact with Kubernetes, such as by using the kubectl command-line interface, you're communicating with your cluster's Kubernetes master.

Kubernetes Nodes

The nodes in a cluster are the machines (VMs, physical servers, etc) that run your applications and cloud workflows. The Kubernetes master controls each node; you’ll rarely interact with nodes directly.

What is container

Containers are a technology for packaging the (compiled) code for an application along with the dependencies it needs at run time. Each container that you run is repeatable; the standardization from having dependencies included means that you get the same behavior wherever you run it.

What is container image

A container image is a ready-to-run software package, containing everything needed to run an application: the code and any runtime it requires, application and system libraries, and default values for any essential settings.

What is container runtime

The container runtime is the software that is responsible for running containers.

Kubernetes supports several container runtimes: Docker, containerd, CRI-O, and any implementation of the Kubernetes CRI (Container Runtime Interface).

Master

Manage, build, deploy and operate

Node

Run containers and registries

Let see how to install and run in local system

I am using Ubuntu you can use any linux .

Steps

Installing kubectl

Download a pre-compiled release[1] and unzip it — — kubectl should be located in the
platforms/<os>/<arch> directory.
[1] https://github.com/kubernetes/kubernetes/releases
Add kubectl to your path. Note, you can simply copy it into a directory that is already in your $PATH (e.g. /usr/local/bin). For example:

$ sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl

You also need to ensure it’s executable:
$ sudo chmod +x /usr/local/bin/kubectl

administration

To administer and interact with any given Kubernetes cluster (local or remote), you must set
up your kubeconfig file. By default, kubectl configuration lives at

~/.kube/config
You can also create a cluster in your local machine via Minikube (See section 3: Running Locally via Minikube)

Prerequisit for minikube

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS on all platforms.
For example:
$ cat /proc/cpuinfo | grep ‘vmx\|svm’

Make sure if the setting is enabled where this command should output something.
Install an x86 virtualization software package in your local machine:
Linux: The latest VirtualBox

Install minikube

Feel free to leave off the sudo mv minikube /usr/local/bin if you would like to add minikube to
your path manually.
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.12.2/minikube-
linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Install kubectl

You will need to download and install the kubectl client binary to run commands against the
cluster. For example:
$ curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/
linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

Getting started

Note that the IP below is dynamic and can change. It can be retrieved with minikube ip.

# To access the Kubernetes Dashboard, run this command in a shell after starting minikube to get the address:

$ minikube dashboard
$ minikube stop

Stopping local Kubernetes cluster…
Stopping “minikube”…

kubectl CLI

kubectl [command] [TYPE] [NAME] [flags]

Viewing, Finding Resources

# Get commands with basic output
$ kubectl get pod

To know more about the usage kindly visit https://kubernetes.io/

Also you can visit this link

Comments

Popular posts from this blog

Financial Engineering

Financial Engineering: Key Concepts Financial engineering is a multidisciplinary field that combines financial theory, mathematics, and computer science to design and develop innovative financial products and solutions. Here's an in-depth look at the key concepts you mentioned: 1. Statistical Analysis Statistical analysis is a crucial component of financial engineering. It involves using statistical techniques to analyze and interpret financial data, such as: Hypothesis testing : to validate assumptions about financial data Regression analysis : to model relationships between variables Time series analysis : to forecast future values based on historical data Probability distributions : to model and analyze risk Statistical analysis helps financial engineers to identify trends, patterns, and correlations in financial data, which informs decision-making and risk management. 2. Machine Learning Machine learning is a subset of artificial intelligence that involves training algorithms t...

Wholesale Customer Solution with Magento Commerce

The client want to have a shop where regular customers to be able to see products with their retail price, while Wholesale partners to see the prices with ? discount. The extra condition: retail and wholesale prices hasn’t mathematical dependency. So, a product could be $100 for retail and $50 for whole sale and another one could be $60 retail and $50 wholesale. And of course retail users should not be able to see wholesale prices at all. Basically, I will explain what I did step-by-step, but in order to understand what I mean, you should be familiar with the basics of Magento. 1. Creating two magento websites, stores and views (Magento meaning of website of course) It’s done from from System->Manage Stores. The result is: Website | Store | View ———————————————— Retail->Retail->Default Wholesale->Wholesale->Default Both sites using the same category/product tree 2. Setting the price scope in System->Configuration->Catalog->Catalog->Price set drop-down to...

How to Prepare for AI Driven Career

  Introduction We are all living in our "ChatGPT moment" now. It happened when I asked ChatGPT to plan a 10-day holiday in rural India. Within seconds, I had a detailed list of activities and places to explore. The speed and usefulness of the response left me stunned, and I realized instantly that life would never be the same again. ChatGPT felt like a bombshell—years of hype about Artificial Intelligence had finally materialized into something tangible and accessible. Suddenly, AI wasn’t just theoretical; it was writing limericks, crafting decent marketing content, and even generating code. The world is still adjusting to this rapid shift. We’re in the middle of a technological revolution—one so fast and transformative that it’s hard to fully comprehend. This revolution brings both exciting opportunities and inevitable challenges. On the one hand, AI is enabling remarkable breakthroughs. It can detect anomalies in MRI scans that even seasoned doctors might miss. It can trans...