我正在尝试将部署策略添加为滚动部署。但是我不确定为什么这行不通。我们在OpenShift中具有相同的配置,该配置可以正常运行,但是在Kubernetes中会失败。
deployment.yaml
spec:
{{- if eq .Values.autoscale.enabled false}}
replicas: {{ .Values.deployment.replicaCount }}
{{- end }}
{{- if eq .Values.strategy.enabled true}}
strategy:
activeDeadlineSeconds: {{ .Values.strategy.activeDeadlineSeconds }}
rollingParams:
intervalSeconds: {{ .Values.strategy.rollingParams.intervalSeconds }}
maxSurge: {{ .Values.strategy.rollingParams.maxSurge }}
maxUnavailable: {{ .Values.strategy.rollingParams.maxUnavailable }}
timeoutSeconds: {{ .Values.strategy.rollingParams.timeoutSeconds }}
updatePeriodSeconds: {{ .Values.strategy.rollingParams.updatePeriodSeconds }}
type: {{ .Values.strategy.type }}
{{- end}}
values.yaml:
strategy:
enabled: true
activeDeadlineSeconds: 21600
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
错误:
Error: UPGRADE FAILED: error validating "": error validating data: [ValidationError(Deployment.spec.strategy): unknown field "activeDeadlineSeconds" in io.k8s.api.apps.v1.DeploymentStrategy, ValidationError(Deployment.spec.strategy): unknown field "rollingParams" in io.k8s.api.apps.v1.DeploymentStrategy]
helm.go:75: [debug] error validating "": error validating data: [ValidationError(Deployment.spec.strategy): unknown field "activeDeadlineSeconds" in io.k8s.api.apps.v1.DeploymentStrategy, ValidationError(Deployment.spec.strategy): unknown field "rollingParams" in io.k8s.api.apps.v1.DeploymentStrategy]
我不确定是什么问题。我检查了io.k8s.api.apps.v1.DeploymentStrategy的文档,但是无法正常工作
谢谢
答案 0 :(得分:4)
您的变量名似乎有误,请检查其文档说应按照您的尝试进行操作,转到工作的生产示例中,如下所示:
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
更改变量名,让我知道是否有帮助。