[liwm@rmaster01 ~]$ kubectl run --image=nginx my-web -o yaml --dry-runkubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.apiVersion: apps/v1kind: Deploymentmetadata: creationTimestamp: null labels: run: my-web name: my-webspec: replicas: 1 selector: matchLabels: run: my-web strategy: {} template: metadata: creationTimestamp: null labels: run: my-web spec: containers: - image: nginx name: my-web resources: {}status: {}
[liwm@rmaster01 ~]$[liwm@rmaster01 ~]$ cat nginx-deployment.yaml apiVersion: apps/v1kind: Deploymentmetadata: name: nginx-deployment labels: app: nginx-deployspec: replicas: 1 selector: matchLabels: app: nginx-pod template: metadata: labels: app: nginx-pod spec: containers: - name: nginx image: nginx:1.7.6 imagePullPolicy: IfNotPresent ports: - containerPort: 80[liwm@rmaster01 ~]$