小编Ara*_*n P的帖子

在 helm 模板中面临“调用 ge 时出错:用于比较的不兼容类型”

我正在尝试使用以下逻辑根据 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)

go kubernetes-helm helm3

2
推荐指数
1
解决办法
4214
查看次数

标签 统计

go ×1

helm3 ×1

kubernetes-helm ×1