News for hackers. Stuff that matters.
Re:Fly Kubernetes by javaunsafe2019 on Monday December 18, 2023 @04:30PM (#38688596)
Why should you do this - sounds like an antipattern to me
Re:Fly Kubernetes by kuhsaft on Monday December 18, 2023 @04:37PM (#38688686)
It’s used widely in the Kubernetes world and is known as sidecars [0].

[0] https://kubernetes.io/blog/2023/08/25/native-sidecar-contain...

Re:Fly Kubernetes by javaunsafe2019 on Monday December 18, 2023 @05:34PM (#38689358)
Widely? I lived in this helm, kubernetes, pulumi world the past 4 years and we followed the simple rule of one service/container per pod. Why add complexity where it’s not needed. Like running a dB a and a service in the same docker container - a no go for me and many.
Re:Fly Kubernetes by ossm1db on Monday December 18, 2023 @07:36PM (#38690321)
Kubernetes official documentation states, "A Pod is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers."

Running more than one container in a pod is a fundamental concept of Kubernetes. Init containers and sidecars allow for a separation of concerns, which is essential for non-cloud-native workloads. Logging and telemetry are just a couple of features which may be designed and built into cloud-native applications, but legacy applications need this flexibility without modifying the application itself.

The fact you ran K8S for four years without it demonstrates only that it is not required by your workload -- not that it is "unnecessary complexity" or an "anti-pattern."

Re:Fly Kubernetes by kuhsaft on Monday December 18, 2023 @06:34PM (#38689880)
The thing is you might not be adding the sidecars yourself.

Kubernetes has a resource called MutatingAdmissionWebhook that allows mutations of the Pod object before creation.

I think the most common use case is for service meshes. Your Deployment might not have any sidecars, but the service mesh controller will automatically add a network proxy container to your pod via the admission webhook.

Another use case would be OpenTelemetry or some other observability service sidecar injection for auto-instrumentation.

Re:Fly Kubernetes by javaunsafe2019 on Thursday December 21, 2023 @02:23PM (#38725432)
Ok that was something inward missing on my end. Thanks for all the explanations and sorry for me being wrong
Re:Fly Kubernetes by qeternity on Monday December 18, 2023 @06:22PM (#38689779)
Nobody would suggest this. But what about a metrics scraper for your db pod? That’s where sidecars come in.
Re:Fly Kubernetes by GauntletWizard on Monday December 18, 2023 @06:25PM (#38689813)
Like helm, it's a widely used anti-pattern
Re:Fly Kubernetes by postalrat on Monday December 18, 2023 @04:49PM (#38688853)
Its because you have multiple processes (containers) that work together in their little pod. You could stick them all in a single image somehow but that would be much more work and less flexible.