Stage 8, Part 5 of 9, Storage Deep Dive

Text

PART 5: ARCHITECTURE & STRATEGY

22. Storage Architecture Patterns

Pattern 1: Simple (Single AZ)

text
┌─────────────────────────────────────────────────────────────┐
│  Single AZ                                                  │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐        │
│  │  Pod        │  │  Pod        │  │  Pod        │        │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘        │
│         │                │                │                │
│         └────────────────┴────────────────┘                │
│                          │                                  │
│                          ▼                                  │
│                  ┌─────────────┐                            │
│                  │  EBS/PD     │                            │
│                  │  (RWO)      │                            │
│                  └─────────────┘                            │
└─────────────────────────────────────────────────────────────┘

Use case: Dev, single-region.

Pattern 2: Multi-AZ (HA)

text
┌─────────────────────────────────────────────────────────────┐
│  Multi-AZ                                                   │
│  ┌───────────┐      ┌───────────┐      ┌───────────┐      │
│  │  AZ-a     │      │  AZ-b     │      │  AZ-c     │      │
│  │  Pod      │      │  Pod      │      │  Pod      │      │
│  └─────┬─────┘      └─────┬─────┘      └─────┬─────┘      │
│        │                  │                  │             │
│        ▼                  ▼                  ▼             │
│  ┌───────────┐      ┌───────────┐      ┌───────────┐      │
│  │  EBS      │      │  EBS      │      │  EBS      │      │
│  └───────────┘      └───────────┘      └───────────┘      │
└─────────────────────────────────────────────────────────────┘

Use case: Production HA.

Pattern 3: Replicated Storage (Ceph)

text
┌─────────────────────────────────────────────────────────────┐
│  Replicated Storage (Ceph)                                  │
│  ┌───────────┐      ┌───────────┐      ┌───────────┐      │
│  │  Node 1   │      │  Node 2   │      │  Node 3   │      │
│  │  OSD      │      │  OSD      │      │  OSD      │      │
│  └─────┬─────┘      └─────┬─────┘      └─────┬─────┘      │
│        │                  │                  │             │
│        └──────────────────┴──────────────────┘             │
│                          │                                  │
│                          ▼                                  │
│                  ┌─────────────┐                            │
│                  │  RBD/CephFS │                            │
│                  └─────────────┘                            │
└─────────────────────────────────────────────────────────────┘

Use case: On-prem, high availability.


23. Disaster Recovery for Stateful Workloads

DR Strategies

StrategyRPORTOCost
Backup/RestoreHoursHours$
SnapshotMinutesMinutes$$
ReplicationSecondsMinutes$$$
Active-ActiveZeroZero$$$$

Velero for Backup

Velero is the standard tool for Kubernetes backup and restore.

bash
# Install Velero
velero install \
  --provider aws \
  --bucket my-backup-bucket \
  --secret-file ./credentials-velero \
  --use-volume-snapshots=true

# Create a backup
velero backup create my-backup --include-namespaces production

# Restore
velero restore create --from-backup my-backup

Velero with CSI Snapshots

Velero can use CSI snapshots for volume backup.

yaml
apiVersion: velero.io/v1
kind: Backup
metadata:
  name: my-backup
spec:
  includedNamespaces:
  - production
  snapshotVolumes: true
  volumeSnapshotLocations:
  - my-snapshot-location

Backup Best Practices

PracticeWhy
Back up regularlyRPO
Test restoresVerify backups work
Store offsiteProtect against site failure
Encrypt backupsSecurity
AutomateConsistency

24. Compliance & Security for Storage

FrameworkStorage Requirement
PCI-DSSEncryption at rest, access controls
HIPAAEncryption, audit trails
SOC2Change management, monitoring
GDPRData residency, right to erasure
FedRAMPFIPS 140-2 encryption

Encryption

LayerHow
At restStorage encryption (EBS, PD, Azure Disk)
In transitTLS for network storage
Kubernetes Secretsetcd encryption

Encryption at Rest Example

yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: encrypted
provisioner: ebs.csi.aws.com
parameters:
  encrypted: "true"
  kmsKeyId: "arn:aws:kms:us-east-1:123456789:key/abc"

1:1 copy of the class Google Doc, code in code blocks.