Flag --replicas has been deprecated, has no effect and will be removed in the future.
翻译为:标志—副本已弃用,没有效果,并将在未来被移除。在执行Deployment命令时[root@master ~]# kubectl run nginx --image=nginx:latest --port=80 --replicas=3 -n devFlag --replicas has been deprecated, has no effect and will be removed i
·
翻译为:标志—副本已弃用,没有效果,并将在未来被移除。
在执行Deployment命令时
[root@master ~]# kubectl run nginx --image=nginx:latest --port=80 --replicas=3 -n dev
Flag --replicas has been deprecated, has no effect and will be removed in the future.
会报这个错误。原因在于K8S v1.18.0以后,–replicas已弃用 ,推荐用 deployment 声明试对象创建 pod。
类如:vim deploy-nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: dev
spec:
replicas: 3
selector:
matchLabels:
run: nginx
template:
metadata:
labels:
run: nginx
spec:
containers:
- image: nginx:latest
name: nginx
ports:
- containerPort: 80
protocol: TCP
创建:kubectl create -f deploy-nginx.yaml
删除:kubectl delete -f deploy-nginx.yaml
更多推荐
已为社区贡献7条内容
所有评论(0)