Skip to content

feat(k8s): add PodDisruptionBudgets and HorizontalPodAutoscalers for web and server - #611

Open
SceptredHead wants to merge 1 commit into
DevNiola:mainfrom
SceptredHead:feat/410-pdb-hpa-web-server
Open

SceptredHead wants to merge 1 commit into
DevNiola:mainfrom
SceptredHead:feat/410-pdb-hpa-web-server

Conversation

@SceptredHead

Copy link
Copy Markdown

Description

The web and server Deployments had fixed replica counts with no protection against voluntary disruptions and no mechanism to scale under traffic load. This PR adds PodDisruptionBudgets and HorizontalPodAutoscalers for both services.

What was implemented

PodDisruptionBudgets (deploy/k8s/base/pdb.yaml)

  • prism-server-pdb — minAvailable: 1 ensures at least one server pod survives a node drain or rolling restart.
  • prism-web-pdb — same guarantee for the web frontend.

HorizontalPodAutoscalers (deploy/k8s/base/hpa.yaml, autoscaling/v2)

  • prism-server-hpa — scales between 2 and 6 replicas when CPU exceeds 70 % average utilization or memory exceeds 80 %.
  • prism-web-hpa — same thresholds and range.

Production overlay (deploy/k8s/overlays/production/patches/hpa.yaml)

  • Raises prism-server-hpa to minReplicas: 3 / maxReplicas: 12.
  • Raises prism-web-hpa to minReplicas: 3 / maxReplicas: 10.
    These values align with the existing replicas.yaml patch that sets base replicas to 3 in production.

Both new manifests are registered in deploy/k8s/base/kustomization.yaml.

Closes #410

…web and server

Node drains and rolling updates could take down the service when replicas
are running at the minimum count. Traffic spikes had no scale-out path.

PodDisruptionBudgets (deploy/k8s/base/pdb.yaml):
- prism-server-pdb: minAvailable 1 — ensures at least one server pod
  survives voluntary disruptions (node drain, rolling restart).
- prism-web-pdb: minAvailable 1 — same guarantee for the web frontend.

HorizontalPodAutoscalers (deploy/k8s/base/hpa.yaml, autoscaling/v2):
- prism-server-hpa: scales between 2 and 6 replicas on CPU ≥ 70 % or
  memory ≥ 80 %.
- prism-web-hpa: same thresholds and range.

Production overlay (deploy/k8s/overlays/production/patches/hpa.yaml):
- Raises server minReplicas to 3 / maxReplicas to 12.
- Raises web minReplicas to 3 / maxReplicas to 10, matching the existing
  production replica patch.

Both new manifests are registered in the base kustomization.yaml.

Closes DevNiola#410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevOps] Add PodDisruptionBudgets and HorizontalPodAutoscalers to the web/server deployments

1 participant