Reputation: 838
I installed aws-load-balancer-controller on new EKS cluster (version v1.21.5-eks-bc4871b).
I installed by this guide https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/deploy/installation/ step by step but when I'm trying to deploy ingress object I'm getting the error I mentioned in the title. I tried to do as github issues questions like here https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2039 but didn't find any answer.
What else can I do for checking this?
Upvotes: 8
Views: 23400
Reputation: 21
In my case When I created an ingress in my kubernate cluster using this command kubectl apply -f ingress.yaml
I got this issue.
Error from server (InternalError): error when creating "ingress.yaml": Internal error occurred: failed calling webhook "vingress.elbv2.k8s.aws": Post "https://aws-load-balancer-webhook-service.kube-system.svc:443/validate-networking-v1-ingress?timeout=10s": no endpoints available for service "aws-load-balancer-webhook-service"
Solution
This Issue is look like you do not have aws-load-balancer-controller
pods in kube-system namespace
Please follow this documentation AWS Load Balancer Controller Installation
I have already configured "Step 1" and "step 2" in the above documentation and then followed "Step 3: Install AWS Load Balancer Controller" and by this way my issue is fixed
Upvotes: 0
Reputation: 1309
adding below annotation solved the problem for me
alb.ingress.kubernetes.io/target-type: ip
full ingress looks like this
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
spec:
rules:
- http:
paths:
- path: /*
pathType: Prefix
backend:
service:
name: my-service
port:
number: 80
Upvotes: 0
Reputation: 226
In case it might help others - I also had the original issue using fargate profile and worker-node for core-dns. The solution for me I found in another place was just adding
node_security_group_additional_rules = {
ingress_allow_access_from_control_plane = {
type = "ingress"
protocol = "tcp"
from_port = 9443
to_port = 9443
source_cluster_security_group = true
description = "Allow access from control plane to webhook port of AWS load balancer controller"
}
}
Upvotes: 21
Reputation: 433
In my case, I've analysed the same issue this way:
aws-load-balancer-webhook-service
k8s Service, and I saw it had no endpointsaws-load-balancer-controller
k8s Deployment, it was stuck to 0/0 replicas :/aws-load-balancer-controller
Replicaset, the following error was raised by the replicaset-controller:Error creating: pods "aws-load-balancer-controller-XXX-" is forbidden: error looking up service account kube-system/aws-load-balancer-controller: service account "aws-load-balancer-controller" not found
eksctl create iamserviceaccount --name=aws-load-balancer-controller ...
) had failedeksctl-<CLUSTER_NAME>-addon-iamserviceaccount-kube-system-aws-load-balancer-controller
)Then, to apply the fix, I've:
eksctl-<CLUSTER_NAME>-addon-iamserviceaccount-kube-system-aws-load-balancer-controller
CloudFormation stackeksctl create iamserviceaccount --name=aws-load-balancer-controller
command againaws-load-balancer-controller
Replicaset from 0 to 2And it worked ;)
Upvotes: 3
Reputation: 41
This is a follow up to the accepted answer. If you are not using fargate or are confused by the answer itself, the original source refers to a Terraform script
To apply this solution from AWS Console:
Upvotes: 0
Reputation: 1
load-balancer-controller pod description for more details It may happen that the image is not available at the ECR
Upvotes: 0
Reputation: 865
I assume you are getting an error message like the following, if is not the case, please post your error.
Error from server (InternalError): error when creating "anymanifest.yaml": Internal error occurred: failed calling webhook "vingress.elbv2.k8s.aws": Post "https://aws-load-balancer-webhook-service.kube-system.svc:443/validate-networking-v1beta1-ingress?timeout=10s": context deadline exceeded
Usually, it happens due to EKS control plane can't communicate with nodes using the webhook port.
Checkout the logs of the aws-load-balancer-controller pods to check the port it started to listen
{"level":"info","ts":1643365219.2410042,"logger":"controller-runtime.webhook","msg":"serving webhook server","host":"","port":9443}
In order to fix that, in the security group of the worker nodes, allow communications of port 9443
from EKS control plane
Upvotes: 5