k8s service: how to create ELB in a private subnet

For a k8s service in a AWS private subnet. By default it won’t create ELB. In order to get k8s doing all the grunt work of ELB creation, register k8s worker instance with the ELB, add listener, tag it property. there is a magic annotation here.

magic annotation

kubectl annotate the service

kubectl --namespace=guestbook annotate service frontend  service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0

Advertisements
This entry was posted in k8s and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s