Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a sidecar in the context of microservices?

I'm currently looking through an Istio and Kubernetes talk and mention the management of services along with the use of sidecars. I'm not sure what that is.

like image 781
richard_d_sim Avatar asked Aug 23 '17 19:08

richard_d_sim


2 Answers

I think of them as helper containers. A pod can have 1 or more containers. A container should do only one thing, like a web server or load balancer. So if you need some extra work to be done inside the pod, like github sync or data processing, you create an additional container AKA sidecar.

like image 155
rrh Avatar answered Oct 23 '22 06:10

rrh


The best (original?) description of the "Sidecar"-pattern I know of is from Brendan Burns and David Oppenheimer in their publications on "Container Patterns for Distributed Systems". Check out the paper + slides here: https://www.usenix.org/conference/hotcloud16/workshop-program/presentation/burns

There are other design patterns too, like "Ambassador" or "Adapter". I'm not really sure whether the istio implementation is really a sidecar in the way they describe it there, but anyway I think that's where the term originates from.

like image 37
Florian Avatar answered Oct 23 '22 07:10

Florian