-
Notifications
You must be signed in to change notification settings - Fork 124
Add Sourcebot Helm Chart #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aanogueira
wants to merge
4
commits into
sourcebot-dev:main
Choose a base branch
from
aanogueira:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,303
−0
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4439bee
feat: add helm chart
aanogueira 14fac64
Merge branch 'sourcebot-dev:main' into main
aanogueira 198cdf3
feat: add sts support to use internal DB and improve values docs
aanogueira 7f0ca0a
Merge branch 'sourcebot-dev:main' into main
aanogueira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v2 | ||
type: application | ||
name: sourcebot | ||
version: 0.1.0 | ||
appVersion: v4.5.1 | ||
description: The open source Sourcegraph alternative. Sourcebot gives you a powerful interface to search though all your repos and branches across multiple code hosts. | ||
icon: https://raw.githubusercontent.com/sourcebot-dev/sourcebot/ebf6721836b8f878d42bb8c1e844bdc7867a74fe/packages/web/public/logo_512.png | ||
keywords: | ||
- code-search | ||
- code-intelligence | ||
- sourcebot | ||
home: https://sourcebot.dev/ | ||
sources: | ||
- https://github.com/sourcebot-dev/sourcebot | ||
- https://github.com/sourcebot-dev/sourcebot/kubernetes/chart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# sourcebot | ||
|
||
   | ||
