Multi-Zone Cluster, LoadBalancer with In-Zone Backends Only
1 min read
Deployment Patterns #3: Multi-Zone Cluster, App exposed via LoadBalancer Using In-Zone Backends Only
In my previous post, “IBM Cloud Kubernetes Service: Deployment Patterns for Maximizing Throughput and Availability,” I briefly described a few cluster deployment patterns that should be considered when you are looking to deploy IBM Cloud Kubernetes Service clusters. When choosing the right pattern, you must consider the requirements of the application you are running (including scale), the SLA target, and the budget.
Example deployment pattern
Let’s go through the steps to deploy an example application with the following deployment pattern below:
Steps
-
Sign up and create a multi-zone IKS cluster using the IBM Cloud Console. Consult the documentation on deploying a cluster and specifically how multi-zone clusters work. Important: You have to use the paid tier.
-
Download and apply the the following example Deployment and Service resource yaml, which will expose the
echoserver
application via theLoadBalancer
service on port1884
in three availability zones you specify in the yaml.$ kubectl apply -f iks_multi-zone_cluster_app_via_LoadBalancer_using_local_endpoints_only.yaml
Note: Do not forget to edit the lines marked withNEED TO EDIT!
-
Check the IP address of the
LoadBalancer
service:
Test the app
-
To test, load the IP:port you specified in your browser or initiate
curl
commands (like my example):$ curl http://{your IP here}:1884/
-
You should see a response like this (run it for each
LoadBalancer
IP address):
You can see the source IP address in the client_address
field because we applied the externalTrafficPolicy: Local
in the LoadBalancer
Service resource.
Finding the right pattern
As you learn more about your workload, you can adjust and even switch between patterns as needed. Different applications will require different patterns; please let us help you decide which is right!
You can learn more about the various deployment patterns in the following posts:
-
IBM Cloud Kubernetes Service: Deployment Patterns for Maximizing Throughput and Availability
-
IBM Cloud Kubernetes Service Deployment Patterns #1: Single-Zone Cluster
-
IBM Cloud Kubernetes Service Deployment Patterns #2: Multi-Zone Cluster—ALB/Ingress Controller
Contact us
If you have questions, engage our team via Slack by registering here and joining the discussion in the #general channel on our public IBM Cloud Kubernetes Service Slack.