kubectl create deployment web --image=nginx -o yaml --dry-run >my1.yaml
然后会生成到当前目录下的my1.yaml文件里
内容如下
apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: web name: web spec: replicas: 1 selector: matchLabels: app: web strategy: {} template: metadata: creationTimestamp: null labels: app: web spec: containers: - image: nginx name: nginx resources: {} status: {}