Prerequisites
- Kubernetes cluster (v1.24+)
kubectlconfigured for your cluster- A StorageClass that supports
ReadWriteOncevolumes - Context7 license key
Registry Authentication
Context7 Enterprise images are hosted onghcr.io and require authentication. Create an image pull secret using your license key:
Manifests
Context7 Enterprise runs as a single-replica StatefulSet with persistent storage. The manifests below define the core resources: a StatefulSet for the application, a Service for internal routing, and an Ingress for external access.StatefulSet
Context7 uses SQLite and LanceDB for local storage, which require a persistent volume. This means it must run as a StatefulSet with a single replica since SQLite does not support concurrent writers.statefulset.yaml
Storage class: If your cluster does not have a default StorageClass, the PVC will stay in
Pending and the pod won’t start. Uncomment storageClassName and set it to a StorageClass available in your cluster (e.g. gp3 on AWS EKS, standard on GKE, default on AKS). Run kubectl get sc to see available options.Resource sizing: The defaults above (1 CPU / 2 GiB request) work for light usage. If you are parsing many large repositories concurrently, increase the limits. Parsing is CPU and memory intensive due to LLM calls and vector indexing.
Service
service.yaml
Ingress
ingress.yaml
context7.internal.yourcompany.com with your actual hostname and context7-tls with your TLS secret.
Apply Everything
After creating the namespace and secrets in the Registry Authentication step, apply the manifests:Networking Requirements
Context7 requires outbound connectivity to the following:
If you use NetworkPolicies, ensure egress to these endpoints is allowed:
networkpolicy.yaml
kube-dns on port 53 (UDP/TCP) is permitted for DNS resolution.
Operations
Updating
Pull the latest image and restart:Health Monitoring
The/api/health endpoint returns structured JSON with license status, connectivity, and parsed repo count. Point your monitoring stack at it:
Logs
Troubleshooting
Pod is in CrashLoopBackOff
Context7 validates your license key on startup. If the key is missing, invalid, or expired, the server exits immediately before the health endpoint is available. This means Kubernetes will reportCrashLoopBackOff rather than a failed probe.
Check the logs first:
[license] messages in the first few lines. Common causes:
- Missing or incorrect
LICENSE_KEYin thecontext7-configsecret - No outbound connectivity to
context7.comfor license validation - Expired license: contact context7@upstash.com to renew
The startup probe only comes into play after the license is validated. If the pod is crash-looping, the issue is always upstream of the probe. Check logs, not probe events.
Connecting AI Clients
Once deployed, point your MCP clients to your Ingress URL. See Connecting Your AI Client for client-specific instructions. Replacelocalhost:3000 with your Kubernetes Ingress hostname.