bash kubectl get pods -A kubectl get pods --all-namespaces2.2、列出pod并显示详细信息bash kubectl get pods -o wide2.3、列出指定的deploymentbash [root@k8s-master ~]# kubectl create deploy nginx-deploy --image=nginx --port=808
kubectl [command] [TYPE] [NAME] [flags] kubectl 常用语法如上,大部分都是由以下这些参数拼装来的 command可选为create、get、describe、delete、applay、exec等,对资源进行操作 type:需要操作的资源类型,资源类型不区分大小写,您可以指定单数、复数或缩写形式,常用类型有node、pod、services、namespaces等 name:指...
kubectl get sa --all-namespaces kubectl delete daemon-set metricbeat -n efk 1. 2. 3. 1.会发现,kubectl 不管get 、delete describe等操作 后面跟资源类型 如果sa(serviceaccout) deployment pod,然后是资源名称,如果没有资源名称,则删除、获取此类型所有的资源;最后限定某个命名空间,或者全部命名空间;这个限...
通过此命令列出一个或多个资源对象,在这里通过kubectl get命令获取default命名空间下的所有部署。 kubectl get deployment # 具有基本输出的 get 命令 kubectl get services # 列出命名空间下的所有 service kubectl get pods --all-namespaces # 列出所有命名空间下的 pod kubectl get pods -o wide # 列出命名空间...
kubectl get pod -n kube-system # 获取指定名称空间中的指定pod kubectl get pod -n kube-system podName # 获取所有名称空间的pod kubectl get pod -A # 查看pod的详细信息,以yaml格式或json格式显示 kubectl get pods -o yaml kubectl get pods -o json ...
command:指定要对一个或多个资源执行的操作,例如create、get、describe、delete等。 type:指定资源类型。资源类型不区分大小写,可以指定单数、复数或缩写形式。例如,以下命令输出相同的结果: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 kubectl get pod pod1 kubectl get pods pod1 kubectl get po pod1 ...
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a9ec34d98787 nginx "nginx -g 'daemon of 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, 443/tcp nginx-app $ docker attach a9ec34d98787 ... kubectl: $ kubectl get pods NAME READY STATUS RESTARTS AGE ...
kubectl get services 查看部署列表 kubectl get deployments 获取Pod列表 kubectl get pods 获取Namespace列表 kubectl get namespaces 获取所有资源列表 kubectl get all 查看资源详细信息 查看Pod详细信息 kubectl describe pod <pod-name> 查看Deployment详细信息 kubectl describe deployment <deployment-name> 查看Service...
进入kubectl文件存放的目录,运行kubectl.exe get node可以查看集群的节点。 在同一个目录下,创建dashboard.yaml文件,其内容是前文中的dashboard.yaml,例如可以用记事本创建: 然后输入kubectl.exe create -f dashboard.yaml创建dashboard 通过kubectl.exe get pod --all-namespaces命令可以查看是否创建成功 输入...
kubectl get pod --all-namespaces 获取所有命名空间下的运行的所有Pod的标签: kubectl get pod --show-labels 获取该节点的所有命名空间: kubectl get namespace 说明: 类似可以使用“kubectl get svc”,“kubectl get nodes”,“kubectl get deploy”等获取其他资源的信息。 以YAML格式输出Pod的详细信息: kubect...