Working with Container Orchestration

1. Understanding Container Orchestration

CapabilityDetail
SchedulingPlace containers on nodes
Self-healingRestart, reschedule
ScalingHPA/VPA, cluster autoscaler
Service discoveryBuilt-in DNS
StandardKubernetes

2. Defining Service Manifests

Example: Kubernetes Deployment + Service

apiVersion: apps/v1
kind: Deployment
metadata: { name: orders }
spec:
  replicas: 3
  selector: { matchLabels: { app: orders } }
  template:
    metadata: { labels: { app: orders } }
    spec:
      containers:
      - name: app
        image: registry/orders:1.4.0
        ports: [{ containerPort: 8080 }]
        readinessProbe: { httpGet: { path: /readyz, port: 8080 } }
        resources: { requests: { cpu: 200m, memory: 256Mi }, limits: { cpu: 1, memory: 512Mi } }
---
apiVersion: v1
kind: Service
metadata: { name: orders }
spec:
  selector: { app: orders }
  ports: [{ port: 80, targetPort: 8080 }]

3. Managing Service Replicas

AspectDetail
replicasStatic count
HPAAuto on metrics
PDBMin available during disruptions
Anti-affinitySpread across nodes/zones

4. Implementing Health Checks

ProbeAction
livenessRestart container
readinessRemove from Service endpoints
startupDelay other probes

5. Using Resource Limits

FieldDetail
requestsScheduler reservation
limitsHard cap (OOMKill, throttle)
QoSGuaranteed / Burstable / BestEffort
TipJVM: -XX:MaxRAMPercentage

6. Implementing Service Discovery

MechanismDetail
CoreDNSsvc.namespace.svc.cluster.local
Headless ServicePer-pod DNS for stateful
MeshSidecar / ambient L7 routing

7. Managing Configuration

ResourceUse
ConfigMapNon-secret config
MountFile or env
ReloadSubscribe / restart

8. Handling Secrets

ApproachDetail
Secret resourcebase64; enable etcd encryption
External Secrets OperatorSync from Vault / SM / KMS
CSI Secret StoreMount directly

9. Implementing Rolling Updates

SettingDetail
strategyRollingUpdate (default)
maxSurge25% typical
maxUnavailable0 for critical

10. Using Persistent Storage

ObjectDetail
PV / PVCClaim storage
StorageClassDynamic provisioning
StatefulSetStable identity + per-pod PVC
CSI driverEBS, GCE PD, Ceph, Longhorn

11. Implementing Auto-Scaling

LayerTool
Pod horizontalHPA
Pod verticalVPA
Event-drivenKEDA
NodeCluster Autoscaler / Karpenter

12. Managing Namespaces and Multi-Tenancy

ElementDetail
NamespaceIsolation boundary
ResourceQuotaCap per ns
LimitRangeDefaults per pod
NetworkPolicyL3/L4 isolation
vCluster / CapsuleStronger tenancy