Helm Chart Deployment
Helm is the recommended way to deploy Code Search on Kubernetes. It provides a simple, reproducible deployment with sensible defaults and easy customization.
Prerequisites
Section titled “Prerequisites”- Kubernetes cluster (1.25+)
- Helm 3.8+
kubectlconfigured for your cluster
Quick Start
Section titled “Quick Start”-
Add the Helm repository
Terminal window helm repo add code-search https://aanogueira.github.io/code-searchhelm repo update -
Create a values file
values.yaml config:database:url: "postgres://user:pass@postgres:5432/codesearch?sslmode=disable"redis:url: "redis://redis:6379"ingress:enabled: truehost: code-search.example.com -
Install the chart
Terminal window helm install code-search code-search/code-search \--namespace code-search \--create-namespace \-f values.yaml -
Verify the installation
Terminal window kubectl get pods -n code-searchhelm status code-search -n code-search
Chart Values Reference
Section titled “Chart Values Reference”Global Settings
Section titled “Global Settings”# Full values.yaml referencenameOverride: ""fullnameOverride: ""
# Image settings (applies to all components)image: registry: ghcr.io pullPolicy: IfNotPresent tag: "latest" # Overridden per component if needed
imagePullSecrets: []Configuration
Section titled “Configuration”config: # Database connection (PostgreSQL or MySQL) database: url: "" # Required: PostgreSQL or MySQL connection string maxOpenConns: 25 maxIdleConns: 5 connMaxLifetime: "5m"
# Redis connection redis: url: "" # Required: Redis connection string
# Zoekt settings zoekt: indexDir: "/data/index" reposDir: "/data/repos"
# Indexer settings indexer: concurrency: 2 cloneTimeout: "10m"
# Scheduler settings scheduler: enabled: true pollInterval: "6h" checkInterval: "5m"
# Repository settings repos: readonly: false
# Connection settings connections: readonly: false
# Mount config from an existing secretexistingSecret: ""API Server
Section titled “API Server”api: replicaCount: 2
image: repository: techquestsdev/code-search-api tag: "" # Defaults to chart appVersion
service: type: ClusterIP port: 8080
resources: requests: memory: "512Mi" cpu: "250m" limits: memory: "2Gi" cpu: "2000m"
autoscaling: enabled: false minReplicas: 2 maxReplicas: 10 targetCPUUtilizationPercentage: 80
nodeSelector: {} tolerations: [] affinity: {}Indexer Worker
Section titled “Indexer Worker”indexer: replicaCount: 2
image: repository: techquestsdev/code-search-indexer tag: ""
# Extra environment variables # NOTE: CS_ZOEKT_URL is automatically set to http://localhost:6070 # since Zoekt runs as a sidecar in the same pod env: {}
resources: requests: memory: "1Gi" cpu: "500m" limits: memory: "4Gi" cpu: "2000m"
nodeSelector: {} tolerations: [] affinity: {}Zoekt Search Server
Section titled “Zoekt Search Server”zoekt: replicaCount: 1
image: repository: techquestsdev/code-search-zoekt tag: ""
service: type: ClusterIP port: 6070
resources: requests: memory: "1Gi" cpu: "500m" limits: memory: "4Gi" cpu: "2000m"Web UI
Section titled “Web UI”web: replicaCount: 2
image: repository: techquestsdev/code-search-web tag: ""
service: type: ClusterIP port: 3000
resources: requests: memory: "256Mi" cpu: "100m" limits: memory: "512Mi" cpu: "500m"Ingress
Section titled “Ingress”ingress: enabled: true className: nginx
annotations: {} # kubernetes.io/tls-acme: "true" # nginx.ingress.kubernetes.io/proxy-body-size: "100m"
host: code-search.example.com
tls: enabled: true secretName: code-search-tls # Or use cert-manager: # clusterIssuer: letsencrypt-prodPersistence
Section titled “Persistence”persistence: # Index storage index: enabled: true storageClassName: "" # Uses default if empty accessMode: ReadWriteMany size: 50Gi existingClaim: ""
# Repository storage repos: enabled: true storageClassName: "" accessMode: ReadWriteMany size: 100Gi existingClaim: ""Built-in PostgreSQL (Optional)
Section titled “Built-in PostgreSQL (Optional)”postgresql: enabled: false # Set to true to deploy PostgreSQL in-cluster
auth: postgresPassword: "" username: codesearch password: "" database: codesearch
primary: persistence: enabled: true size: 20GiBuilt-in Redis (Optional)
Section titled “Built-in Redis (Optional)”redis: enabled: false # Set to true to deploy Redis in-cluster
architecture: standalone
auth: enabled: false
master: persistence: enabled: true size: 5GiCommon Configurations
Section titled “Common Configurations”With In-Cluster Database
Section titled “With In-Cluster Database”postgresql: enabled: true auth: password: "secure-password"
redis: enabled: true
config: database: url: "postgres://codesearch:secure-password@code-search-postgresql:5432/codesearch?sslmode=disable" redis: url: "redis://code-search-redis-master:6379"External Database
Section titled “External Database”config: database: redis: url: "redis://redis.example.com:6379"High Availability (Shared Storage)
Section titled “High Availability (Shared Storage)”Multiple indexer workers sharing the same storage for parallel indexing:
api: replicaCount: 3 autoscaling: enabled: true minReplicas: 3 maxReplicas: 10 fileBrowsing: enabled: true # Enable file browsing from API
indexer: replicaCount: 4 # Multiple workers share the queue persistence: accessMode: ReadWriteMany # Required for multiple workers size: 200Gi
web: replicaCount: 3
# No sharding needed - workers share storagesharding: enabled: falseHash-Based Sharding (Extreme Scale)
Section titled “Hash-Based Sharding (Extreme Scale)”For very large deployments without shared storage:
api: replicaCount: 3 autoscaling: enabled: true minReplicas: 3 maxReplicas: 10
# Sharding distributes repos by consistent hashsharding: enabled: true replicas: 5 # Creates indexer-0 through indexer-4 federatedAccess: enabled: true # Enable file browsing and replace via proxy indexerAPIPort: 8081
web: replicaCount: 3
# Each shard has its own storage (no RWX needed)indexer: persistence: accessMode: ReadWriteOnce size: 100GiWith TLS and cert-manager
Section titled “With TLS and cert-manager”ingress: enabled: true className: nginx host: code-search.example.com annotations: cert-manager.io/cluster-issuer: letsencrypt-prod tls: enabled: true secretName: code-search-tlsInstallation Examples
Section titled “Installation Examples”Basic Installation
Section titled “Basic Installation”helm install code-search code-search/code-search \ --namespace code-search \ --create-namespace \ --set config.database.url="postgres://user:pass@postgres:5432/codesearch" \ --set config.redis.url="redis://redis:6379"With Values File
Section titled “With Values File”helm install code-search code-search/code-search \ --namespace code-search \ --create-namespace \ -f values.yamlWith Existing Secret
Section titled “With Existing Secret”# Create secret with database URLkubectl create secret generic code-search-config \ --from-literal=database-url="postgres://user:pass@host:5432/db" \ --from-literal=redis-url="redis://host:6379" \ -n code-search
# Install with existing secrethelm install code-search code-search/code-search \ --namespace code-search \ --set existingSecret=code-search-configUpgrading
Section titled “Upgrading”# Update repohelm repo update
# Upgrade releasehelm upgrade code-search code-search/code-search \ --namespace code-search \ -f values.yamlUninstalling
Section titled “Uninstalling”# Uninstall releasehelm uninstall code-search -n code-search
# Delete PVCs (WARNING: data will be lost)kubectl delete pvc -l app.kubernetes.io/instance=code-search -n code-searchTroubleshooting
Section titled “Troubleshooting”Check Release Status
Section titled “Check Release Status”helm status code-search -n code-searchhelm history code-search -n code-searchGet Generated Manifests
Section titled “Get Generated Manifests”helm get manifest code-search -n code-searchDebug Installation
Section titled “Debug Installation”helm install code-search code-search/code-search \ --namespace code-search \ --dry-run --debug \ -f values.yamlRollback
Section titled “Rollback”helm rollback code-search 1 -n code-searchNext Steps
Section titled “Next Steps”- Configuration - Detailed configuration options
- Code Hosts - Connect to GitHub, GitLab, etc.