Posts

Setting up A\B split between services in Kubernetes using Nginx Ingress Canary feature

Image
 I have been wanting to setup an A\B split with specific weight ratio between two services in my cluster, but had no clue how to achieve that. I am aware of the fact that if I were to use almost any Service mesh such as I stio, Linkerd, Consul , and etc... then this would be something that is supported out of the box, but how about when I don't have Service mesh? Well, I did a little bit of research and at the first sight I didn't find much clue on how this can be achieved. Take a look at below image to understand what I am trying to achieve here: As you can see, I have my Ingress Controller with two services, what I am trying to achieve is that when my nginx controller get the request is routes it 70% of the time to Service A, and 30% of the time to Service B. After digging a little further I found the answer lies in the nginx official document here . it's a annotation called Canary that enables routing between services using either of the following conditions: Header : yo...

Architecting Kubernetes for High Availability, Fault Tolerance and Business Continuity

Image
Kubernetes can take care of many things, and can solve many problems except the ones it doesn't know about such as region failure and  human errors. In this post I want to compare and contrast the differences between Single Cluster setup spread across multi Availability Zones that is very common vs Multi Cluster Setup Spread across different Region . Hopefully by then end of this post you have some clue about when to use which setup no matter which cloud provider you are using; be it AWS, Azure, or GCP. Single Cluster Setup: In this Setup the Kubernetes nodes and their storages are distributed across multiple Availability Zones (AZ). This model ensures the nodes are physically separated from each other and the outage in one of the AZ will not cause the entire cluster to go out of service. At the same time the communication between each node is via private connection and does not route over internet no matter which cloud provider you use. I took the following image wh...

Sync vs Async Interprocess communication in Microservices Acthictecture. When to use which?

Image
I spend the first half of 2020 researching about how services should communication with each other in Microservices architecture. This was a topic that I was and still genuinely interested   and curious about and turn it into my Master thesis research.  I then turn my work into a scientific paper and got it published at  the "International Workshop on Quantitative Approaches to Software Quality, 2020 " which you can read it here for free. But I wanted to write this blog post to explain what I did in a much more practical and less academic terms. So here we go: What is Interprocess communication? In simple term, IPC is the mechanism for two independent processes to communicate with each other in order to exchange information. Take a look at above diagram that I found here as an example, IPC is about answering how the RED service, can communicate with the Green service. What protocol it uses? does it use REST API over HTTP or some other protocol.   and what messag...

Kubernetes Cluster Federation, A.K.A KubeFed. When can it be useful? and 3 things to be aware of.

Image
Disclaimer: This post does not intend to discuss  WHAT K8 Federation is, rather attempts to answer the question of  When Federation can be useful. So, lately I have came across an interesting topic in K8 which is called Cluster Federation A.K.A KubeFed. In it's core Cluster Federation enables Coordination and Configuration of two or more independent cluster. In another words you can combine the power of two or more clusters and let them work in Parallel for running a common task. In this model, one Cluster will act as the coordinator server also known as Host Cluster, and manages the configuration of several independent cluster under it's hook.  To understand it's concept better, I followed this awesome walkthrough I found on internet, and then I created 3 Clusters, one running on Azure (AKS), another running on AWS (EKS), and third one running on GCloud (GKE). In my setup I choose the GKE cluster as the HOST cluster, and registered the other two cluster underneath ...