my reflection on using service-mesh; after four years of avoiding it

 I remember i first heard the term "service-mesh" back in 2019. I could not understand the idea behind it at first but after some digging i learned that it provide certain capabilities while abstracting the underlying complexities. I then ran some prof of concept with Hashicorp Consul but i didn't find it appealing at that time. 

Since then I have been ignoring any opportunities for understanding and learning service mesh. I believe my desire to not use service mesh amplified after reading the great "Production Kubernetes" book by Josh Rosso where it explicitly recommends to NOT use any service mesh until you manage to get your workload up and running all the way into production and then you MAY consider the use of it. 

One thing that derived me away from introducing service-mesh in any project I worked at was that I felt it adds awfully a lot of complexities to an already complex ecosystem. Fast forward into 2024, I had an epiphany and realized having Service-mesh is essential for securing workload in Kubernetes. I have been working lately with Istio and have learnt it provides certain security capability that you can't have it otherwise without a service-mesh.

What made me change my mind?

I have been working lately a lot with security and compliance and something that I have realized and its widely accepted in the community is that is powerful as Kubernetes is as an container orchestrator, security is not its 1st class citizen. For instance:

  • Secrets in kubernetes are not encrypted by default.

  • any pod in any namespace can access any other pod in any other namespace by default.

  • communication between workloads are not encrypted by default.

when running any mission critical workload in kubernetes it would be essential to prevent lateral movement so that if one of the workload in the cluster gets compromised the attacker can't use that workload as jump host to access other workload that are running in the same cluster. or if two workloads are exchanging confidential information such as personal data, it would be essential for their communication to be encrypted even-though the communication takes place internally within the cluster and it doesn't go outside. Besides that, if having a Zero-Trust architecture within your kubernetes setup is on of your objective (which i believe it should), then having a mechanism in place that authorizes every inter-process communication becomes vital.

How can Service mesh help?

Service mesh plays an integral role in securing the kubernetes workload that is nearly impossible to achieve without it. with service-mesh such as istio you can easily achieve mTLS for communication between workloads thus ensuring all internal communications are encrypted. Besides that services mesh bring a sense of identity to each workload enabling workload to only communicate with the one that they are authorized to do so which is a characteristic of Zero-Trust architecture. 

There is relatively new feature of Kubernetes that is called "Network Policy" that one may think can do the job of service-mesh by preventing workload to call each other unless its explicitly permitted, but keep in mind that "Network Policy" act more similar to a traditional L4 firewall while service-mesh operates at Layer 7 therefore combining them can become a powerful force in securing cloud workload..

Comments

Popular posts from this blog

Azure CNI vs Kubenet, What are the differences between them and which one to use?

AWS EKS vs Azure AKS - my thoughts and reflection after using both in Production

Architecting Kubernetes for High Availability, Fault Tolerance and Business Continuity