日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Kubernetes命令行工具(kubectl)

Kubernetes命令行工具 (kubectl)

作者:全棧行動(dòng)派 2023-06-09 07:45:29

云計(jì)算

云原生 kubectl 是 Kubernetes 集群的命令行工具,通過 kubectl 能夠?qū)罕旧磉M(jìn)行管理,并能 夠在集群上進(jìn)行容器化應(yīng)用的安裝部署。

為溪湖等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及溪湖網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都做網(wǎng)站、網(wǎng)站制作、溪湖網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

1、概述

kubectl 是 Kubernetes 集群的命令行工具,通過 kubectl 能夠?qū)罕旧磉M(jìn)行管理,并能 夠在集群上進(jìn)行容器化應(yīng)用的安裝部署。

2、語(yǔ)法

使用以下語(yǔ)法從終端窗口運(yùn)行 kubectl 命令:

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

其中 command、TYPE、NAME 和 flags 分別是:

  • command:指定要對(duì)一個(gè)或多個(gè)資源執(zhí)行的操作,例如 create、get、describe、delete。
  • TYPE:指定資源類型。資源類型不區(qū)分大小寫, 可以指定單數(shù)、復(fù)數(shù)或縮寫形式。
  • NAME:指定資源的名稱。名稱區(qū)分大小寫。 如果省略名稱,則顯示所有資源的詳細(xì)信息。例如:kubectl get pods。
  • flags: 指定可選的參數(shù)。例如,可以使用 -s 或 --server 參數(shù)指定 Kubernetes API 服務(wù)器的地址和端口。

3、kubectl help 獲取更多信息

[root@k8s-master ~]# kubectl --help
kubectl controls the Kubernetes cluster manager.

 Find more information at: https://kubernetes.io/docs/reference/kubectl/

Basic Commands (Beginner):
  create          Create a resource from a file or from stdin
  expose          Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service
  run             在集群上運(yùn)行特定鏡像
  set             為對(duì)象設(shè)置指定特性

Basic Commands (Intermediate):
  explain         Get documentation for a resource
  get             顯示一個(gè)或多個(gè)資源
  edit            編輯服務(wù)器上的資源
  delete          Delete resources by file names, stdin, resources and names, or by resources and label selector

Deploy Commands:
  rollout         Manage the rollout of a resource
  scale           Set a new size for a deployment, replica set, or replication controller
  autoscale       Auto-scale a deployment, replica set, stateful set, or replication controller

Cluster Management Commands:
  certificate     修改證書資源。
  cluster-info    Display cluster information
  top             Display resource (CPU/memory) usage
  cordon          標(biāo)記節(jié)點(diǎn)為不可調(diào)度
  uncordon        標(biāo)記節(jié)點(diǎn)為可調(diào)度
  drain           清空節(jié)點(diǎn)以準(zhǔn)備維護(hù)
  taint           更新一個(gè)或者多個(gè)節(jié)點(diǎn)上的污點(diǎn)

Troubleshooting and Debugging Commands:
  describe        顯示特定資源或資源組的詳細(xì)信息
  logs            打印 Pod 中容器的日志
  attach          掛接到一個(gè)運(yùn)行中的容器
  exec            在某個(gè)容器中執(zhí)行一個(gè)命令
  port-forward    將一個(gè)或多個(gè)本地端口轉(zhuǎn)發(fā)到某個(gè) Pod
  proxy           運(yùn)行一個(gè)指向 Kubernetes API 服務(wù)器的代理
  cp              Copy files and directories to and from containers
  auth            Inspect authorization
  debug           Create debugging sessions for troubleshooting workloads and nodes

Advanced Commands:
  diff            Diff the live version against a would-be applied version
  apply           Apply a configuration to a resource by file name or stdin
  patch           Update fields of a resource
  replace         Replace a resource by file name or stdin
  wait            Experimental: Wait for a specific condition on one or many resources
  kustomize       Build a kustomization target from a directory or URL.

Settings Commands:
  label           更新某資源上的標(biāo)簽
  annotate        更新一個(gè)資源的注解
  completion      Output shell completion code for the specified shell (bash, zsh, fish, or powershell)

Other Commands:
  alpha           Commands for features in alpha
  api-resources   Print the supported API resources on the server
  api-versions    Print the supported API versions on the server, in the form of "group/version"
  config          修改 kubeconfig 文件
  plugin          Provides utilities for interacting with plugins
  version         輸出客戶端和服務(wù)端的版本信息

Usage:
  kubectl [flags] [options]

Use "kubectl  --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).
[root@k8s-master ~]#

4、kubectl子命令使用分類

(1)基礎(chǔ)命令

(2)部署和集群管理命令

(3)故障和調(diào)試命令

(4)其他命令


網(wǎng)站欄目:Kubernetes命令行工具(kubectl)
轉(zhuǎn)載來(lái)源:http://m.5511xx.com/article/cdhesic.html