From the course: Kubernetes Essential Training: Application Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding functionality with sidecars

Adding functionality with sidecars - Kubernetes Tutorial

From the course: Kubernetes Essential Training: Application Development

Start my 1-month free trial

Adding functionality with sidecars

- [Instructor] When I introduced pods, I said they're wrapper around a container. Well, they can actually have more than one container. And this gives us a way to add functionality to our services post-hoc. For example, imagine a program that writes a lot of logs as it runs, which in this particular environment, we want to have send these logs off to a central logging server for analysis. Now, we could add a library to the program binary to send those logs, but that's a codependency. It adds build time, and importantly it bakes into the service a lot of assumptions about where and how it will be run, and the fact that it is going to be sending those logs off. We could add a log forwarding program to the container image to run alongside the main binary. But again, this is inseparable from the business logic of the service that we're delivering. And again, it makes a bunch of assumptions about how the whole package will be…

Contents