Service stuck in "pending" on EKS with Fargate
Hi!
I created a simple cluster and a simple deployment with service (see below).
eksctl create cluster --name artem-cluster --region eu-west-1 --fargate --profile mfa
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-app
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: public.ecr.aws/nginx/nginx:1.19.6
ports:
- name: http
containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: sample-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
spec:
ports:
- port: 80
targetPort: 80
protocol: TCP
type: LoadBalancer
selector:
app: nginx
But service is stuck in <pending> state -
sample-service LoadBalancer 10.100.5.193 <pending> 80:31505/TCP 5h57m
In "describe" I see the only string:
Type Reason Age From Message
Normal EnsuringLoadBalancer 29m service-controller Ensuring load balancer
By the way, if I create service without "service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip", it created successfully, but
curl <external_ip>:80 returns empty response, so I found in docs that I should use "nlb-ip" and now stuck with it.
Ah in my case I didn't read through the prereqs closely enough and hadn't set up the AWS Load Balancer Controller. This is need to create an ALB or NLB targetting IP (like in Fargates case). I followed the steps here: https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-controller-fargate/
Relevant questions
EKS NodeGroup IAM Role on Config File (yaml)
Accepted Answerasked 22 days ago[Bug] Invalid k8s resource for EKSCluster created through Clouformation
asked 10 months agoEKS Cluster stuck in updating
asked 2 months agoAmazon EKS service IP addresses
asked 3 months agoEKS Fargate: restrict access to service to only certain pods
asked 2 months agoWhy does my EKS cluster fails init on "Nodegroup... failed to stabilize"?
asked 2 years agoOpenSearch cluster stuck in creation
Accepted Answerasked 23 days agoService stuck in "pending" on EKS with Fargate
Accepted Answerasked a year agoEKS Cluster Create Failed
Accepted Answerasked 4 months agoUnable to create EKS Cluster
asked a month ago