I am trying to add if great than condition in Helm chart. it is throwing error.
I have defined value in values.yaml and using that value in deployment.yaml for condition.
values.yaml
replicaCount: 2
deployment.yaml
rollingUpdate:
maxSurge: 1
{{ if gt .Values.replicaCount 2}}
maxUnavailable: 0
{{ else }}
maxUnavailable: 1
{{ end }}
I am using helm dry run option to check result. getting error
Error: render error in "hello-world/templates/deployment.yaml": template: hello-world/templates/deployment.yaml:16:12: executing "hello-world/templates/deployment.yaml" at <gt .Values.replicaCo...>: error calling gt: incompatible types for comparison
how to fix this ?