k8s快速生成一个deploymenet的yaml文件
kubectl create deployment nginx --image=nginx:1.20 -o yaml --dry-run=client > my-deployment.yaml
cat my-deployment.yaml
apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: nginx name: nginx spec: replicas: 1 selector: matchLabels: app: nginx strategy: {} template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.20 name: nginx resources: {} status: {}
我们修改之后进行kubectl apply -f my-deployment.yaml 生效
本文来自博客园,作者:忙碌在路上,转载请注明原文链接:https://www.cnblogs.com/netsa/p/15955117.html