kubectl命令使用大全
 
[root@master-test ~]# kubectl --help
kubectl controls the Kubernetes cluster manager. Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/ Basic Commands (Beginner):
create Create a resource from a file or from stdin.
expose 使用 replication controller, service, deployment 或者 pod 并暴露它作为一个 新的
Kubernetes Service
run 在集群中运行一个指定的镜像
set 为 objects 设置一个指定的特征 Basic Commands (Intermediate):
explain 查看资源的文档
get 显示一个或更多 resources
edit 在服务器上编辑一个资源
delete Delete resources by filenames, 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, ReplicaSet or Replication Controller
autoscale 自动调整一个 Deployment, ReplicaSet, 或者 ReplicationController 的副本数量 Cluster Management Commands:
certificate 修改 certificate 资源.
cluster-info 显示集群信息
top Display Resource (CPU/Memory/Storage) usage.
cordon 标记 node 为 unschedulable
uncordon 标记 node 为 schedulable
drain Drain node in preparation for maintenance
taint 更新一个或者多个 node 上的 taints Troubleshooting and Debugging Commands:
describe 显示一个指定 resource 或者 group 的 resources 详情
logs 输出容器在 pod 中的日志
attach Attach 到一个运行中的 container
exec 在一个 container 中执行一个命令
port-forward Forward one or more local ports to a pod
proxy 运行一个 proxy 到 Kubernetes API server
cp 复制 files 和 directories 到 containers 和从容器中复制 files 和 directories.
auth Inspect authorization Advanced Commands:
diff Diff live version against would-be applied version
apply 通过文件名或标准输入流(stdin)对资源进行配置
patch 使用 strategic merge patch 更新一个资源的 field(s)
replace 通过 filename 或者 stdin替换一个资源
wait Experimental: Wait for a specific condition on one or many resources.
convert 在不同的 API versions 转换配置文件
kustomize Build a kustomization target from a directory or a remote url. Settings Commands:
label 更新在这个资源上的 labels
annotate 更新一个资源的注解
completion Output shell completion code for the specified shell (bash or zsh) Other Commands:
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 输出 client 和 server 的版本信息 Usage:
kubectl [flags] [options] Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).

那么我希望能用kubectl Tab能补全命令需要怎么做呢

 
在centos用户下
# cd ~;echo "source <(kubectl completion bash)" >> .bashrc
# . <(kubectl completion bash)
 
当然,也可以写入到/etc/profile里.退出当前终端,重启进去,以便加载source即可
 

一些实用命令

Q1:当kubectl get po 看到STATUS状态不正常时怎么查找问题?

 [root@master-test ~]# kubectl describe pods nginx-test-97c58fcc-9ncz2

还可以,查看日志

[root@master-test ~]# kubectl logs etcd-master-test -n kube-system

 

