我想以简单的方式调试pod,因此我想在没有部署的情况下启动pod .
但它会自动创建部署
$ kubectl run nginx --image=nginx --port=80
deployment "nginx" created
所以我必须创建 nginx.yaml
文件
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
并创建如下的pod,然后它只创建pod
kubectl create -f nginx.yaml
pod "nginx" created
如何在命令行中指定 kind:Pod
以避免 deployment
?
//我在Windows 7下运行minikue 0.20.0和kubernetes 1.7.0
2 回答
你的意思是“揭露服务”吗?我认为这个命令行可以帮助你做到这一点 .
见官方文件https://kubernetes.io/docs/user-guide/kubectl-conventions/#generators