Skip to content
Closed
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
14 changes: 12 additions & 2 deletions charts/sourcegraph/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,21 @@ Jaeger selector labels
app.kubernetes.io/name: jaeger
{{- end }}

{{- define "sourcegraph.mappedName" -}}
{{- $top := index . 0 -}}
{{- $service := index . 1 -}}
{{- if (index $top.Values $service "mappingName") }}
{{- (index $top.Values $service "mappingName") }}
{{- else }}
{{- $service }}
{{- end -}}
{{- end }}

{{- define "sourcegraph.databaseAuth" -}}
{{- $top := index . 0 -}}
{{- $service := index . 1 -}}
{{- $prefix := index . 2 -}}
{{- $secretName := ((snakecase $service) | replace "_" "-") -}}
{{- $secretName := (include "sourcegraph.mappedName" (list $top $service )) }}
{{- $secretName := printf "%s-auth" $secretName -}}
{{- if (index $top.Values $service "auth" "existingSecret") }}{{- $secretName = (index $top.Values $service "auth" "existingSecret") }}{{- end -}}
- name: {{ printf "%sDATABASE" $prefix }}
Expand Down Expand Up @@ -166,7 +176,7 @@ app.kubernetes.io/name: jaeger
{{- define "sourcegraph.dataSource" -}}
{{- $top := index . 0 -}}
{{- $service := index . 1 -}}
{{- $secretName := ((snakecase $service) | replace "_" "-") -}}
{{- $secretName := (include "sourcegraph.mappedName" (list $top $service )) }}
{{- $secretName := printf "%s-auth" $secretName -}}
{{- if (index $top.Values $service "auth" "existingSecret") }}{{- $secretName = (index $top.Values $service "auth" "existingSecret") }}{{- end -}}
- name: DATA_SOURCE_DB
Expand Down
9 changes: 9 additions & 0 deletions charts/sourcegraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ codeInsightsDB:
requests:
cpu: "4"
memory: 2Gi
mappingName: "codeinsights-db"
# -- Security context for the `codeinsights-db` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext:
Expand Down Expand Up @@ -222,6 +223,7 @@ codeIntelDB:
requests:
cpu: "4"
memory: 4Gi
mappingName: "codeintel-db"
# -- Security context for the `codeintel-db` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext:
Expand Down Expand Up @@ -350,6 +352,7 @@ githubProxy:
runAsUser: 100
runAsGroup: 101
readOnlyRootFilesystem: true
mappingName: "github-proxy"
# -- Security context for the `github-proxy` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext: {}
Expand Down Expand Up @@ -474,6 +477,7 @@ indexedSearch:
requests:
cpu: 500m
memory: 2G
mappingName: "indexed-search"
# -- Security context for the `indexed-search` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext:
Expand Down Expand Up @@ -660,6 +664,7 @@ preciseCodeIntel:
runAsUser: 100
runAsGroup: 101
readOnlyRootFilesystem: true
mappingName: "precise-code-intel"
# -- Security context for the `precise-code-intel-worker` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext: {}
Expand Down Expand Up @@ -754,6 +759,7 @@ redisCache:
requests:
cpu: "1"
memory: 7Gi
mappingName: "redis-cache"
# -- Security context for the `redis-cache` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext:
Expand Down Expand Up @@ -814,6 +820,7 @@ redisStore:
requests:
cpu: "1"
memory: 7Gi
mappingName: "redis-store"
# -- Security context for the `redis-store` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext:
Expand All @@ -840,6 +847,7 @@ repoUpdater:
runAsUser: 100
runAsGroup: 101
readOnlyRootFilesystem: true
mappingName: "repo-updater"
# -- Security context for the `repo-updater` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext: {}
Expand Down Expand Up @@ -959,6 +967,7 @@ syntectServer:
runAsUser: 100
runAsGroup: 101
readOnlyRootFilesystem: true
mappingName: "syntect-server"
# -- Security context for the `syntect-server` pod,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)
podSecurityContext: {}
Expand Down