kubectl命令小妙招的更多相关文章

  1. 14个Linux系统安全小妙招,总有一招用的上!

    对于互联网IT从业人员来说,越来越多的工作会逐渐转移到Linux系统之上,这一点,无论是开发.运维.测试都应该是深有体会.曾有技术调查网站W3Techs于2018年11月就发布一个调查报告,报告显示L ...

  2. 【CSS】小妙招,各种问题总结方法处理

    1.实现div文字溢出自动省略号截取   overflow:hidden;  /*超过部分不显示*/   text-overflow:ellipsis;  /*超过部分用点点表示*/   white- ...

  3. Angular 开发小妙招1:提交表单数据验证不通过,更改输入组件的样式

    开发表单时,客户端数据完整性校验是必不可少的,在jquery 时代出现了无数的数据验证插件也很好用,开发Angular 应用时,angular 内置了一些常用的数据验证指令.今天要讲的不是这些指令如何 ...

  4. 【转】一个小妙招能让你在服装上省下好多rmb

    朋友们,你们仔细算过自己每年在淘宝上买衣服消费了多少rmb吗?100?1000?10000?甚至更多? 朋友们,你知道淘宝上大多数店铺的衣服是哪里来的吗? 朋友们,你知道怎么在这上面能节省更多的mon ...

  5. MySQL总结小妙招

    mysql5.7版本,免登陆修改管理员密码: vim /etc/my.cnf 加入skip-grant-tables,重启MySQL 终端输入 mysql ,直接登录MySQL数据库,然后use my ...

  6. 这里有40条提升编程技能小妙招!还有TIOBE 7月份的编程语言排行榜

    如何提高编程技能?恐怕很多开发者思考过这个问题.最近,拥有将近 15 年开发经验的软件工程师 Kesk -*- 写了一篇博客,列举了 40 条对其职业生涯有所帮助的事项.   或许,通过以下 40 个 ...

  7. 关于MySQL索引知识与小妙招 — get get get

    一.索引基本知识 1.1 索引的优点 大大减少了服务器需要扫描的数据量,加快数据库的检索速度 帮助服务器避免排序和临时表 将随机io变成顺序io 1.2 索引的用处 速查找匹配WHERE子句的行 从c ...

  8. 下载kaggle数据集的小妙招

    kaggle是很多数据分析和机器学习初学者非常喜爱的数据科学竞赛平台. 这个平台上有很多接近现实业务场景的数据集,非常适合练手. 今天向大家推荐一个下载kaggle数据集的小工具--kaggleAPI ...

  9. 一种比css_scoped和css_module更优雅的避免css命名冲突小妙招

    css_scoped 与 css_module 我们知道,简单的class名称容易造成css命名重复,比如你定义一个class: <style> .main { float: left; ...

随机推荐

  1. MGRE及实验

    tunnel 隧道:一种的简单的VPN技术: 普通的tunnel为点到点网络类型: 生成隧道接口,流量通过路由查询后,若通过隧道接口转发时,需要在原有的三层报头前,再添加一个公有地址间的报头: 将两个 ...

  2. Mall电商实战项目发布重大更新,全面支持SpringBoot 2.3.0

    1. 前言 前面近一个月去写自己的mybatis框架了,对mybatis源码分析止步不前,此文继续前面的文章.开始分析mybatis一,二级缓存的实现. 附上自己的项目github地址:https:/ ...

  3. 使用JWT登录生成token

    package com.example.demo.util; import com.auth0.jwt.JWT; import com.auth0.jwt.JWTVerifier; import co ...

  4. mybatis里的mapper,@Mapper参数,Mapper.xml文件 sql语句Select+where语句

    提示:有不清楚的可以试着看一下我最后的连接,是跟这些内容相关的 Mapper文件,特殊符号: 转义符号 原符号 中文意思 &It; < 小于号 > > 大于号 & & ...

  5. 你不可不知的WEB安全知识(第一部分:HTTPS, TLS, SSL, CORS, CSP)

    译   原文地址:https://dev.to/ahmedatefae/web-security-knowledge-you-must-understand-it-part-i-https-tls-s ...

  6. Decision trees决策树

    信息熵(entropy) 信息熵模型(香农Shannon's Entropy Model) 在一个随机事件中,某个事件发生的不确定度越大,熵也就越大,那我们要搞清楚所需要的信息量越 信息增益(IG,I ...

  7. NodeJS二进制合并

    Node.js 批量文件合并code cnblogs @ Orcim  本 文主要介绍使用 Node 进行 ACB 序列文件(Atom CueSheet Binary,编译 AtomCueSheet ...

  8. 2020.09.05【NOIP提高组&普及组】模拟赛C组1总结

    T1:机器翻译 这一道题是一个很简单的队列题目,我们只要每次维护队列元素数量保持在m以内即可 T2:乌龟棋 这一道题我一开始比赛是暴力枚举(万事先暴力),很明显这个肯定会超时(30分)那么考虑动态规划 ...

  9. Informatica报错“表或视图不存在”的某种原因

    软件版本:9.6.1 背景:测试将OLTP数据库的用户信息表(CUST_INFO)抽取到DW库(DW_CUST_INFO) 问题:工作流启动后,报错RR_4035,并告知表或视图不存在 分析:在导入源 ...

  10. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决方案

    在Win7下使用MySQL5.6.35创建用户时,提示权限不足,具体解决方案如下: 1 停止mysql服务 net stop mysql 2 打开新的cmd窗口,切换到bin目录,运行如下命令,cmd ...