其他分享
首页 > 其他分享> > 12.kubernetes 入门(二)Pods

12.kubernetes 入门(二)Pods

作者:互联网

一. 创建 Pods

1 根据YAML配置创建 Pods
配置文件 pod.yaml 内容如下

apiVersion: v1
kind: Pod
metadata:
  name: happypanda
spec:
  containers:
  - name: nginx
    image: nginx

2 运行命令:

kubectl apply -f ./pod.yaml

二. 罗列所有 Pods

kubectl get pods

三. 删除 Pods

kubectl delete -f ./pod.yaml

或者

kubectl delete pod happypand

四. 检查删除后的 Pods

kubectl get pods

如有错误,希望读者们能够留言指出。

标签:kubectl,12,name,kubernetes,get,yaml,pod,Pods
来源: https://www.cnblogs.com/guaguaerhao/p/15871252.html