Skip to content
all episodes
Code of Architecture · episode 40

Kubernetes Patterns — Behavioral Patterns

1:28:40

Episode participants

  • Mikhail Kabishchev

    guest

  • Salikh Fakhrutdinov

    guest

Conversation

What we discussed on the recording

The second Kubernetes Patterns episode covers behavioral patterns and draws a platform boundary: the rich API should not be handed to every application without constraints. The patterns express execution, instance coordination, state, and service discovery through managed primitives.

A Batch Job completes a specified amount of work and retries after failure; a CronJob adds schedules, deadlines, and concurrency policy. For frequent short tasks, a persistent process can be cheaper than creating pods. A DaemonSet places an agent on each selected node, useful for logs and metrics but costly when resources leak or are oversized.

A Singleton Service needs a leader: a lease or external lock lets active-passive instances cooperate without trusting an immortal pod. Stateless services behave like interchangeable cattle. StatefulSet adds stable identity, order, and storage, yet a complex database often needs a specialized operator.

Service Discovery compares ClusterIP, headless services, and client-side balancing; external Layer 7 traffic adds Ingress and its controller, while a service mesh extends the model internally. Self Awareness receives metadata through the Downward API. Direct API access remains risky, so roles and service accounts should be minimal.

Book series
Kubernetes Patterns
Bilgin Ibryam, Roland Huß
Book playlist