我正在尝试使用以下逻辑根据 hpa 最小副本值设置 pdb 值
spec:
{{ if (ge .Values.autoscaling.minReplicas 5) }}
minAvailable: 80
{{ else if (eq .Values.autoscaling.minReplicas 4) }}
minAvailable: 75
{{ else if (eq .Values.autoscaling.minReplicas 3) }}
minAvailable: 65
{{ else if (eq .Values.autoscaling.minReplicas 2) }}
minAvailable: 50
{{ else }}
minAvailable: 0
Run Code Online (Sandbox Code Playgroud)
但是当我执行空运行时我遇到了这个错误
Error: INSTALLATION FAILED: template: service/templates/pdb.yaml:11:7: executing "service/templates/pdb.yaml" at <ge .Values.autoscaling.minReplicas 5>: error calling ge: incompatible types for comparison
helm.go:84: [debug] template: service/templates/pdb.yaml:11:7: executing "ffservice/templates/pdb.yaml" at <ge .Values.autoscaling.minReplicas 5>: error calling ge: incompatible types …Run Code Online (Sandbox Code Playgroud)