0
我正在尝试更新部署中的某些值。Kubernetes - 部署无效。无效的值
# kubectl get deploy activemq-deployment -o yaml
spec:
.
.
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
.
.
我试图在飞行中更新的maxUnavailable
和maxSurge
值。我使用的命令是:
# kubectl patch deploy activemq-deployment -p '{"spec":{"strategy":{"type":"RollingUpdate","rollingUpdate":{"maxUnavailable":"2","maxSurge":"5"}}}}'
但是这个命令产生了错误:
The Deployment "activemq-deployment" is invalid:
* spec.strategy.rollingUpdate.maxUnavailable: Invalid value: "1": must match the regex [0-9]+% (e.g. '1%' or '93%')
* spec.strategy.rollingUpdate.maxSurge: Invalid value: "5": must match the regex [0-9]+% (e.g. '1%' or '93%')
看起来像它只是从我期待perfectages。如果是这样,
# kubectl patch deploy activemq-deployment -p '{"spec":{"strategy":{"type":"RollingUpdate","rollingUpdate":{"maxUnavailable":"100%","maxSurge":"100%"}}}}'
"activemq-deployment" patched
正如你所看到的,这是成功的。但是当我创建部署文件时,我使用了整数而不是百分比。任何想法为什么补丁命令不让我发布整数值?