Kubernetes Deep Dive Room

Sign Up Free or Log In to participate!

Automatically provisioning LB on Cloud provider when we create a new service on K8

When we create a service type loadbalancer, how does kubernetes know to talk to the cloud provider and create a load balancer.. For example if my cloud provider is Azure and I have my cluster running on a bunch of VMs on Azure.. how do I provide access to my kubernetes cluster to go and provision a load balancer in Azure and expose my service through an external IP

2 Answers

It’s a little while since I’ve done anything serious with a DIY cloud cluster (not EKS, GKE, AKS etc). But normally you’d build your K8s cluster and tell it that it’s on XYZ cloud as part of the cluster initialization. This tells your K8s cluster that it’s on a particular cloud platform and you get a cloud controller running on the K8s control plane. This all does the necessary to make sure K8s knows which cloud you’re on and have access to create relevant cloud objects etc.

@Asad Alim  it is a configuration flag, e.g. "–cloud-provider=aws command-line flag" should be present for the API server, controller manager, and every Kubelet in the cluster. for more info refer to Scott Lowe blog https://blog.scottlowe.org/2018/09/28/setting-up-the-kubernetes-aws-cloud-provider/

Now that kubeadm is GA, here is how you do it with Kubeadm https://kubernetes.io/docs/concepts/cluster-administration: cloud providers


how do you add these flags for AWS the blog does not explain


when I try to duplicate the network demo the AWS LB does not deploy and just shows pending, so I am assuming I need to add these flags but not sure of the steps on what to edit and what to restart etc.


How did you create the AWS K8s lab?


Created SG, VPC US-EAST-1A, Deployed 3 Ubuntu t2.medium (1 master and 2 workers), changed the taint so that pods could also run on the master, did the standard install and used calico for the CNI plugin. Everything is operational and seems communications etc. are working. I just need to know who to configure K8s so that it know AWS is the target environment so that it can work "assuming" with the AWS API’s..


I can send my notes step by step if this helps.


I guess what I am looking for is the k8s steps for configuring k8s for aws – really confused on this part regarding new / old information


I was also reading this https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?