1、kubectl create 生成yaml
- kubectl create deployment web --image=nginx -o yaml --dry-run > my1.yaml
-
- kubectl create deployment java-demo --image=lizhenliang/tomcat:v3 --dry-run -o yaml > java-demo.yaml
-
- kubectl expose deployment java-demo --port=80 --target-port=8080 --type=NodePort --dry-run -o yaml > svc.yaml && kubectl apply -f svc.yaml