Some facts of Kubernetes kubeadm and kubectl - BRS MEDIA TECHNOLOGIES
Kubctl Kubernetes Commands

Some facts of Kubernetes kubeadm and kubectl

Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation.

Kind Kubernetes Logo svg

Kubernetes Local Install Tools

  • kind : kind lets you run Kubernetes on your local computer. This tool requires that you have Docker installed and configured.
minikube logo
  • minikube : Like kind, minikube is a tool that lets you run Kubernetes locally. minikube runs a single-node Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.

Kubernetes Enterprise Install Tools

Kubernetes Logo
  • kubeadm : You can use the kubeadm tool to create and manage Kubernetes clusters. It performs the actions necessary to get a minimum viable, secure cluster up and running in a user friendly way.

Kubeadm

Kubeadm is a tool built to provide kubeadm init and kubeadm join as best-practice “fast paths” for creating Kubernetes clusters. kubeadm performs the actions necessary to get a minimum viable cluster up and running. By design, it cares only about bootstrapping, not about provisioning machines. Likewise, installing various nice-to-have addons, like the Kubernetes Dashboard, monitoring solutions, and cloud-specific addons, is not in scope. Instead, we expect higher-level and more tailored tooling to be built on top of kubeadm, and ideally, using kubeadm as the basis of all deployments will make it easier to create conformant clusters.

Kubeadm commands

  • kubeadm init to bootstrap a Kubernetes control-plane node
  • kubeadm join to bootstrap a Kubernetes worker node and join it to the cluster
  • kubeadm upgrade to upgrade a Kubernetes cluster to a newer version
  • kubeadm config if you initialized your cluster using kubeadm v1.7.x or lower, to configure your cluster for kubeadm upgrade.
  • kubeadm token to manage tokens for kubeadm join
  • kubeadm reset to revert any changes made to this host by kubeadm init or kubeadm join
  • kubeadm certs to manage Kubernetes certificates
  • kubeadm kubeconfig to manage kubeconfig files
  • kubeadm version to print the kubeadm version
  • kubeadm alpha to preview a set of features made available for gathering feedback from the community

Kubectl

Kubernetes provides a command line tool for communicating with a Kubernetes cluster’s control plane, using the Kubernetes API. This tool is named kubectl. The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.

kubectl is installable command line utility on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.

  • Install kubectl on Linux
  • Install kubectl on macOS
  • Install kubectl on Windows

Syntax

Use the following syntax to run kubectl commands from your terminal window:

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

where command, TYPE, NAME, and flags are:

  1. command: Specifies the operation that you want to perform on one or more resources, for example create, get, describe, delete.
  2. TYPE: Specifies the resource type. Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms.
  3. NAME: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed.
  4. flags: Specifies optional flags. For example, you can use the -s or –server flags to specify the address and port of the Kubernetes API server.

Caution: Flags that you specify from the command line override default values and any corresponding environment variables.

Syntax

kubectl [command] [TYPE] [NAME] -o <output_format>

Depending on the kubectl operation, the following output formats are supported:

Output formatDescription
-o custom-columns=<spec>Print a table using a comma separated list of custom columns.
-o custom-columns-file=<filename>Print a table using the custom columns template in the <filename> file.
-o jsonOutput a JSON formatted API object.
-o jsonpath=<template>Print the fields defined in a jsonpath expression.
-o jsonpath-file=<filename>Print the fields defined by the jsonpath expression in the <filename> file.
-o namePrint only the resource name and nothing else.
-o wideOutput in the plain-text format with any additional information. For pods, the node name is included.
-o yamlOutput a YAML formatted API object.

kubectl commands

  • kubectl annotate – Update the annotations on a resource
  • kubectl api-resources – Print the supported API resources on the server
  • kubectl api-versions – Print the supported API versions on the server, in the form of “group/version”
  • kubectl apply – Apply a configuration to a resource by filename or stdin
  • kubectl attach – Attach to a running container
  • kubectl auth – Inspect authorization
  • kubectl autoscale – Auto-scale a Deployment, ReplicaSet, or ReplicationController
  • kubectl certificate – Modify certificate resources.
  • kubectl cluster-info – Display cluster info
  • kubectl completion – Output shell completion code for the specified shell (bash or zsh)
  • kubectl config – Modify kubeconfig files
  • kubectl cordon – Mark node as unschedulable
  • kubectl cp – Copy files and directories to and from containers.
  • kubectl create – Create a resource from a file or from stdin.
  • kubectl debug – Create debugging sessions for troubleshooting workloads and nodes
  • kubectl delete – Delete resources by filenames, stdin, resources and names, or by resources and label selector
  • kubectl describe – Show details of a specific resource or group of resources
  • kubectl diff – Diff live version against would-be applied version
  • kubectl drain – Drain node in preparation for maintenance
  • kubectl edit – Edit a resource on the server
  • kubectl exec – Execute a command in a container
  • kubectl explain – Documentation of resources
  • kubectl expose – Take a replication controller, service, deployment or pod and expose it as a new

Kubernetes Service

  • kubectl get – Display one or many resources
  • kubectl kustomize – Build a kustomization target from a directory or a remote url.
  • kubectl label – Update the labels on a resource
  • kubectl logs – Print the logs for a container in a pod
  • kubectl options – Print the list of flags inherited by all commands
  • kubectl patch – Update field(s) of a resource
  • kubectl plugin – Provides utilities for interacting with plugins.
  • kubectl port-forward – Forward one or more local ports to a pod
  • kubectl proxy – Run a proxy to the Kubernetes API server
  • kubectl replace – Replace a resource by filename or stdin
  • kubectl rollout – Manage the rollout of a resource
  • kubectl run – Run a particular image on the cluster
  • kubectl scale – Set a new size for a Deployment, ReplicaSet or Replication Controller
  • kubectl set – Set specific features on objects
  • kubectl taint – Update the taints on one or more nodes
  • kubectl top – Display Resource (CPU/Memory/Storage) usage.
  • kubectl uncordon – Mark node as schedulable
  • kubectl version – Print the client and server version information
  • kubectl wait – Experimental: Wait for a specific condition on one or many resources.

Some Facts

Kubernetes is the primary source of knowledge base of research done by Google Teams (more details in Wikipedia) and delivered to The Cloud Native Computing Foundation (CNCF) for maintenance and promotion. This foundation is started on year 2015 as project under the umbrella guidance The Linux Foundation some other Environment based on Kubernetes are as follows:

  1. Rancher
  2. Portainer
  3. Docker Swarm
  4. OpenShift
  5. Minishift
  6. Rancher
  7. Nomad
  8. AZK
  9. Apache Mesos
  10. AWS Fargate
  11. Azure Fabric
  12. KubeSphere
  13. Cannonical MicroK8s or K9s
  14. Azure Kubernetes Services (AKS)
  15. Amazon EKS
  16. Goolg Kubernetes Engine



Key Terms:

  • azure
  • ,
  • Kubernetes
  • ,
  • Open Source Software

Related Article

composer for php

What is Composer and how to use it?

Composer was inspired by projects like NPM and Bundler. Dependencies save you time and energy. Functionalities you may need for […]

calmav an open source antivirus

Easy solution for LibClamAV Error

Easy solution for “LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav” error After a fresh install of Virtualmin […]

netdata

Netdata is Real Time Server Health Monitoring Software

Netdata is an open source tool to visualize and monitor real-time metrics, optimized to accumulate all types of data, such […]