HA & DR Planner
Turn RPO and RTO targets into a DR strategy
Builds Kubernetes manifests (Deployment, Service, Ingress, HPA, ConfigMap, PodDisruptionBudget) with probes, resource limits and a hardened security context.
apiVersion: v1
kind: Namespace
metadata:
name: shop
labels:
pod-security.kubernetes.io/enforce: restricted
---
apiVersion: v1
kind: ConfigMap
metadata:
name: web-config
namespace: shop
labels:
app.kubernetes.io/name: web
data:
LOG_LEVEL: info
ASPNETCORE_URLS: http://+:8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: shop
labels: &a1
app.kubernetes.io/name: web
spec:
revisionHistoryLimit: 5
selector:
matchLabels: *a1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *a1
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: web
image: ghcr.io/contoso/web:1.4.2
ports:
- name: http
containerPort: 8080
envFrom:
- configMapRef:
name: web-config
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
memory: 256Mi
readinessProbe:
httpGet: &a2
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet: *a2
initialDelaySeconds: 15
periodSeconds: 20
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- ALL
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels: *a1
---
apiVersion: v1
kind: Service
metadata:
name: web
namespace: shop
labels: &a1
app.kubernetes.io/name: web
spec:
type: ClusterIP
selector: *a1
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
namespace: shop
labels:
app.kubernetes.io/name: web
annotations:
cert-manager.io/cluster-issuer: letsencrypt
spec:
ingressClassName: nginx
tls:
- hosts:
- shop.contoso.com
secretName: web-tls
rules:
- host: shop.contoso.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
name: http
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web
namespace: shop
labels:
app.kubernetes.io/name: web
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: web
namespace: shop
labels: &a1
app.kubernetes.io/name: web
spec:
minAvailable: 1
selector:
matchLabels: *a1
kubectl apply -f web.yaml --dry-run=server # validate against the cluster first kubectl apply -f web.yaml kubectl -n shop rollout status deployment/web kubectl -n shop get pods,svc,ingress,hpa -l app.kubernetes.io/name=web
Uses stable APIs (apps/v1, networking.k8s.io/v1, autoscaling/v2, policy/v1). The hardened settings need an image that runs as a non-root user and only writes to /tmp; adjust runAsUser if your image uses a different UID. Generated in your browser.
Opinions differ. CPU limits can throttle a pod even when the node has spare CPU, so many teams set CPU requests and memory limits but no CPU limit. Memory limits matter more, because one pod can otherwise exhaust a node.
When an autoscaler manages the Deployment, setting replicas as well makes every kubectl apply reset the count. The HorizontalPodAutoscaler’s min and max replicas take over.
In a Kubernetes Secret, or better an external secrets store such as Azure Key Vault or AWS Secrets Manager via the Secrets Store CSI driver or External Secrets Operator, never in a ConfigMap.
Last updated 4 Dec 2026 · More in Infrastructure & Capacity
Turn RPO and RTO targets into a DR strategy
Usable space, failure tolerance and speed across RAID and ZFS
How much storage and how long will it take?