Deploying to Kubernetes
This reference guide will walk you through self-hosting Lakera Guard with Kubernetes (K8s).
A Lakera Guard pod requires access to:
- two cache volume mounts
/home/llm-guard/.local
/home/llm-guard/.cache
- a writable
/tmp
directory
Storage configuration
An ephemeral storage volume is recommended, but you should be able to use other storage layers, too:
Security configuration
Disable root access, privilege escalation, and write access to the root filesystem and set the user and group IDs with the following securityContext
configuration for the pod and the guard
container.
Pod securityContext
Container securityContext
Liveness, readiness and startup probes
The readiness and liveness probes can be defined using the /readyz
and /livez
endpoints respectively. It’s recommended to have a higher failureThreshold
value for the liveness probe than for the readiness one.
The readiness and liveness probes require the gunicorn workers to start. Because of that a startup probe is required. For that, you can use the /startupz
endpoint.
Example deployment
Here is an example deployment configuration for a Lakera Guard pod:
If you need assistance deploying to K8s, or another platform, please reach out to support@lakera.ai for guidance.