|
||
The open source Sourcegraph alternative. Sourcebot gives you a powerful interface to search though all your repos and branches across multiple code hosts. | ||
|
||
**Homepage:** <https://sourcebot.dev/> | ||
|
||
## Source Code | ||
|
||
* <https://github.com/sourcebot-dev/sourcebot> | ||
* <https://github.com/sourcebot-dev/sourcebot/kubernetes/chart> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| additionalLabels | object | `{}` | Add extra labels to all resources. | | ||
| affinity | object | `{}` | Set affinity rules for pod scheduling. Defaults to soft anti-affinity if not set. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ | | ||
| args | list | `[]` | Override the default arguments of the container. | | ||
| autoscaling | object | `{"enabled":false,"maxReplicas":3,"minReplicas":1,"targetCPUUtilizationPercentage":80,"targetMemoryUtilizationPercentage":80}` | Configure Horizontal Pod Autoscaler. | | ||
| autoscaling.enabled | bool | `false` | Enable or disable Horizontal Pod Autoscaler. | | ||
| autoscaling.maxReplicas | int | `3` | Maximum number of replicas. | | ||
| autoscaling.minReplicas | int | `1` | Minimum number of replicas. | | ||
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Target CPU utilization percentage for autoscaling. | | ||
| autoscaling.targetMemoryUtilizationPercentage | int | `80` | Target memory utilization percentage for autoscaling. | | ||
| command | list | `[]` | Override the default command of the container. | | ||
| config | object | `{"$schema":"https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json","connections":{},"settings":{}}` | Configure Sourcebot-specific application settings. | | ||
| containerSecurityContext | object | `{}` | Set the container-level security context. | | ||
| database | object | `{}` | Configure the database secret by providing database.secretName and database.secretKey to use a Kubernetes secret. | | ||
| envSecrets | list | `[]` | Set environment variables from Kubernetes secrets. | | ||
| envs | list | `[]` | Set additional environment variables. | | ||
| fullnameOverride | string | `""` | Override the full name of the chart. | | ||
| image | object | `{"pullPolicy":"IfNotPresent","repository":"ghcr.io/sourcebot-dev/sourcebot"}` | Configure the container image. | | ||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | | ||
| image.repository | string | `"ghcr.io/sourcebot-dev/sourcebot"` | Container image repository. | | ||
| imagePullSecrets | list | `[]` | Configure image pull secrets for private registries. | | ||
| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[],"tls":[]}` | Configure ingress for Sourcebot. | | ||
| ingress.annotations | object | `{}` | Ingress annotations. | | ||
| ingress.className | string | `""` | Ingress class name. | | ||
| ingress.enabled | bool | `false` | Enable or disable ingress. | | ||
| ingress.hosts | list | `[]` | List of hostnames and paths for ingress rules. | | ||
| ingress.tls | list | `[]` | TLS settings for ingress. | | ||
| initContainers | list | `[]` | Configure init containers to run before the main container. | | ||
| license | object | `{}` | Configure the enterprise license key secret by providing license.secretName and license.secretKey to use a Kubernetes secret. | | ||
| livenessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/","port":"http"},"initialDelaySeconds":10,"periodSeconds":10}` | Liveness probe to check if the container is alive. | | ||
| livenessProbe.failureThreshold | int | `5` | Number of consecutive failures before marking the container as unhealthy. | | ||
| livenessProbe.httpGet | object | `{"path":"/","port":"http"}` | Http GET request to check if the container is alive. | | ||
| livenessProbe.httpGet.path | string | `"/"` | Path to check. | | ||
| livenessProbe.httpGet.port | string | `"http"` | Port to check. | | ||
| livenessProbe.initialDelaySeconds | int | `10` | Initial delay before the first probe. | | ||
| livenessProbe.periodSeconds | int | `10` | Frequency of the probe. | | ||
| nameOverride | string | `""` | Override the name of the chart. | | ||
| nodeSelector | object | `{}` | Set node selector constraints. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector | | ||
| podAnnotations | object | `{}` | Add annotations to the pod metadata. | | ||
| podDisruptionBudget | object | `{"enabled":true,"maxUnavailable":1,"minAvailable":1}` | Configure Pod Disruption Budget. | | ||
| podDisruptionBudget.enabled | bool | `true` | Enable Pod Disruption Budget. | | ||
| podDisruptionBudget.maxUnavailable | int | `1` | Maximum number of pods that can be unavailable. | | ||
| podDisruptionBudget.minAvailable | int | `1` | Minimum number of pods that must be available. | | ||
| podSecurityContext | object | `{}` | Set the pod-level security context. | | ||
| priorityClassName | string | `""` | Set the priority class name for pods. See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ | | ||
| readinessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/","port":"http"},"initialDelaySeconds":10,"periodSeconds":10}` | Readiness probe to check if the container is ready to serve traffic. | | ||
| readinessProbe.failureThreshold | int | `5` | Number of consecutive failures before marking the container as not ready. | | ||
| readinessProbe.httpGet | object | `{"path":"/","port":"http"}` | Http GET request to check if the container is ready. | | ||
| readinessProbe.httpGet.path | string | `"/"` | Path to check. | | ||
| readinessProbe.httpGet.port | string | `"http"` | Port to check. | | ||
| readinessProbe.initialDelaySeconds | int | `10` | Initial delay before the first probe. | | ||
| readinessProbe.periodSeconds | int | `10` | Frequency of the probe. | | ||
| redis | object | `{}` | Configure the Redis secret by providing redis.secretName and redis.secretKey to use a Kubernetes secret. | | ||
| replicaCount | int | `1` | Set the number of replicas for the deployment. | | ||
| resources | object | `{}` | Configure resource requests and limits for the container. | | ||
| service | object | `{"annotations":{},"containerPort":3000,"port":3000,"type":"ClusterIP"}` | Configure the Sourcebot Kubernetes service. | | ||
| service.annotations | object | `{}` | Service annotations. | | ||
| service.containerPort | int | `3000` | Internal container port. | | ||
| service.port | int | `3000` | External service port. | | ||
| service.type | string | `"ClusterIP"` | Type of the Kubernetes service (e.g., ClusterIP, NodePort, LoadBalancer). | | ||
| serviceAccount | object | `{"annotations":{},"automount":false,"create":true,"name":""}` | Configure the ServiceAccount. | | ||
| serviceAccount.annotations | object | `{}` | Add annotations to the ServiceAccount. | | ||
| serviceAccount.automount | bool | `false` | Enable or disable automatic ServiceAccount mounting. | | ||
| serviceAccount.create | bool | `true` | Create a new ServiceAccount. | | ||
| serviceAccount.name | string | `""` | Use an existing ServiceAccount (if set). | | ||
| startupProbe | object | `{"failureThreshold":30,"httpGet":{"path":"/","port":"http"},"periodSeconds":30}` | Startup probe to check if the container has started successfully. | | ||
| startupProbe.failureThreshold | int | `30` | Number of seconds to wait before starting the probe. | | ||
| startupProbe.httpGet | object | `{"path":"/","port":"http"}` | Http GET request to check if the container has started. | | ||
| startupProbe.httpGet.path | string | `"/"` | Path to check. | | ||
| startupProbe.httpGet.port | string | `"http"` | Port to check. | | ||
| startupProbe.periodSeconds | int | `30` | Initial delay before the first probe. | | ||
| 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. | | ||
| storage.accessModes | list | `["ReadWriteOnce"]` | Access modes for the persistent volume. | | ||
| storage.className | string | `""` | Storage class name for the persistent volume. | | ||
| storage.enabled | bool | `true` | Enable or disable persistent storage. | | ||
| storage.size | string | `"10Gi"` | Size of the persistent volume. | | ||
| tolerations | list | `[]` | Set tolerations for pod scheduling. See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | | ||
| volumeMounts | list | `[]` | Define volume mounts for the container. See: https://kubernetes.io/docs/concepts/storage/volumes/ | | ||
| volumes | list | `[]` | Define additional volumes. See: https://kubernetes.io/docs/concepts/storage/volumes/ | | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if $.Values.ingress.enabled }} | ||
{{- range $host := $.Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" $.Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ $.Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sourcebot.fullname" $ }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ $.Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" $.Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch its status by running 'kubectl get --namespace {{ $.Release.Namespace }} svc -w {{ include "sourcebot.fullname" $ }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ $.Release.Namespace }} {{ include "sourcebot.fullname" $ }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ $.Values.service.port }} | ||
{{- else if contains "ClusterIP" $.Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ $.Release.Namespace }} -l "app.kubernetes.io/name={{ include "sourcebot.name" $ }},app.kubernetes.io/instance={{ $.Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ $.Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:3000 to use Sourcebot after forwarding" | ||
kubectl --namespace {{ $.Release.Namespace }} port-forward $POD_NAME 3000:$CONTAINER_PORT | ||
{{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "sourcebot.name" -}} | ||
{{- default $.Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "sourcebot.fullname" -}} | ||
{{- if $.Values.fullnameOverride }} | ||
{{- $.Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default $.Chart.Name $.Values.nameOverride }} | ||
{{- if contains $name $.Release.Name }} | ||
{{- $.Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" $.Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "sourcebot.chart" -}} | ||
{{- printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "sourcebot.labels" -}} | ||
helm.sh/chart: {{ include "sourcebot.chart" $ }} | ||
{{ include "sourcebot.selectorLabels" $ }} | ||
{{- if $.Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service }} | ||
{{- with $.Values.additionalLabels }} | ||
{{ toYaml . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "sourcebot.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "sourcebot.name" $ }} | ||
app.kubernetes.io/instance: {{ $.Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the image to use for the container. | ||
*/}} | ||
{{- define "sourcebot.image" -}} | ||
{{- if $.Values.image.digest -}} | ||
"{{ $.Values.image.repository }}@{{ $.Values.image.digest }}" | ||
{{- else if $.Values.image.tag -}} | ||
"{{ $.Values.image.repository }}:{{ $.Values.image.tag }}" | ||
{{- else -}} | ||
"{{ $.Values.image.repository }}:{{ $.Chart.AppVersion }}" | ||
{{- end -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "sourcebot.serviceAccountName" -}} | ||
{{- if $.Values.serviceAccount.create }} | ||
{{- default (include "sourcebot.fullname" $) $.Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" $.Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
brendan-kellam marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "sourcebot.fullname" $ }} | ||
labels: | ||
{{- include "sourcebot.labels" $ | nindent 4 }} | ||
data: | ||
config.json: | | ||
{{- toJson $.Values.config | nindent 4 }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to include autoscaling settings at the moment since Sourcebot isn't setup with horizontal scale in mind atm