db replicas 3

kind: StatefulSet   # db-0, db-1, db-2 in order; one claim each
spec: { serviceName: db, replicas: 3, volumeClaimTemplates: [{ metadata: { name: data }, spec: { resources: { requests: { storage: 1Gi } } } }] }
---
kind: DaemonSet     # one pod per node
spec: { template: { spec: { containers: [{ name: log-agent, image: fluent-bit:3 }] } } }
---
kind: CronJob
spec: { schedule: "0 * * * *", concurrencyPolicy: Forbid,
        jobTemplate: { spec: { completions: 4, parallelism: 2, backoffLimit: 6 } } }
Back bay: StatefulSet members with a stable name and their own volume claimMiddle bay: DaemonSet, one log-agent per node, including new nodesDashed outline: where node-4 joins when you add itA Deployment's pods are interchangeable. A StatefulSet's are not: they get stable names with an ordinal, are created and removed in order, and each gets its own PersistentVolumeClaim from a template, so a replaced db-1 comes back as db-1 with its data, which databases need. A DaemonSet runs exactly one pod on every node, and adds one automatically when a node joins; log collectors and node agents use it. A Job runs pods until a number of them succeed, retrying failures up to a limit, and a CronJob creates Jobs on a cron schedule.
Next: Autoscaling & placement →