kubernetes deployment可以强制更新么?


在创建deployment的env使用了configmap,更新了configmap pod不会生效,需要更新delopyment,但是deployment配置没有变化的情况下执行kubectl -replace -f dep.yaml不会更新pod,加--force也不行,求解~~
apiVersion: v1
kind: ConfigMap
metadata:
name: centos-config
data:
SYSLOG_HOST: "10.12.7.21"

......
    spec:
        containers:
            - name: centos
              image: centos7
              imagePullPolicy: IfNotPresent            
              ports:
                - containerPort: 8888
              envFrom:
                - configMapRef:
                    name: centos-config
......
已邀请:

silenceshell - ieevee.com

赞同来自:


可以先scale为0,然后再scale为你的副本数

kubectl scale --replicas=0 rs/foo
kubectl scale --replicas=3 rs/foo

要回复问题请先登录注册