Complete Configuration
Key Features
Existence Cache
The existence cache wrapper prevents unnecessary lookups for known missing objects:Performance Impact: The existence cache maintains a Bloom filter of known object hashes. This significantly reduces negative lookups (“does this object exist?”) which are common in distributed builds.
Size Partitioning
Different storage strategies for small and large objects:- Small objects (<64KB): Kept in memory for fast access (headers, metadata, small source files)
- Large objects (≥64KB): Skip memory cache, go directly to persistent storage (binaries, archives)
Completeness Checking
The Action Cache uses completeness checking to ensure all referenced objects exist:Before returning a cache hit, NativeLink verifies that all output files referenced in the cached ActionResult still exist in the CAS. This prevents “cache hit but missing outputs” errors.
Compression
All objects stored to persistent volumes are compressed:Kubernetes Deployment
ConfigMap for Configuration
StatefulSet with Persistent Storage
Why StatefulSet? StatefulSets provide stable network identities and persistent storage. This is crucial for cache servers where data should persist across pod restarts.
Service for Client Access
TLS Configuration
Generate Certificates
Production Certificates: The example uses self-signed certificates for demonstration. In production, use certificates from a trusted CA (Let’s Encrypt, cert-manager, etc.).
Create Kubernetes Secret
TLS Server Configuration
Multi-Server Configuration
Three servers provide different access patterns:1. HTTP Server (Port 50051)
- Unencrypted internal communication
- Use for pod-to-pod traffic within cluster
- Lower latency, no TLS overhead
2. HTTPS Server (Port 50052)
- TLS-encrypted external access
- Use for clients outside the cluster
- Secure communication over internet
3. Worker API Server (Port 50061)
- Backend API for worker registration
- Should be cluster-internal only
- Includes health check endpoint
Security Best Practice: Use NetworkPolicies to restrict port 50061 to worker pods only. Only expose port 50052 (TLS) externally.
Platform Properties
The scheduler uses “priority” matching for most properties:- Heterogeneous worker pools (different CPU/memory configurations)
- GPU-accelerated builds routed to GPU workers
- Platform-specific builds (Linux/Windows/macOS)
Persistent Volume Storage
Storage Class Selection
Choose appropriate storage for your workload:Cache Persistence
When mounted at/tmp/nativelink/data, the PersistentVolume preserves:
/tmp/nativelink/data/content_path-cas- CAS objects/tmp/nativelink/data/content_path-ac- Action Cache entries/tmp/nativelink/data/tmp_path-*- Temporary files (can be ephemeral)
Monitoring and Health Checks
Kubernetes Liveness Probe
Readiness Probe
Resource Limits
Adjust memory limits based on your cache sizes:
- CAS memory cache: 1GB
- AC memory cache: 100MB
- Overhead: ~500MB
- Total minimum: 1.6GB, recommended: 2-4GB
Horizontal Scaling
For read scaling, deploy multiple replicas:Shared Storage Required: If running multiple replicas, all pods must access the same underlying storage (NFS, S3, etc.). See S3 Backend for distributed storage configuration.
See Also
- Multi-Worker Setup - Distributed worker configuration
- S3 Backend - Cloud object storage for multi-replica deployments
- Basic CAS Configuration - Starting point before Kubernetes deployment