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.
Contents
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 : 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
- 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:
- command: Specifies the operation that you want to perform on one or more resources, for example create, get, describe, delete.
- TYPE: Specifies the resource type. Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms.
- NAME: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed.
- 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 format | Description |
---|---|
-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 json | Output 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 name | Print only the resource name and nothing else. |
-o wide | Output in the plain-text format with any additional information. For pods, the node name is included. |
-o yaml | Output 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:
- Rancher
- Portainer
- Docker Swarm
- OpenShift
- Minishift
- Rancher
- Nomad
- AZK
- Apache Mesos
- AWS Fargate
- Azure Fabric
- KubeSphere
- Cannonical MicroK8s or K9s
- Azure Kubernetes Services (AKS)
- Amazon EKS
- Goolg Kubernetes Engine
Key Terms:
- azure ,
- Kubernetes ,
- Open Source Software