Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
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
79 changes: 79 additions & 0 deletions base/codeinsights-db/codeinsights-db.Deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
description: Code Insights TimescaleDB instance.
labels:
app.kubernetes.io/component: codeinsights-db
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: codeinsights-db
spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: codeinsights-db
strategy:
type: Recreate
template:
metadata:
labels:
deploy: sourcegraph
app: codeinsights-db
group: backend
spec:
containers:
- name: timescaledb
image: index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:f985af2fef860cc48be40ded864df025b8794b02b86e66cbc6c55bfe3c418831
terminationMessagePolicy: FallbackToLogsOnError
readinessProbe:
exec:
command:
- /ready.sh
livenessProbe:
initialDelaySeconds: 15
exec:
command:
- /liveness.sh
ports:
- containerPort: 5432
name: timescaledb
resources:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: "4"
memory: 2Gi
volumeMounts:
- mountPath: /data
name: disk
- mountPath: /conf
name: timescaledb-conf
# - env:
# - name: DATA_SOURCE_NAME
# value: postgres://sg:@localhost:5432/?sslmode=disable
# # Dax: Temporarily switch back to upstream postgres exporter
# # https://github.com/sourcegraph/sourcegraph/issues/18225
# image: wrouesnel/postgres_exporter:v0.7.0@sha256:785c919627c06f540d515aac88b7966f352403f73e931e70dc2cbf783146a98b
# terminationMessagePolicy: FallbackToLogsOnError
# name: pgsql-exporter
# resources:
# limits:
# cpu: 10m
# memory: 50Mi
# requests:
# cpu: 10m
# memory: 50Mi
securityContext:
runAsUser: 0
volumes:
- name: disk
persistentVolumeClaim:
claimName: codeinsights-db
- name: timescaledb-conf
configMap:
defaultMode: 0777
name: codeinsights-db-conf
15 changes: 15 additions & 0 deletions base/codeinsights-db/codeinsights-db.PersistentVolumeClaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: codeinsights-db
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: codeinsights-db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi
storageClassName: sourcegraph
20 changes: 20 additions & 0 deletions base/codeinsights-db/codeinsights-db.Service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/port: "9187"
sourcegraph.prometheus/scrape: "true"
labels:
app.kubernetes.io/component: codeinsights-db
app: codeinsights-db
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: codeinsights-db
spec:
ports:
- name: timescaledb
port: 5432
targetPort: timescaledb
selector:
app: codeinsights-db
type: ClusterIP
Loading