Skip to content

Commit 198cdf3

Browse files
committed
feat: add sts support to use internal DB and improve values docs
Signed-off-by: Andre Nogueira <andre.nogueira@mollie.com>
1 parent 14fac64 commit 198cdf3

File tree

5 files changed

+83
-15
lines changed

5 files changed

+83
-15
lines changed

kubernetes/chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
type: application
33
name: sourcebot
44
version: 0.1.0
5-
appVersion: ""
5+
appVersion: v4.5.1
66
description: The open source Sourcegraph alternative. Sourcebot gives you a powerful interface to search though all your repos and branches across multiple code hosts.
77
icon: https://raw.githubusercontent.com/sourcebot-dev/sourcebot/ebf6721836b8f878d42bb8c1e844bdc7867a74fe/packages/web/public/logo_512.png
88
keywords:

kubernetes/chart/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sourcebot
22

3-
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.5.1](https://img.shields.io/badge/AppVersion-v4.5.1-informational?style=flat-square)
44

55
The open source Sourcegraph alternative. Sourcebot gives you a powerful interface to search though all your repos and branches across multiple code hosts.
66

@@ -27,14 +27,13 @@ The open source Sourcegraph alternative. Sourcebot gives you a powerful interfac
2727
| command | list | `[]` | Override the default command of the container. |
2828
| config | object | `{"$schema":"https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json","connections":{},"settings":{}}` | Configure Sourcebot-specific application settings. |
2929
| containerSecurityContext | object | `{}` | Set the container-level security context. |
30-
| database | object | `{}` | Configure the database secret. |
30+
| database | object | `{}` | Configure the database secret by providing database.secretName and database.secretKey to use a Kubernetes secret. |
3131
| envSecrets | list | `[]` | Set environment variables from Kubernetes secrets. |
3232
| envs | list | `[]` | Set additional environment variables. |
3333
| fullnameOverride | string | `""` | Override the full name of the chart. |
34-
| image | object | `{"pullPolicy":"Always","repository":"ghcr.io/sourcebot-dev/sourcebot","tag":"latest"}` | Configure the container image. |
35-
| image.pullPolicy | string | `"Always"` | Image pull policy. |
34+
| image | object | `{"pullPolicy":"IfNotPresent","repository":"ghcr.io/sourcebot-dev/sourcebot"}` | Configure the container image. |
35+
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. |
3636
| image.repository | string | `"ghcr.io/sourcebot-dev/sourcebot"` | Container image repository. |
37-
| image.tag | string | `"latest"` | Container image tag. |
3837
| imagePullSecrets | list | `[]` | Configure image pull secrets for private registries. |
3938
| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[],"tls":[]}` | Configure ingress for Sourcebot. |
4039
| ingress.annotations | object | `{}` | Ingress annotations. |
@@ -43,7 +42,7 @@ The open source Sourcegraph alternative. Sourcebot gives you a powerful interfac
4342
| ingress.hosts | list | `[]` | List of hostnames and paths for ingress rules. |
4443
| ingress.tls | list | `[]` | TLS settings for ingress. |
4544
| initContainers | list | `[]` | Configure init containers to run before the main container. |
46-
| license | object | `{}` | Configure the enterprise license key secret. |
45+
| license | object | `{}` | Configure the enterprise license key secret by providing license.secretName and license.secretKey to use a Kubernetes secret. |
4746
| livenessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/","port":"http"},"initialDelaySeconds":10,"periodSeconds":10}` | Liveness probe to check if the container is alive. |
4847
| livenessProbe.failureThreshold | int | `5` | Number of consecutive failures before marking the container as unhealthy. |
4948
| livenessProbe.httpGet | object | `{"path":"/","port":"http"}` | Http GET request to check if the container is alive. |
@@ -67,7 +66,7 @@ The open source Sourcegraph alternative. Sourcebot gives you a powerful interfac
6766
| readinessProbe.httpGet.port | string | `"http"` | Port to check. |
6867
| readinessProbe.initialDelaySeconds | int | `10` | Initial delay before the first probe. |
6968
| readinessProbe.periodSeconds | int | `10` | Frequency of the probe. |
70-
| redis | object | `{}` | Configure the Redis secret. |
69+
| redis | object | `{}` | Configure the Redis secret by providing redis.secretName and redis.secretKey to use a Kubernetes secret. |
7170
| replicaCount | int | `1` | Set the number of replicas for the deployment. |
7271
| resources | object | `{}` | Configure resource requests and limits for the container. |
7372
| service | object | `{"annotations":{},"containerPort":3000,"port":3000,"type":"ClusterIP"}` | Configure the Sourcebot Kubernetes service. |
@@ -86,7 +85,12 @@ The open source Sourcegraph alternative. Sourcebot gives you a powerful interfac
8685
| startupProbe.httpGet.path | string | `"/"` | Path to check. |
8786
| startupProbe.httpGet.port | string | `"http"` | Port to check. |
8887
| startupProbe.periodSeconds | int | `30` | Initial delay before the first probe. |
88+
| storage | object | `{"accessModes":["ReadWriteOnce"],"className":"","enabled":true,"size":"10Gi"}` | Configure persistent storage for the application (volume is mounted at /data) to use the internal database. |
89+
| storage.accessModes | list | `["ReadWriteOnce"]` | Access modes for the persistent volume. |
90+
| storage.className | string | `""` | Storage class name for the persistent volume. |
91+
| storage.enabled | bool | `true` | Enable or disable persistent storage. |
92+
| storage.size | string | `"10Gi"` | Size of the persistent volume. |
8993
| tolerations | list | `[]` | Set tolerations for pod scheduling. See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |
90-
| volumeMounts | list | `[]` | Define volume mounts for the container. |
91-
| volumes | list | `[]` | Define additional volumes. |
94+
| volumeMounts | list | `[]` | Define volume mounts for the container. See: https://kubernetes.io/docs/concepts/storage/volumes/ |
95+
| volumes | list | `[]` | Define additional volumes. See: https://kubernetes.io/docs/concepts/storage/volumes/ |
9296

