Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/sourcegraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Use `**BREAKING**:` to denote a breaking change

## Unreleased

- Fixed the `codeintel-db` PersistentVolumeClaim being renamed by `codeIntelDB.name`, which left the StatefulSet pointing at a `codeintel-db` claim that no longer existed and stuck the pod in `Pending`. The PVC is now always named `codeintel-db`, matching the other components and the documented behaviour of `*.name`. If you worked around this by creating a `codeintel-db` PVC by hand, label it `app.kubernetes.io/managed-by: Helm` and annotate it with `meta.helm.sh/release-name` and `meta.helm.sh/release-namespace` before upgrading so Helm can adopt it. [#612](https://github.com/sourcegraph/deploy-sourcegraph-helm/issues/612)
- Added opt-in Redis config management through `redisCache.config.enabled` and `redisStore.config.enabled` (both default to `false`). Default deployments retain their image configs, custom mounts, authentication, and memory settings. When enabled, the chart mounts `/etc/redis/redis.conf` and supports `existingConfig`, `maxmemory`, `maxmemoryRatio`, `maxmemoryPolicy`, and `additionalConfig`. See [Enabling Redis config management](README.md#enabling-redis-config-management) before opting in, especially when using custom images or Secret-mounted configs.
- With Redis config management enabled, the chart sizes `maxmemory` at 75% of `resources.limits.memory` to leave room for overhead; this reduces, but does not eliminate, OOM risk. Ratios must be greater than 0 and less than 1. Auto-sizing is skipped in local development mode or when the limit is absent or unrecognised. At the default 7Gi limit, opting in lowers the effective cap from 6GiB to 5.25GiB: `redis-cache` evicts earlier, but `redis-store` uses `noeviction`, so its write-error ceiling drops too. Set `redisStore.config.maxmemory: 6gb` to keep the old ceiling if the pod has sufficient memory.
- `searcher.storageSize` now accepts any Kubernetes quantity (e.g. `150G`, `1Ti`, `1.5Ti`, `500000M`) when deriving `SEARCHER_CACHE_SIZE_MB` and `SYMBOLS_CACHE_SIZE_MB`. Previously anything other than `Gi` silently rendered both as `0`, which disables cache eviction and lets the cache volume fill up. Unparseable values, or values below `3M`, now fail the render unless `searcher.autoCacheSize` is enabled. The derived size now matches searcher's own auto-sizing arithmetic (45% of the volume in decimal megabytes), so existing `Gi` deployments see a slightly higher value on upgrade, e.g. the default `26Gi` renders `12562` instead of `11700`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
annotations:
{{- toYaml .Values.codeIntelDB.storageAnnotations | nindent 4 }}
{{- end }}
name: {{ default "codeintel-db" .Values.codeIntelDB.name }}
name: codeintel-db
spec:
accessModes:
- ReadWriteOnce
Expand Down
139 changes: 139 additions & 0 deletions charts/sourcegraph/tests/componentNamePVC_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
suite: component name does not rename PVCs
# `<component>.name` renames the workload, but PVC names and the
# claimName that references them stay fixed, so the workload can
# always find its volume.
set:
blobstore:
name: custom-blobstore
codeInsightsDB:
name: custom-codeinsights-db
codeIntelDB:
name: custom-codeintel-db
pgsql:
name: custom-pgsql
prometheus:
name: custom-prometheus
redisCache:
name: custom-redis-cache
redisStore:
name: custom-redis-store
tests:
- it: should keep the blobstore PVC name and claimName fixed
templates:
- blobstore/blobstore.PersistentVolumeClaim.yaml
- blobstore/blobstore.Deployment.yaml
asserts:
- equal:
path: metadata.name
value: blobstore
template: blobstore/blobstore.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-blobstore
template: blobstore/blobstore.Deployment.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: blobstore
template: blobstore/blobstore.Deployment.yaml
- it: should keep the codeinsights-db PVC name and claimName fixed
templates:
- codeinsights-db/codeinsights-db.PersistentVolumeClaim.yaml
- codeinsights-db/codeinsights-db.StatefulSet.yaml
asserts:
- equal:
path: metadata.name
value: codeinsights-db
template: codeinsights-db/codeinsights-db.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-codeinsights-db
template: codeinsights-db/codeinsights-db.StatefulSet.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: codeinsights-db
template: codeinsights-db/codeinsights-db.StatefulSet.yaml
- it: should keep the codeintel-db PVC name and claimName fixed
templates:
- codeintel-db/codeintel-db.PersistentVolumeClaim.yaml
- codeintel-db/codeintel-db.StatefulSet.yaml
asserts:
- equal:
path: metadata.name
value: codeintel-db
template: codeintel-db/codeintel-db.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-codeintel-db
template: codeintel-db/codeintel-db.StatefulSet.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: codeintel-db
template: codeintel-db/codeintel-db.StatefulSet.yaml
- it: should keep the pgsql PVC name and claimName fixed
templates:
- pgsql/pgsql.PersistentVolumeClaim.yaml
- pgsql/pgsql.StatefulSet.yaml
asserts:
- equal:
path: metadata.name
value: pgsql
template: pgsql/pgsql.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-pgsql
template: pgsql/pgsql.StatefulSet.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: pgsql
template: pgsql/pgsql.StatefulSet.yaml
- it: should keep the prometheus PVC name and claimName fixed
templates:
- prometheus/prometheus.PersistentVolumeClaim.yaml
- prometheus/prometheus.Deployment.yaml
asserts:
- equal:
path: metadata.name
value: prometheus
template: prometheus/prometheus.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-prometheus
template: prometheus/prometheus.Deployment.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: prometheus
template: prometheus/prometheus.Deployment.yaml
- it: should keep the redis-cache PVC name and claimName fixed
templates:
- redis/redis-cache.PersistentVolumeClaim.yaml
- redis/redis-cache.Deployment.yaml
asserts:
- equal:
path: metadata.name
value: redis-cache
template: redis/redis-cache.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-redis-cache
template: redis/redis-cache.Deployment.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: redis-cache
template: redis/redis-cache.Deployment.yaml
- it: should keep the redis-store PVC name and claimName fixed
templates:
- redis/redis-store.PersistentVolumeClaim.yaml
- redis/redis-store.Deployment.yaml
asserts:
- equal:
path: metadata.name
value: redis-store
template: redis/redis-store.PersistentVolumeClaim.yaml
- equal:
path: metadata.name
value: custom-redis-store
template: redis/redis-store.Deployment.yaml
- equal:
path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName
value: redis-store
template: redis/redis-store.Deployment.yaml
Loading