K8s service type ELB stuck at inprogress

12/19/2018

Deployed K8s service with type as LoadBalancer. K8s cluster running on an EC2 instance. The service is stuck at "pending state".

Does the service type 'ELB' requires any stipulation in terms of AWS configuration parameters?

-- tanmoy
amazon-ec2
amazon-elb
amazon-web-services
kubernetes

1 Answer

12/19/2018

Yes. Typically you need the option --cloud-provider=aws on:

  • All kubelets
  • kube-apiserserver
  • kube-controller-manager

Also, you have to make sure that all your K8s instances (master/nodes) have an AWS instance role that allows them to create/remove ELBs and routes (All access to EC2 should do).

Then you need to make sure all your nodes are tagged:

  • Key: KubernetesCluster, Value: 'your cluster name'
  • Key: k8s.io/role/node, Value: 1 (For nodes only)
  • Key: kubernetes.io/cluster/kubernetes, Value: owned

Make sure your subnet is also tagged:

  • Key: KubernetesCluster, Value: 'your cluster name'

Also, your Kubernetes node definition, you should have something like this:

ProviderID: aws:///<aws-region>/<instance-id>

Generally, all of the above is not needed if you are using the Kubernetes Cloud Controller Manager which is in beta as of K8s 1.13.0

-- Rico
Source: StackOverflow