I have a helm chart that contains a TargetGroupBinding
{{- range $v := .Values.targetBindings }}
apiVersion: elbv2.k8s.aws/v1beta1
kind: TargetGroupBinding
metadata:
name: {{ include "fullname" $ }}-{{ $v.name }}
labels:
{{- include "labels" $ | nindent 4 }}
spec:
targetGroupARN: {{ $v.target }}
serviceRef:
name: {{ include "fullname" $ }}
port: {{ $v.port }}
---
{{- end }}
This works perfectly fine installing a new helm chart, but as soon as we attempt to run a helm upgrade we get the following error
Error: UPGRADE FAILED: failed to replace object: admission webhook "vtargetgroupbinding.elbv2.k8s.aws" denied the request: TargetGroupBinding must specify these fields: spec.targetType
As the error says, I have attempted adding the spec.targetType (which is 'ip' in this case), but in doing this I then get the error:
Error: UPGRADE FAILED: failed to replace object: admission webhook "vtargetgroupbinding.elbv2.k8s.aws" denied the request: TargetGroupBinding update may not change these fields: spec.ipAddressType
According to AWS's documentation, spec.targetType is optional (https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.8/guide/targetgroupbinding/spec/#elbv2.k8s.aws/v1beta1.TargetType)
Has anyone ever come across this before/know how to resolve it?