[Security] Harden pod security and few other improvements#152
Draft
siddimore wants to merge 1 commit intolivekit:masterfrom
Draft
[Security] Harden pod security and few other improvements#152siddimore wants to merge 1 commit intolivekit:masterfrom
siddimore wants to merge 1 commit intolivekit:masterfrom
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.