执行命令kubectl run nginx --image=nginx --replicas=2 --port=80
会反馈
Flag --replicas has been deprecated, has no effect and will be removed in the future. 并且只创建一个nginx 容器实例
在K8S v1.18.0以后,–replicas已弃用 ,推荐用 deployment 创建 pods
vim nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec