Skip to content

[Security] Harden pod security and few other improvements#152

Draft
siddimore wants to merge 1 commit intolivekit:masterfrom
siddimore:fix/harden-pod-security
Draft

[Security] Harden pod security and few other improvements#152
siddimore wants to merge 1 commit intolivekit:masterfrom
siddimore:fix/harden-pod-security

Conversation

@siddimore
Copy link
Copy Markdown

Changes

Security context — livekit-server and egress now default to a locked-down container security context (runAsNonRoot, readOnlyRootFilesystem, allowPrivilegeEscalation: false, drop all capabilities). Egress keeps readOnlyRootFilesystem: false because Chrome may need to write temp files. Ingress is left with an empty security context since it may need elevated privileges depending on the setup.

Startup probe — All three charts get a startup probe (failureThreshold: 30, periodSeconds: 5 = 150s max startup window). This prevents liveness from killing containers that are still initializing.

Liveness/readiness probes — Previously hardcoded in the templates. Now driven by values so operators can tune them without forking the chart.

Deployment strategy — livekit-server and ingress use maxSurge: 0, maxUnavailable: 1 because host-network pods can't have two instances binding the same ports on the same node. Egress uses maxSurge: 1, maxUnavailable: 0 for zero-downtime rollouts since it doesn't use host networking.

preStop lifecycle hook — sleep 300 on all charts. Gives kube-proxy and load balancers time to deregister endpoints before the container gets SIGTERM. Set well below terminationGracePeriodSeconds (1-5 hours) so the container still gets a clean shutdown.

priorityClassName — Empty by default, but wired in so operators can set scheduling priority.

…tegy

- Add hardened securityContext defaults for livekit-server and egress
  (runAsNonRoot, readOnlyRootFilesystem, drop ALL caps, no privilege escalation)
  Egress keeps readOnlyRootFilesystem: false for Chrome compatibility.
  Ingress left with empty securityContext - requires elevated privileges.
- Add startupProbe to all charts
- Add preStop lifecycle hook
- Add RollingUpdate deploymentStrategy
@siddimore siddimore changed the title Harden pod security, add probes, lifecycle hooks, and deployment stra… [Security] Harden pod security and few other improvements Mar 26, 2026
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.

1 participant