Aws-load-balancer-controller: The Deployment "aws-load-balancer-controller" is invalid

Created on 30 Oct 2020  路  3Comments  路  Source: kubernetes-sigs/aws-load-balancer-controller

I have run
kubectl apply -f v2_0_0_full.yaml

Here is the output with error,

customresourcedefinition.apiextensions.k8s.io/targetgroupbindings.elbv2.k8s.aws configured
mutatingwebhookconfiguration.admissionregistration.k8s.io/aws-load-balancer-webhook configured
serviceaccount/aws-load-balancer-controller unchanged
role.rbac.authorization.k8s.io/aws-load-balancer-controller-leader-election-role unchanged
clusterrole.rbac.authorization.k8s.io/aws-load-balancer-controller-role configured
rolebinding.rbac.authorization.k8s.io/aws-load-balancer-controller-leader-election-rolebinding unchanged
clusterrolebinding.rbac.authorization.k8s.io/aws-load-balancer-controller-rolebinding unchanged
service/aws-load-balancer-webhook-service unchanged
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
certificate.cert-manager.io/aws-load-balancer-serving-cert unchanged
issuer.cert-manager.io/aws-load-balancer-selfsigned-issuer unchanged
validatingwebhookconfiguration.admissionregistration.k8s.io/aws-load-balancer-webhook configured
The Deployment "aws-load-balancer-controller" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/component":"controller", "app.kubernetes.io/instance":"aws-load-balancer-controller", "app.kubernetes.io/name":"aws-load-balancer-controller"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

I haven't modified anything but still the error came. the alb is working fine for now, but not sure how this error will impact. Please elaborate

Most helpful comment

What does the current selector on your deployment look like?

$ kubectl describe deployments.apps -n kube-system aws-load-balancer-controller |grep Selector

The label selector field is immutable for Deployment object in API version apps/v1.

It seems as though you have had the helm installation at some point, and then applied the yaml manifests. If you would like to install yaml manifest, you'd need to first uninstall the helm chart completely.

To delete the helm chart,

helm delete aws-load-balancer-controller -n kube-system

All 3 comments

What does the current selector on your deployment look like?

$ kubectl describe deployments.apps -n kube-system aws-load-balancer-controller |grep Selector

The label selector field is immutable for Deployment object in API version apps/v1.

It seems as though you have had the helm installation at some point, and then applied the yaml manifests. If you would like to install yaml manifest, you'd need to first uninstall the helm chart completely.

To delete the helm chart,

helm delete aws-load-balancer-controller -n kube-system

Thank you. This is the output for the selector

Selector: app.kubernetes.io/instance=aws-load-balancer-controller,app.kubernetes.io/name=aws-load-balancer-controller

sorry, do you mean the helm installation as mentioned in this official page which I have followed

aws alb ingress

By the way, the target groups for multiple apps is not being created with Ingress resource which worked fine with previously created cluster which is of seperate VPC, but in the same VPC situation that's not working.

Sorry, I haven't read this in the process, so I don't need to run the command at all.
"If you already installed the controller using the previous step, then don't complete this step."
It's my mistake. I m closing this. thanks a lot @kishorj

Was this page helpful?
0 / 5 - 0 ratings