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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generated-cluster
.env
.envrc
.crt
.key
id_rsa
known_hosts
dev-clusters
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [BETA] Sourcegraph on Kubernetes with Kustomize
# [BETA] Deploy Sourcegraph with Kustomize

[![sourcegraph: beta](https://img.shields.io/badge/sourcegraph-beta-blue.svg)](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegrap-k8s)

Expand All @@ -13,7 +13,7 @@ For product and [pricing](https://about.sourcegraph.com/pricing/) information, v
[about.sourcegraph.com](https://about.sourcegraph.com) or [contact
us](https://about.sourcegraph.com/contact/sales) for more information.

- [Installing](https://docs.sourcegraph.com/admin/deploy/kubernetes/kustomize)
- [Installing](https://docs.sourcegraph.com/admin/deploy/kubernetes)
- [Configuring](https://docs.sourcegraph.com/admin/deploy/kubernetes/kustomize/configure)
- [Updating](https://docs.sourcegraph.com/admin/updates/kubernetes)
- [Scaling](https://docs.sourcegraph.com/admin/deploy/scale)- general advice on scaling services
Expand All @@ -24,7 +24,7 @@ us](https://about.sourcegraph.com/contact/sales) for more information.

## Deploying

🚨 **The `master` branch tracks development. Use the branch of this repository corresponding to the version of Sourcegraph you wish to deploy, e.g. `git checkout v4.4.1`.**
🚨 **Please use the branch corresponding to the version of Sourcegraph you wish to deploy, e.g. `git checkout v4.5.0`.**

Always refer to the [Sourcegraph Kustomize docs](https://docs.sourcegraph.com/admin/deploy/kubernetes/kustomize) for the latest instructions.

Expand All @@ -34,7 +34,9 @@ When upgrading Sourcegraph, please check [upgrading docs](https://docs.sourcegra

## Contributing

We've made our deployment configurations open source to better serve our customers' needs. If there is anything we can do to make deploying Sourcegraph easier just [open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph&template=deploy-sourcegraph.md&title=%5Bdeploy-sourcegraph%5D) or a pull request and we will respond promptly!
The `dev` branch is used to track development.

We've made our deployment configurations open source to better serve our customers' needs. If there is anything we can do to make deploying Sourcegraph easier just [open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph&template=deploy-sourcegraph.md&title=%5Bdeploy-sourcegraph%5D) or a pull request and we will respond as soon as possible!

## Questions & Issues

Expand Down
2 changes: 1 addition & 1 deletion base/monitoring/cadvisor/cadvisor.DaemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
serviceAccountName: cadvisor
containers:
- name: cadvisor
image: index.docker.io/sourcegraph/cadvisor:insiders@sha256:190efc306a283ed707fd09d7d65b8526beb8815fa13f31081cb290e743c62126
image: index.docker.io/sourcegraph/cadvisor:4.4.1@sha256:87e62b4f11f6e51c8d6f363780642916b986787007808ae2ec1cc040644c10f6
args:
# Kubernetes-specific flags below (other flags are baked into the Docker image)
#
Expand Down
2 changes: 1 addition & 1 deletion base/monitoring/grafana/grafana.StatefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
spec:
containers:
- name: grafana
image: index.docker.io/sourcegraph/grafana:insiders@sha256:4841dd8d1eba45585eeb88f2223dd6dec158274914e737ac91141c6343b03186
image: index.docker.io/sourcegraph/grafana:4.4.1@sha256:7e28a9761433ed3adf75788cc5e849e3faf0938b0467b4b895fbb8aa7dc36a6d
terminationMessagePolicy: FallbackToLogsOnError
ports:
- containerPort: 3370
Expand Down
2 changes: 1 addition & 1 deletion base/monitoring/node-exporter/node-exporter.DaemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: node-exporter
image: index.docker.io/sourcegraph/node-exporter:insiders@sha256:fa8e5700b7762fffe0674e944762f44bb787a7e44d97569fe55348260453bf80
image: index.docker.io/sourcegraph/node-exporter:4.4.1@sha256:fa8e5700b7762fffe0674e944762f44bb787a7e44d97569fe55348260453bf80
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion base/monitoring/otel-collector/otel-agent.DaemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
spec:
containers:
- name: otel-agent
image: index.docker.io/sourcegraph/opentelemetry-collector:insiders@sha256:56a1711a25c95830468ce517b4082b593a1eadb0d72bc2dc100488418413cac9
image: index.docker.io/sourcegraph/opentelemetry-collector:4.4.1@sha256:aab30e572c1fa8a97f98b0163ed56d0bcbd0f0fe43472937746a33b0e58c31ac
command:
- "/bin/otelcol-sourcegraph"
- "--config=/etc/otel-agent/config.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
spec:
containers:
- name: otel-collector
image: index.docker.io/sourcegraph/opentelemetry-collector:insiders@sha256:56a1711a25c95830468ce517b4082b593a1eadb0d72bc2dc100488418413cac9
image: index.docker.io/sourcegraph/opentelemetry-collector:4.4.1@sha256:aab30e572c1fa8a97f98b0163ed56d0bcbd0f0fe43472937746a33b0e58c31ac
command:
- "/bin/otelcol-sourcegraph"
# To use a custom configuration, edit otel-collector.ConfigMap.yaml
Expand Down
6 changes: 6 additions & 0 deletions base/monitoring/prometheus/prometheus.ConfigMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ data:
- symbols-2.symbols:6060
- symbols-3.symbols:6060
- symbols-4.symbols:6060
- symbols-5.symbols:6060
- symbols-6.symbols:6060
- symbols-7.symbols:6060
- symbols-8.symbols:6060
- symbols-9.symbols:6060
- symbols-10.symbols:6060
- labels:
nodename: "sourcegraph-services"
job: pgsql
Expand Down
2 changes: 1 addition & 1 deletion base/monitoring/prometheus/prometheus.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
spec:
containers:
- name: prometheus
image: index.docker.io/sourcegraph/prometheus:insiders@sha256:a6c02f55e4d4861094df5df18aefab6813024aae9dd8bdb5694612becc33baf3
image: index.docker.io/sourcegraph/prometheus:4.4.1@sha256:bb1a5a8e199e9f197d98809a604b7a36fd732c993558a595b5636d4aa69d6d84
terminationMessagePolicy: FallbackToLogsOnError
readinessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion base/sourcegraph/blobstore/blobstore.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
spec:
containers:
- name: blobstore
image: index.docker.io/sourcegraph/blobstore:insiders@sha256:a10b9e6be1f8bc843bd22496e6d28c2ec38aeb1f75f2eecb836cc152009d43eb
image: index.docker.io/sourcegraph/blobstore:4.4.1@sha256:d8f7d04c870f9c5c4a6b6fc8ccd7ed85980ceac6d5d527fa224499e837a39bce
livenessProbe:
httpGet:
path: /
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
annotations:
description: Code Insights Postgres DB instance.
Expand All @@ -12,11 +12,12 @@ spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: codeinsights-db
strategy:
type: Recreate
serviceName: codeinsights-db
template:
metadata:
labels:
Expand All @@ -26,7 +27,7 @@ spec:
spec:
initContainers:
- name: correct-data-dir-permissions
image: index.docker.io/sourcegraph/alpine-3.14:insiders@sha256:5e047c7f753cab4a61d32728c5669ff3d6394c84ab317e8cd8ee375a402324e6
image: index.docker.io/sourcegraph/alpine-3.14:4.4.1@sha256:d84049e03b36abe84efae5d408cb6dd16b1ca3a9ccc3e7b5e7e5ce0ca8e74dd4
command: ["sh", "-c", "if [ -d /var/lib/postgresql/data/pgdata ]; then chmod 750 /var/lib/postgresql/data/pgdata; fi"]
volumeMounts:
- mountPath: /var/lib/postgresql/data/
Expand All @@ -45,7 +46,7 @@ spec:
runAsUser: 70
containers:
- name: codeinsights
image: index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:2a245d1acbadb3f5e0fa448dd123c4edd098bfb24355087509f8b8d917b96961
image: index.docker.io/sourcegraph/codeinsights-db:4.4.1@sha256:d83736061a1d99208d04ae60bfb15e408044dc6edba18f5fae2bdb147ae21729
env:
- name: POSTGRES_DB
value: postgres
Expand Down Expand Up @@ -82,7 +83,7 @@ spec:
value: postgres://postgres:@localhost:5432/?sslmode=disable
- name: PG_EXPORTER_EXTEND_QUERY_PATH
value: /config/code_insights_queries.yaml
image: index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:e1715c4e2b865670b347cdd442702718b97518922f50ddc18f471716cffd0e70
image: index.docker.io/sourcegraph/postgres_exporter:4.4.1@sha256:ca9601bb42c6feb73d2353feee4824d4aff66efbbcb69b4d3a1d7fa613ea384c
terminationMessagePolicy: FallbackToLogsOnError
name: pgsql-exporter
ports:
Expand All @@ -106,5 +107,6 @@ spec:
claimName: codeinsights-db
- name: codeinsights-conf
configMap:
# 511 in decimal = 0777 in octal
defaultMode: 511
name: codeinsights-db-conf
2 changes: 1 addition & 1 deletion base/sourcegraph/codeinsights-db/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- codeinsights-db.ConfigMap.yaml
- codeinsights-db.Deployment.yaml
- codeinsights-db.StatefulSet.yaml
- codeinsights-db.PersistentVolumeClaim.yaml
- codeinsights-db.Service.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
annotations:
description: Postgres database for various data.
Expand All @@ -16,8 +16,9 @@ spec:
selector:
matchLabels:
app: codeintel-db
strategy:
type: Recreate
serviceName: codeintel-db
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
Expand All @@ -27,7 +28,7 @@ spec:
spec:
initContainers:
- name: correct-data-dir-permissions
image: index.docker.io/sourcegraph/alpine-3.14:insiders@sha256:5e047c7f753cab4a61d32728c5669ff3d6394c84ab317e8cd8ee375a402324e6
image: index.docker.io/sourcegraph/alpine-3.14:4.4.1@sha256:d84049e03b36abe84efae5d408cb6dd16b1ca3a9ccc3e7b5e7e5ce0ca8e74dd4
command: ["sh", "-c", "if [ -d /data/pgdata-12 ]; then chmod 750 /data/pgdata-12; fi"]
volumeMounts:
- mountPath: /data
Expand All @@ -45,7 +46,7 @@ spec:
memory: "50Mi"
containers:
- name: pgsql
image: index.docker.io/sourcegraph/codeintel-db:insiders@sha256:475d5373646ef42015fcf8d5d020ee5cac669399b6f693ff9c64842aed24e793
image: index.docker.io/sourcegraph/codeintel-db:4.4.1@sha256:9fc2d35df5ccaa32f00be6c6cdc1971d4d717ccef5b43ae22573d4cecf8b490d
terminationMessagePolicy: FallbackToLogsOnError
readinessProbe:
exec:
Expand Down Expand Up @@ -87,7 +88,7 @@ spec:
value: postgres://sg:@localhost:5432/?sslmode=disable
- name: PG_EXPORTER_EXTEND_QUERY_PATH
value: /config/code_intel_queries.yaml
image: index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:e1715c4e2b865670b347cdd442702718b97518922f50ddc18f471716cffd0e70
image: index.docker.io/sourcegraph/postgres_exporter:4.4.1@sha256:ca9601bb42c6feb73d2353feee4824d4aff66efbbcb69b4d3a1d7fa613ea384c
terminationMessagePolicy: FallbackToLogsOnError
name: pgsql-exporter
ports:
Expand All @@ -111,6 +112,6 @@ spec:
claimName: codeintel-db
- name: pgsql-conf
configMap:
# 511 in decimal = 0777 in octal
defaultMode: 511
# defaultMode: 0777
name: codeintel-db-conf
2 changes: 1 addition & 1 deletion base/sourcegraph/codeintel-db/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- codeintel-db.ConfigMap.yaml
- codeintel-db.Deployment.yaml
- codeintel-db.StatefulSet.yaml
- codeintel-db.PersistentVolumeClaim.yaml
- codeintel-db.Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ data:
SRC_GIT_SERVERS: gitserver-0.gitserver:3178
SEARCHER_URL: http://searcher-0.searcher:3181
SYMBOLS_URL: http://symbols:3184
INDEXED_SEARCH_SERVERS: indexed-search-0.indexed-search:6070 indexed-search-1.indexed-search:6070 indexed-search-2.indexed-search:6070 indexed-search-3.indexed-search:6070
INDEXED_SEARCH_SERVERS: indexed-search-0.indexed-search:6070
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
spec:
initContainers:
- name: migrator
image: index.docker.io/sourcegraph/migrator:insiders@sha256:f540c204a001a3d723c5de229c7ddb36446f7f20aaca24d29d963e9925519ae6
image: index.docker.io/sourcegraph/migrator:4.4.1@sha256:52fa05bfcb9c47d59fa772612bf7ced8a564f08caa136391dc7694288a953cf1
args: ["up"]
resources:
limits:
Expand All @@ -48,7 +48,7 @@ spec:
name: sourcegraph-frontend-env
containers:
- name: frontend
image: index.docker.io/sourcegraph/frontend:insiders@sha256:b063b3d0dabdb9000929b49face859f7fa5b74cb850a7ce512eb5b104197cf6a
image: index.docker.io/sourcegraph/frontend:4.4.1@sha256:16a554421eb0c470fa1a1e0832fcdc8f1516db868aad025b5b8d54602e5045db
args:
- serve
envFrom:
Expand Down
2 changes: 1 addition & 1 deletion base/sourcegraph/github-proxy/github-proxy.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
spec:
containers:
- name: github-proxy
image: index.docker.io/sourcegraph/github-proxy:insiders@sha256:a58d3afffa1de042050717771758d1c9447fb760b1a2568a0d10926f8663f34f
image: index.docker.io/sourcegraph/github-proxy:4.4.1@sha256:6fa3984c6ed2c501c53ef6dc6021f71a274b6250f43e3a1e96005d15dc1d112a
env:
# OTEL_AGENT_HOST must be defined before OTEL_EXPORTER_OTLP_ENDPOINT to substitute the node IP on which the DaemonSet pod instance runs in the latter variable
- name: OTEL_AGENT_HOST
Expand Down
2 changes: 1 addition & 1 deletion base/sourcegraph/gitserver/gitserver.StatefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
fieldPath: status.hostIP
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://$(OTEL_AGENT_HOST):4317
image: index.docker.io/sourcegraph/gitserver:insiders@sha256:e2ce26308f285e73854eea82055373450f4825f39db61f5e6a7658f1495c68fc
image: index.docker.io/sourcegraph/gitserver:4.4.1@sha256:3a4ce9372fcfa631e78c5682541faed9f571f90d9fc46469d5d0d1c9907c2721
terminationMessagePolicy: FallbackToLogsOnError
livenessProbe:
initialDelaySeconds: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
value: http://$(OTEL_AGENT_HOST):4317
- name: OPENTELEMETRY_DISABLED
value: "false"
image: index.docker.io/sourcegraph/indexed-searcher:insiders@sha256:939c14b99f0ed394ee0f218790e10e10f0b25744b1089e484e3c22fb36e3ab93
image: index.docker.io/sourcegraph/indexed-searcher:4.4.1@sha256:013190418308b94521e072972ae2342c41f99144205f58d61f5dfeda29ac0f58
terminationMessagePolicy: FallbackToLogsOnError
ports:
- containerPort: 6070
Expand Down Expand Up @@ -72,7 +72,7 @@ spec:
value: http://$(OTEL_AGENT_HOST):4317
- name: OPENTELEMETRY_DISABLED
value: "false"
image: index.docker.io/sourcegraph/search-indexer:insiders@sha256:b789b8557b1814d3bb58ec11c11905863005456e00279aff6ccf8aa680bb4e0e
image: index.docker.io/sourcegraph/search-indexer:4.4.1@sha256:7716a32597300f7dfb7e974465a3bd3c62fae3aa485b48d9aa9f79ea3348f87f
terminationMessagePolicy: FallbackToLogsOnError
ports:
- containerPort: 6072
Expand Down
2 changes: 1 addition & 1 deletion base/sourcegraph/pgsql/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pgsql.ConfigMap.yaml
- pgsql.Deployment.yaml
- pgsql.StatefulSet.yaml
- pgsql.PersistentVolumeClaim.yaml
- pgsql.Service.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
annotations:
description: Postgres database for various data.
Expand All @@ -10,14 +10,15 @@ metadata:
app.kubernetes.io/component: pgsql
name: pgsql
spec:
serviceName: pgsql
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: pgsql
strategy:
type: Recreate
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
Expand All @@ -27,7 +28,7 @@ spec:
spec:
initContainers:
- name: correct-data-dir-permissions
image: index.docker.io/sourcegraph/alpine-3.14:insiders@sha256:5e047c7f753cab4a61d32728c5669ff3d6394c84ab317e8cd8ee375a402324e6
image: index.docker.io/sourcegraph/alpine-3.14:4.4.1@sha256:d84049e03b36abe84efae5d408cb6dd16b1ca3a9ccc3e7b5e7e5ce0ca8e74dd4
command: ["sh", "-c", "if [ -d /data/pgdata-12 ]; then chmod 750 /data/pgdata-12; fi"]
volumeMounts:
- mountPath: /data
Expand All @@ -46,7 +47,7 @@ spec:
memory: "50Mi"
containers:
- name: pgsql
image: index.docker.io/sourcegraph/postgres-12-alpine:insiders@sha256:c187138e28b9f0e603ef7dd78daeb0fea8894e39e83f3a007ca97809a8627b4e
image: index.docker.io/sourcegraph/postgres-12-alpine:4.4.1@sha256:e35cc240cdff97ef5fd596a541630ce8598656872ed8fffdc267b44ee62b6ae6
terminationMessagePolicy: FallbackToLogsOnError
readinessProbe:
exec:
Expand Down Expand Up @@ -90,7 +91,7 @@ spec:
value: postgres://sg:@localhost:5432/?sslmode=disable
- name: PG_EXPORTER_EXTEND_QUERY_PATH
value: /config/queries.yaml
image: index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:e1715c4e2b865670b347cdd442702718b97518922f50ddc18f471716cffd0e70
image: index.docker.io/sourcegraph/postgres_exporter:4.4.1@sha256:ca9601bb42c6feb73d2353feee4824d4aff66efbbcb69b4d3a1d7fa613ea384c
terminationMessagePolicy: FallbackToLogsOnError
name: pgsql-exporter
ports:
Expand All @@ -114,6 +115,7 @@ spec:
claimName: pgsql
- name: pgsql-conf
configMap:
# 511 in decimal = 0777 in octal
defaultMode: 511
name: pgsql-conf
- name: dshm # Allocate shared memory to match the shared_buffers value
Expand Down
2 changes: 1 addition & 1 deletion base/sourcegraph/precise-code-intel/worker.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
fieldPath: status.hostIP
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://$(OTEL_AGENT_HOST):4317
image: index.docker.io/sourcegraph/precise-code-intel-worker:insiders@sha256:7b37c483cba5c9749bf74a895959f36c3086d97235ea0ea18e3b06c905034bd3
image: index.docker.io/sourcegraph/precise-code-intel-worker:4.4.1@sha256:0d5e2f4051ed1244a1b7d9510181c80717ed55f8ca85c8896754da2ff8db4d74
terminationMessagePolicy: FallbackToLogsOnError
livenessProbe:
httpGet:
Expand Down
Loading