官术网_书友最值得收藏!

Introduction

In Chapter 1, Introduction to Kubernetes and Containers, we saw that Kubernetes is a portable and highly extensible open-source container orchestration tool. It provides very powerful capabilities that can be used to manage containerized workloads at scale. In the previous chapter, you got the big picture of how the different components of Kubernetes work together to achieve the desired goals. We also demonstrated some basic usage of kubectl in Chapter 2, An Overview of Kubernetes. In this chapter, we will take a closer look at this utility and look at how we can make use of its potential.

To reiterate, kubectl is a command-line utility for interacting with Kubernetes clusters and performing various operations. There are two ways to use kubectl while managing your cluster - imperative management, which focuses on commands rather than the YAML manifests to achieve the desired state, and declarative management, which focuses on creating and updating YAML manifest files. kubectl can support both these management techniques to manage Kubernetes API objects (also called Kubernetes API primitives). In the previous chapter, we saw how the various components constantly try to change the state of the cluster from the actual state to the desired state. This can be achieved by using kubectl commands or YAML manifests.

kubectl allows you to send commands to Kubernetes clusters. The kubectl command can be used to deploy applications, inspect, and manage Kubernetes objects, or troubleshoot and view logs. Interestingly, even though kubectl is the standard tool for controlling and communicating with a Kubernetes cluster, it doesn't come with Kubernetes. So, even if you are running kubectl on any of the nodes of your cluster, you need to install the kubectl binary separately, which we did in Exercise 2.01, Getting Started with Minikube and Kubernetes Clusters, in the previous chapter.

This chapter will walk you through the behind-the-scenes functionality of kubectl and provide more insights into how to use kubectl commands to interact with some commonly used Kubernetes objects. We will learn how to set up some shortcuts for kubectl. We will walk you through not only creating new objects with kubectl but also making changes to a live Deployment in Kubernetes. But before that, let's take a peek behind the curtains and get an idea of exactly how kubectl communicates with Kubernetes.

主站蜘蛛池模板: 张家港市| 宁夏| 景泰县| 商南县| 岳阳县| 马关县| 女性| 瑞金市| 马尔康县| 宁国市| 长兴县| 彭泽县| 元氏县| 桐城市| 齐齐哈尔市| 鹤山市| 定州市| 锦屏县| 墨脱县| 云阳县| 永昌县| 赤水市| 贵州省| 遂溪县| 夏邑县| 阜宁县| 河津市| 富宁县| 乐昌市| 微山县| 霍林郭勒市| 四平市| 和田市| 山东省| 康保县| 贺州市| 清远市| 海淀区| 波密县| 兴化市| 东丽区|