IKS Deployment Patterns #4: Multi-Zone Cluster, App exposed via LoadBalancer Aggregating whole Region Capacity

How can I deploy and expose my application in my IBM Cloud Kubernetes Service (IKS) directly with the LoadBalancer service in a multi-zone cluster and aggregate the whole region capacity by using all endpoints that live in the whole region (all availability zones)?

Example Deployment Pattern

In this article we are going to go through the steps to deploy an example application with the following deployment pattern bellow:

Steps

1. Sign up and create a multi-zone IKS cluster using the IBM Cloud Console. Documentation on deploying a cluster and specifically how multi-zone clusters work. Important: you have to use the paid tier.

2. Open a ticket! Important: There is a manual step for this to work unfortunately. You have to open a ticket on the portal (Technical > Infrastructure > Public Network Question) and add the following to the request:

“Please set up the network to allow capacity aggregation on the public VLANs associated with my account. {It is even better if you list your public VLANs.} The reference ticket for this request is: https://control.softlayer.com/support/tickets/63859145"

3. Download and apply the the following example Deployment and Service resource yaml, which will expose the echoserver application via the LoadBalancer service on port 1884 in three availability zones you specify in the yaml.
$ kubectl apply -f iks_multi-zone_cluster_app_via_LoadBalancer_and_aggregate_capacity.yaml 
Note: do not forget to edit the lines marked with NEED TO EDIT!

4. Check the IP address of the LoadBalancer service:

Test the App

  1. To test load the IP:port you specified in your browser or initiate curlcommands (like my example): 
    $ curl http://{your IP here}:1884/
  2. You shall see a response like the following. (Run it for each LoadBalancerIP address.)

You can see the source IP address in the client_address field because we applied the externalTrafficPolicy: Local in the LoadBalancer Service resource. On the return path the packets are using their local gateway to leave IBM Cloud.

Summary

As you learn more about your workload you can adjust and even switch between patters as needed. Different applications will require different patterns; please let us help you with your pattern! To read about other patterns follow this link to the IBM Cloud Blog or this on Medium.com.

Contact us

If you have questions, engage our team via Slack by registering here and join the discussion in the #general channel on our public IBM Cloud Kubernetes Service Slack.