- Overview: Init Containers enable seperation of concerns by providing a separate lifecycle for initialization related tasks distinct from main application containers.
- Init Containers in k8s are part of Pod definition, and they separate all containers in the Pods into two groups
- Init Containers
- Application Containers
- All init container are executed in sequence & all of them have to terminate sucessfully before the application containers are started up.
- Refer Here for the changeset containing sample init container code.
- A Sidecar container extends and enhances the functionality of a pre existing container without changing it.
- Now we can use side car
- to export logs
- synchronize directories
- Refer Here for the pod manifest
- Adapter pattern takes a heterogenours containerized system and makes it confirm to conistent unified interface with standard and normailized format to be consumed by outside world.
- Adapter pattern inherits all the characteristics from Sidecar, but has the single purpose of providing adapted access to the application
- We have an application which is composed of multiple microservices written in different languages
- So we need to monitor the application i.e we want applications to expose the metrics in the same format to the monitoring tool.