kubernetes/chart/templates/deployment.yaml renamed to kubernetes/chart/templates/deloyable.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
---
22
apiVersion: apps/v1
3+
{{- if $.Values.storage }}
4+
kind: StatefulSet
5+
{{- else }}
36
kind: Deployment
7+
{{- end }}
48
metadata:
59
name: {{ include "sourcebot.fullname" $ }}
610
labels:
711
{{- include "sourcebot.labels" $ | nindent 4 }}
812
spec:
13+
{{- if $.Values.storage }}
14+
serviceName: {{ include "sourcebot.fullname" $ }}
15+
{{- end }}
916
{{- if not $.Values.autoscaling.enabled }}
1017
replicas: {{ $.Values.replicaCount }}
1118
{{- end }}
@@ -106,6 +113,10 @@ spec:
106113
mountPath: /etc/sourcebot/config.json
107114
subPath: config.json
108115
readOnly: true
116+
{{- if $.Values.storage }}
117+
- name: sourcebot-data
118+
mountPath: /data
119+
{{- end }}
109120
{{- with $.Values.volumeMounts }}
110121
{{- toYaml . | nindent 12 }}
111122
{{- end }}
@@ -134,3 +145,15 @@ spec:
134145
tolerations:
135146
{{- toYaml . | nindent 8 }}
136147
{{- end }}
148+
{{- if $.Values.storage }}
149+
volumeClaimTemplates:
150+
- metadata:
151+
name: sourcebot-data
152+
spec:
153+
accessModes:
154+
{{- $.Values.storage.accessModes | toYaml | nindent 10 }}
155+
storageClassName: {{ $.Values.storage.className }}
156+
resources:
157+
requests:
158+
storage: {{ $.Values.storage.size }}
159+
{{- end }}

kubernetes/chart/values.schema.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,33 @@
419419
},
420420
"priorityClassName": {
421421
"type": "string"
422+
},
423+
"storage": {
424+
"type": "object",
425+
"properties": {
426+
"enabled": {
427+
"type": "boolean"
428+
},
429+
"size": {
430+
"type": "string",
431+
"pattern": "^[0-9]+Gi$"
432+
},
433+
"accessModes": {
434+
"type": "array",
435+
"items": {
436+
"type": "string",
437+
"enum": [
438+
"ReadWriteOnce",
439+
"ReadOnlyMany",
440+
"ReadWriteMany"
441+
]
442+
},
443+
"minItems": 1
444+
},
445+
"className": {
446+
"type": "string"
447+
}
448+
}
422449
}
423450
},
424451
"definitions": {

kubernetes/chart/values.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ image:
1414
# -- Container image repository.
1515
repository: ghcr.io/sourcebot-dev/sourcebot
1616
# -- Container image tag.
17-
tag: latest
17+
# tag: ""
1818
# -- Container image digest (used instead of tag if set).
1919
# digest: ""
2020
# -- Image pull policy.
21-
pullPolicy: Always
21+
pullPolicy: IfNotPresent
2222

2323
# -- Configure image pull secrets for private registries.
2424
imagePullSecrets: []
@@ -29,17 +29,17 @@ command: []
2929
# -- Override the default arguments of the container.
3030
args: []
3131

32-
# -- Configure the database secret.
32+
# -- Configure the database secret by providing database.secretName and database.secretKey to use a Kubernetes secret.
3333
database: {}
3434
# secretName: sourcebot-database-url
3535
# secretKey: url
3636

37-
# -- Configure the Redis secret.
37+
# -- Configure the Redis secret by providing redis.secretName and redis.secretKey to use a Kubernetes secret.
3838
redis: {}
3939
# secretName: sourcebot-redis-url
4040
# secretKey: url
4141

42-
# -- Configure the enterprise license key secret.
42+
# -- Configure the enterprise license key secret by providing license.secretName and license.secretKey to use a Kubernetes secret.
4343
license: {}
4444
# secretName: sourcebot-ee-license-key
4545
# secretKey: key
@@ -212,13 +212,15 @@ autoscaling:
212212
targetMemoryUtilizationPercentage: 80
213213

214214
# -- Define additional volumes.
215+
# See: https://kubernetes.io/docs/concepts/storage/volumes/
215216
volumes: []
216217
# - name: foo
217218
# secret:
218219
# secretName: mysecret
219220
# optional: false
220221

221222
# -- Define volume mounts for the container.
223+
# See: https://kubernetes.io/docs/concepts/storage/volumes/
222224
volumeMounts: []
223225
# - name: foo
224226
# mountPath: "/etc/foo"
@@ -263,3 +265,15 @@ affinity: {}
263265
# -- Set the priority class name for pods.
264266
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
265267
priorityClassName: ""
268+
269+
# -- Configure persistent storage for the application (volume is mounted at /data) to use the internal database.
270+
storage:
271+
# -- Enable or disable persistent storage.
272+
enabled: true
273+
# -- Access modes for the persistent volume.
274+
accessModes:
275+
- ReadWriteOnce
276+
# -- Storage class name for the persistent volume.
277+
className: ""
278+
# -- Size of the persistent volume.
279+
size: "10Gi"

0 commit comments

Comments
 (0)