What is Kubectl?

Kubectl is a command-line tool for Kubernetes. It allows us to execute Kubernetes operations via the API. We can use Kubectl to deploy apps, check logs as well as manage all the other resources of the cluster.

Kubernetes uses an HTTP-based REST API which is the actual Kubernetes user interface employed to manage it. This means that every Kubernetes operation is represented as an API endpoint and can be carried out based on an HTTP-request sent to the endpoint.

In this article, we will review Kubectl, and outline its installation, configuration, and use.

What is Kubernetes?

The name Kubernetes has its origins from the original Greek term for helmsman or pilot. Kubernetes, or ‘k8s’ (pronounced “Kate’s”) is an open-source software tool that was created by Google and is used for scaling, deploying and coordinating containerized applications into easy to manage groups. It supports multiple containerization technologies as well as orchestrates hardware virtualization.

To manage a Kubernetes server cluster effectively, we utilize kubectl as the command-line tool of choice. Basically, kubectl communicates with the master Kubernetes node(s) which in turn submits commands to the worker nodes to manage the cluster. A Kubernetes cluster basically consists of two types of resources.

  • Master server – a master server organizes the cluster
  • Node server – Nodes are the workers that contain and run the applications

Each node contains a Kubelet, which is the agent for managing the node and communicating with the master. We can use kubectl to deploy, explore, review and remove Kubernetes objects (like nodes, images or containers).

Initially, Kubernetes was designed and developed by Google engineers to employ and utilize containers for its workload management. Google generates more than 2 billion containers deployments a week which was provided for by their internal platform code-named Borg (the predecessor to Kubernetes). During Borg’s development, the experience gained was one of the main factors that influenced a significant part of Kubernetes current technologies. Currently, Kubernetes is maintained by the Cloud Native Computing Foundation.

How to Install Kubectl?

The easiest way to install kubectl is to use one of the default package managers for a Linux OS.

Debian/Ubuntu

sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list

sudo apt-get update

sudo apt-get install -y kubectl

#tutorials #choco #cluster #debian #docker #hyper-v #hyperkit #hypervisor #kubectl #kubernetes #mac #ubuntu #virtual box #virtual environment #virtual machines #virtualized #vm #vm driver #vt-x #windows 10 #windows 8

How to Install and Configure Kubectl: A Tutorial
1.45 GEEK