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
20 changes: 20 additions & 0 deletions charts/sourcegraph/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion charts/sourcegraph/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Create the name of the service account to use
{{- define "sourcegraph.serviceAccountName" -}}
{{- $top := index . 0 }}
{{- $service := index . 1 }}
{{- $defaultServiceAccountName := ((snakecase $service) | replace "_" "-") }}
{{- $defaultServiceAccountName := (index $top.Values $service "name") }}
{{- default $defaultServiceAccountName (index $top.Values $service "serviceAccount" "name") }}
{{- end }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: cadvisor
name: cadvisor
name: {{ .Values.cadvisor.name }}
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ default "cadvisor" .Values.cadvisor.name }}
- {{ .Values.cadvisor.name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: cadvisor
name: cadvisor
name: {{ .Values.cadvisor.name }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cadvisor
name: {{ .Values.cadvisor.name }}
subjects:
- kind: ServiceAccount
name: {{ include "sourcegraph.serviceAccountName" (list . "cadvisor") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: cadvisor
name: {{ default "cadvisor" .Values.cadvisor.name }}
name: {{ .Values.cadvisor.name }}
spec:
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app: cadvisor
deploy: sourcegraph
app.kubernetes.io/component: cadvisor
name: cadvisor
name: {{ .Values.cadvisor.name }}
spec:
seLinux:
rule: RunAsAny
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
app.kubernetes.io/component: codeinsights-db
deploy: sourcegraph
name: codeinsights-db-conf
name: {{ .Values.codeInsightsDB.name }}-conf
data:
postgresql.conf: |
# -----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
app.kubernetes.io/component: codeinsights-db
deploy: sourcegraph
name: {{ default "codeinsights-db" .Values.codeInsightsDB.name }}
name: {{ .Values.codeInsightsDB.name }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down Expand Up @@ -100,7 +100,7 @@ spec:
- name: codeinsights-conf
configMap:
defaultMode: 0777
name: {{ default "codeinsights-db-conf" .Values.codeInsightsDB.existingConfig }}
name: {{ default (print .Values.codeInsightsDB.name "-conf") .Values.codeInsightsDB.existingConfig }}
- name: lockdir
emptyDir: {}
{{- if .Values.codeInsightsDB.extraVolumes }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
app.kubernetes.io/component: codeintel-db
deploy: sourcegraph
name: codeintel-db-conf
name: {{ .Values.codeIntelDB.name }}-conf
data:
postgresql.conf: |
# -----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
app.kubernetes.io/component: codeintel-db
deploy: sourcegraph
name: {{ default "codeintel-db" .Values.codeIntelDB.name }}
name: {{ .Values.codeIntelDB.name }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down Expand Up @@ -133,7 +133,7 @@ spec:
- name: pgsql-conf
configMap:
defaultMode: 0777
name: {{ default "codeintel-db-conf" .Values.codeIntelDB.existingConfig .Values.codeIntelDB.name }}
name: {{ default (print .Values.codeIntelDB.name "-conf") .Values.codeIntelDB.existingConfig }}
- name: lockdir
emptyDir: {}
{{- if .Values.codeIntelDB.extraVolumes }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: frontend
name: {{ default "sourcegraph-frontend" .Values.frontend.name }}
name: {{ .Values.frontend.name }}
spec:
minReadySeconds: 10
replicas: {{ .Values.frontend.replicaCount }}
Expand Down Expand Up @@ -90,12 +90,12 @@ spec:
valueFrom:
secretKeyRef:
key: user
name: {{ default "minio-auth" .Values.minio.auth.existingSecret }}
name: {{ default (print .Values.minio.name "-auth") .Values.minio.auth.existingSecret }}
- name: PRECISE_CODE_INTEL_UPLOAD_AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
key: password
name: {{ default "minio-auth" .Values.minio.auth.existingSecret }}
name: {{ default (print .Values.minio.name "-auth") .Values.minio.auth.existingSecret }}
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
livenessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
{{- if .Values.frontend.ingress.labels}}
{{- toYaml .Values.frontend.ingress.labels | nindent 4 }}
{{- end }}
name: sourcegraph-frontend
name: {{ .Values.frontend.name }}
spec:
{{- if and .Values.frontend.ingress.host .Values.frontend.ingress.tlsSecret }}
tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: frontend
name: sourcegraph-frontend
name: {{ .Values.frontend.name }}
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: frontend
name: sourcegraph-frontend
name: {{ .Values.frontend.name }}
roleRef:
{{- if .Values.frontend.privileged }}
apiGroup: "rbac.authorization.k8s.io"
kind: Role
name: sourcegraph-frontend
name: {{ .Values.frontend.name }}
{{- else }}
apiGroup: ""
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: github-proxy
name: {{ default "github-proxy" .Values.githubProxy.name }}
name: {{ .Values.githubProxy.name }}
spec:
minReadySeconds: 10
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: gitserver
name: {{ default "gitserver" .Values.gitserver.name }}
name: {{ .Values.gitserver.name }}
spec:
replicas: {{ .Values.gitserver.replicaCount }}
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ metadata:
labels:
deploy: sourcegraph
app.kubernetes.io/component: grafana
name: grafana
name: {{ .Values.grafana.name }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/sourcegraph/templates/grafana/grafana.StatefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: grafana
name: {{ default "grafana" .Values.grafana.name }}
name: {{ .Values.grafana.name }}
spec:
replicas: {{ .Values.grafana.replicaCount }}
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
- name: config
configMap:
defaultMode: 0777
name: {{ default "grafana" .Values.grafana.existingConfig }}
name: {{ default .Values.grafana.name .Values.grafana.existingConfig }}
{{- if .Values.grafana.extraVolumes }}
{{- toYaml .Values.grafana.extraVolumes | nindent 6 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- if .Values.indexedSearch.labels }}
{{- toYaml .Values.indexedSearch.labels | nindent 4 }}
{{- end }}
name: {{ default "indexed-search" .Values.indexedSearch.name }}
name: {{ .Values.indexedSearch.name }}
spec:
replicas: {{ .Values.indexedSearch.replicaCount }}
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down
2 changes: 1 addition & 1 deletion charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ default "jaeger" .Values.tracing.name }}
name: {{ .Values.tracing.name }}
labels:
{{- include "sourcegraph.jaeger.labels" . | nindent 4 }}
{{- if .Values.tracing.labels }}
Expand Down
6 changes: 3 additions & 3 deletions charts/sourcegraph/templates/minio/minio.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: minio
name: {{ default "minio" .Values.minio.name }}
name: {{ .Values.minio.name }}
spec:
minReadySeconds: 10
replicas: 1
Expand Down Expand Up @@ -51,12 +51,12 @@ spec:
valueFrom:
secretKeyRef:
key: user
name: {{ default "minio-auth" .Values.minio.auth.existingSecret }}
name: {{ default (print .Values.minio.name "-auth") .Values.minio.auth.existingSecret }}
- name: MINIO_ROOT_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: {{ default "minio-auth" .Values.minio.auth.existingSecret }}
name: {{ default (print .Values.minio.name "-auth") .Values.minio.auth.existingSecret }}
{{- range $name, $item := .Values.minio.env}}
- name: {{ $name }}
{{- $item | toYaml | nindent 10 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/sourcegraph/templates/minio/minio.Secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: minio-auth
name: {{ .Values.minio.name }}-auth
labels:
app: minio
deploy: sourcegraph
Expand Down
2 changes: 1 addition & 1 deletion charts/sourcegraph/templates/pgsql/pgsql.ConfigMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
deploy: sourcegraph
app.kubernetes.io/component: pgsql
name: pgsql-conf
name: {{ .Values.pgsql.name }}-conf
data:
postgresql.conf: |
# -----------------------------
Expand Down
4 changes: 2 additions & 2 deletions charts/sourcegraph/templates/pgsql/pgsql.StatefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- if .Values.pgsql.labels }}
{{- toYaml .Values.pgsql.labels | nindent 4 }}
{{- end }}
name: {{ default "pgsql" .Values.pgsql.name }}
name: {{ .Values.pgsql.name }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
Expand Down Expand Up @@ -137,7 +137,7 @@ spec:
- name: pgsql-conf
configMap:
defaultMode: 0777
name: {{ default "pgsql-conf" .Values.pgsql.existingConfig }}
name: {{ default (print .Values.pgsql.name "-conf") .Values.pgsql.existingConfig }}
- name: dshm # Allocate shared memory to match the shared_buffers value
emptyDir:
medium: Memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: precise-code-intel
name: {{ default "precise-code-intel-worker" .Values.preciseCodeIntel.name }}
name: {{ .Values.preciseCodeIntel.name }}
spec:
minReadySeconds: 10
replicas: {{ .Values.preciseCodeIntel.replicaCount }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: prometheus
name: prometheus
name: {{ .Values.prometheus.name }}
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: prometheus
name: prometheus
name: {{ .Values.prometheus.name }}
roleRef:
apiGroup: "rbac.authorization.k8s.io"
kind: ClusterRole
name: prometheus
name: {{ .Values.prometheus.name }}
subjects:
- kind: ServiceAccount
name: {{ include "sourcegraph.serviceAccountName" (list . "prometheus") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,5 @@ metadata:
labels:
deploy: sourcegraph
app.kubernetes.io/component: prometheus
name: prometheus
name: {{ .Values.prometheus.name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: prometheus
name: {{ default "prometheus" .Values.prometheus.name }}
name: {{ .Values.prometheus.name }}
spec:
minReadySeconds: 10
replicas: {{ .Values.prometheus.replicaCount }}
Expand Down Expand Up @@ -101,7 +101,7 @@ spec:
claimName: prometheus
- configMap:
defaultMode: 0777
name: {{ default "prometheus" .Values.prometheus.existingConfig }}
name: {{ default .Values.prometheus.name .Values.prometheus.existingConfig }}
name: config
{{- if .Values.prometheus.extraVolumes }}
{{- toYaml .Values.prometheus.extraVolumes | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
category: rbac
deploy: sourcegraph
app.kubernetes.io/component: prometheus
name: prometheus
name: {{ .Values.prometheus.name }}
roleRef:
apiGroup: ""
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: redis
name: {{ default "redis-cache" .Values.redisCache.name }}
name: {{ .Values.redisCache.name }}
spec:
minReadySeconds: 10
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: redis
name: {{ default "redis-store" .Values.redisStore.name }}
name: {{ .Values.redisStore.name }}
spec:
minReadySeconds: 10
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: repo-updater
name: {{ default "repo-updater" .Values.repoUpdater.name }}
name: {{ .Values.repoUpdater.name }}
spec:
minReadySeconds: 10
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: searcher
name: {{ default "searcher" .Values.searcher.name }}
name: {{ .Values.searcher.name }}
spec:
minReadySeconds: 10
replicas: {{ .Values.searcher.replicaCount }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: symbols
name: {{ default "symbols" .Values.symbols.name }}
name: {{ .Values.symbols.name }}
spec:
minReadySeconds: 10
replicas: {{ .Values.symbols.replicaCount }}
Expand Down
Loading