Skip to content
Draft
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
4 changes: 2 additions & 2 deletions TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ helm plugin install https://github.com/helm-unittest/helm-unittest
Once the plugin is installed, you can run the unit tests using the following:

```bash
helm unittest --helm3 ./charts/sourcegraph/.
helm unittest ./charts/sourcegraph
```

We currently do not have testing best practices or require unit tests for new changes, so add test cases at your best judgement if possible.
Expand Down Expand Up @@ -59,7 +59,7 @@ Make sure you test both enabled and disabled toggles. For example, if you added
You have two options to target specificy Sourcegraph version. Add the below to your `override.yaml`:

```yaml
sourcegraph:
sourcegraph:
image:
defaultTag: "6.10.0"
useGlobalTagAsDefault: true
Expand Down
4 changes: 2 additions & 2 deletions charts/sourcegraph-executor/dind/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: https://sourcegraph.com/favicon.ico
type: application

# Chart version, separate from Sourcegraph
version: "5.11.0"
version: "6.11.1446"

# Version of Sourcegraph release
appVersion: "5.11.0"
appVersion: "6.11.1446"
5 changes: 3 additions & 2 deletions charts/sourcegraph-executor/dind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
| executor.env.EXECUTOR_FRONTEND_URL | object | `{"value":""}` | The external URL of the Sourcegraph instance. Required. |
| executor.env.EXECUTOR_QUEUE_NAME | object | `{"value":""}` | The name of the queue to pull jobs from to. Possible values: batches and codeintel. **Either this or EXECUTOR_QUEUE_NAMES is required.** |
| executor.env.EXECUTOR_QUEUE_NAMES | object | `{"value":""}` | The comma-separated list of names of multiple queues to pull jobs from to. Possible values: batches and codeintel. **Either this or EXECUTOR_QUEUE_NAME is required.** |
| executor.image.defaultTag | string | `"6.0.0@sha256:0be94a7c91f8273db10fdf46718c6596340ab2acc570e7b85353806e67a27508"` | |
| executor.image.defaultTag | string | `"6.11.1446@sha256:db752a634601a4dac2ac19bc0a520720f29e7460aeb84d66e69b976e6cbd8baa"` | |
| executor.image.name | string | `"executor"` | |
| executor.replicaCount | int | `1` | |
| privateDockerRegistry.enabled | bool | `true` | Whether to deploy the private registry. Only one registry is needed when deploying multiple executors. More information: https://docs.sourcegraph.com/admin/executors/deploy_executors#using-private-registries |
Expand All @@ -71,14 +71,15 @@ In addition to the documented values, the `executor` and `private-docker-registr
| sourcegraph.affinity | object | `{}` | Affinity, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) |
| sourcegraph.image.defaultTag | string | `"{{ .Chart.AppVersion }}"` | Global docker image tag |
| sourcegraph.image.pullPolicy | string | `"IfNotPresent"` | Global docker image pull policy |
| sourcegraph.image.repository | string | `"index.docker.io/sourcegraph"` | Global docker image registry or prefix |
| sourcegraph.image.repository | string | `"us-docker.pkg.dev/sourcegraph-images/internal"` | Global docker image registry or prefix |
| sourcegraph.image.useGlobalTagAsDefault | bool | `false` | When set to true, sourcegraph.image.defaultTag is used as the default defaultTag for all services, instead of service-specific default defaultTags |
| sourcegraph.imagePullSecrets | list | `[]` | Mount named secrets containing docker credentials |
| sourcegraph.labels | object | `{}` | Add a global label to all resources |
| sourcegraph.nameOverride | string | `""` | Set a custom name for the app.kubernetes.io/name annotation |
| sourcegraph.nodeSelector | object | `{}` | NodeSelector, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) |
| sourcegraph.podAnnotations | object | `{}` | Add extra annotations to attach to all pods |
| sourcegraph.podLabels | object | `{}` | Add extra labels to attach to all pods |
| sourcegraph.priorityClassName | string | `""` | Assign a priorityClass to all pods (daemonSets, deployments, and statefulSets) |
| sourcegraph.tolerations | list | `[]` | Tolerations, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| storageClass.allowedTopologies | object | `{}` | Persistent volumes topology configuration, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies) |
| storageClass.create | bool | `false` | Enable creation of storageClass. Defaults to Google Cloud Platform. Disable if you have your own existing storage class |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{/*

Allow customers to assign a priorityClassName to all resources which create pods (ex. DaemonSets, Deployments, StatefulSets)

Customers can configure an instance-wide default priorty class name at .Values.sourcegraph.priorityClassName,
and can override it for individual services, if needed, at .Values.<service>.priorityClassName

*/}}

{{- define "sourcegraph.priorityClassName" -}}
{{- $top := index . 0 }}
{{- $service := index . 1 }}
{{- $globalPriorityClassName := (index $top.Values "sourcegraph" "priorityClassName") }}
{{- $servicePriorityClassName := (index $top.Values $service "priorityClassName") }}
{{- if $servicePriorityClassName }}
priorityClassName: {{ $servicePriorityClassName | toYaml | trim }}
{{- else if $globalPriorityClassName }}
priorityClassName: {{ $globalPriorityClassName | toYaml | trim }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with include "sourcegraph.priorityClassName" (list . "executor") | trim }}{{ . | nindent 6 }}{{- end }}
{{- with .Values.sourcegraph.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with include "sourcegraph.priorityClassName" (list . "privateDockerRegistry") | trim }}{{ . | nindent 6 }}{{- end }}
{{- with .Values.sourcegraph.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
6 changes: 4 additions & 2 deletions charts/sourcegraph-executor/dind/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sourcegraph:
# -- Global docker image pull policy
pullPolicy: IfNotPresent
# -- Global docker image registry or prefix
repository: index.docker.io/sourcegraph
repository: us-docker.pkg.dev/sourcegraph-images/internal
# -- When set to true, sourcegraph.image.defaultTag is used as the default defaultTag for all services, instead of service-specific default defaultTags
useGlobalTagAsDefault: false
# -- Mount named secrets containing docker credentials
Expand All @@ -30,6 +30,8 @@ sourcegraph:
podAnnotations: {}
# -- Add extra labels to attach to all pods
podLabels: {}
# -- Assign a priorityClass to all pods (daemonSets, deployments, and statefulSets)
priorityClassName: ""


storageClass:
Expand All @@ -55,7 +57,7 @@ storageClass:
executor:
enabled: true
image:
defaultTag: 6.0.0@sha256:0be94a7c91f8273db10fdf46718c6596340ab2acc570e7b85353806e67a27508
defaultTag: 6.11.1446@sha256:db752a634601a4dac2ac19bc0a520720f29e7460aeb84d66e69b976e6cbd8baa
name: "executor"
replicaCount: 1
env:
Expand Down
4 changes: 2 additions & 2 deletions charts/sourcegraph-executor/k8s/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: https://sourcegraph.com/favicon.ico
type: application

# Chart version, separate from Sourcegraph
version: "5.11.0"
version: "6.11.1446"

# Version of Sourcegraph release
appVersion: "5.11.0"
appVersion: "6.11.1446"
13 changes: 7 additions & 6 deletions charts/sourcegraph-executor/k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ In addition to the documented values, the `executor` and `private-docker-registr
| executor.extraEnv | string | `nil` | Sets extra environment variables on the executor deployment. See `values.yaml` for the format. |
| executor.frontendExistingSecret | string | `""` | Name of existing k8s Secret to use for frontend password The name of the secret must match `executor.name`, i.e., the name of the helm release used to deploy the helm chart. The k8s Secret must contain the key `EXECUTOR_FRONTEND_PASSWORD` matching the site config `executors.accessToken` value. `executor.frontendPassword` is ignored if this is enabled. |
| executor.frontendPassword | string | `""` | The shared secret configured in the Sourcegraph instance site config under executors.accessToken. Required if `executor.frontendExistingSecret`` is not configured. |
| executor.frontendUrl | string | `""` | The external URL of the Sourcegraph instance. Required. **Recommended:** set to the internal service endpoint (e.g. `http://sourcegraph-frontend.sourcegraph.svc.cluster.local:30080` if Sourcegraph is deployed in the `sourcegraph` namespace). This will avoid unnecessary network charges as traffic will stay within the local network. |
| executor.image.defaultTag | string | `"6.0.0@sha256:6dc771a0c281a41ef676213f2f84a63d99045cf2e58d43022554a8022070ed65"` | |
| executor.frontendUrl | string | `""` | The external URL of the Sourcegraph instance. Required. **Recommended:** set to the internal service endpoint (e.g. `http://sourcegraph-frontend.sourcegraph.svc.cluster.local:30080` if Sourcegraph is deployed in the `sourcegraph` namespace). This will avoid unnecessary network charges as traffic will stay within the local network. |
| executor.image.defaultTag | string | `"6.11.1446@sha256:bfbdeec143589c84fa4470d34d732c0d0018dc3274d34ab97aef3d7e6443f1fb"` | |
| executor.image.name | string | `"executor-kubernetes"` | |
| executor.kubeconfigPath | string | `""` | The path to the kubeconfig file. If not specified, the in-cluster config is used. |
| executor.kubernetesJob.deadline | string | `"1200"` | The number of seconds after which a Kubernetes job will be terminated. |
| executor.kubernetesJob.fsGroup | string | `"1000"` | The group ID which is set on the job PVC file system. |
| executor.kubernetesJob.node.name | string | `""` | The name of the Kubernetes Node to create job pods on. If not specified, the pods are created on the first available node. |
| executor.kubernetesJob.fsGroup | string | `"1000"` | The group ID which is set on the job PVC file system. |
| executor.kubernetesJob.node.name | string | `""` | The name of the Kubernetes Node to create job pods on. If not specified, the pods are created on the first available node. |
| executor.kubernetesJob.node.requiredAffinityMatchExpressions | string | `""` | The JSON encoded required affinity match expressions for Kubernetes Jobs. e.g. '[{\"key\":\"foo\",\"operator\":\"In\",\"values\":[\"bar\"]}]' |
| executor.kubernetesJob.node.requiredAffinityMatchFields | string | `""` | The JSON encoded required affinity match fields for Kubernetes Jobs. e.g. '[{\"key\":\"foo\",\"operator\":\"In\",\"values\":[\"bar\"]}]' |
| executor.kubernetesJob.node.selector | string | `""` | A comma separated list of values to use as a node selector for Kubernetes Jobs. e.g. `foo=bar,app=my-app` |
| executor.kubernetesJob.node.selector | string | `""` | A comma separated list of values to use as a node selector for Kubernetes Jobs. e.g. `foo=bar,app=my-app` |
| executor.kubernetesJob.node.tolerations | string | `""` | The JSON encoded tolerations for Kubernetes Jobs. e.g. '[{\"key\":\"foo\",\"operator\":\"Equal\",\"value\":\"bar\",\"effect\":\"NoSchedule\"}]' |
| executor.kubernetesJob.pod.affinity | string | `""` | The JSON encoded pod affinity for Kubernetes Jobs. e.g. '[{\"labelSelector\": {\"matchExpressions\": [{\"key\": \"foo\",\"operator\": \"In\",\"values\": [\"bar\"]}]},\"topologyKey\": \"kubernetes.io/hostname\"}]' |
| executor.kubernetesJob.pod.antiAffinity | string | `""` | The JSON encoded pod anti-affinity for Kubernetes Jobs. e.g. '[{\"labelSelector\": {\"matchExpressions\": [{\"key\": \"foo\",\"operator\": \"In\",\"values\": [\"bar\"]}]},\"topologyKey\": \"kubernetes.io/hostname\"}]' |
Expand Down Expand Up @@ -99,7 +99,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
| sourcegraph.affinity | object | `{}` | Affinity, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) |
| sourcegraph.image.defaultTag | string | `"{{ .Chart.AppVersion }}"` | Global docker image tag |
| sourcegraph.image.pullPolicy | string | `"IfNotPresent"` | Global docker image pull policy |
| sourcegraph.image.repository | string | `"index.docker.io/sourcegraph"` | Global docker image registry or prefix |
| sourcegraph.image.repository | string | `"us-docker.pkg.dev/sourcegraph-images/internal"` | Global docker image registry or prefix |
| sourcegraph.image.useGlobalTagAsDefault | bool | `false` | When set to true, sourcegraph.image.defaultTag is used as the default defaultTag for all services, instead of service-specific default defaultTags |
| sourcegraph.imagePullSecrets | list | `[]` | Mount named secrets containing docker credentials |
| sourcegraph.labels | object | `{}` | Add a global label to all resources |
Expand All @@ -108,6 +108,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
| sourcegraph.nodeSelector | object | `{}` | NodeSelector, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) |
| sourcegraph.podAnnotations | object | `{}` | Add extra annotations to attach to all pods |
| sourcegraph.podLabels | object | `{}` | Add extra labels to attach to all pods |
| sourcegraph.priorityClassName | string | `""` | Assign a priorityClass to all pods (daemonSets, deployments, and statefulSets) |
| sourcegraph.tolerations | list | `[]` | Tolerations, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| storageClass.allowedTopologies | object | `{}` | Persistent volumes topology configuration, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies) |
| storageClass.create | bool | `false` | Enable creation of storageClass. Defaults to Google Cloud Platform. Disable if you have your own existing storage class |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{/*

Allow customers to assign a priorityClassName to all resources which create pods (ex. DaemonSets, Deployments, StatefulSets)

Customers can configure an instance-wide default priorty class name at .Values.sourcegraph.priorityClassName,
and can override it for individual services, if needed, at .Values.<service>.priorityClassName

*/}}

{{- define "sourcegraph.priorityClassName" -}}
{{- $top := index . 0 }}
{{- $service := index . 1 }}
{{- $globalPriorityClassName := (index $top.Values "sourcegraph" "priorityClassName") }}
{{- $servicePriorityClassName := (index $top.Values $service "priorityClassName") }}
{{- if $servicePriorityClassName }}
priorityClassName: {{ $servicePriorityClassName | toYaml | trim }}
{{- else if $globalPriorityClassName }}
priorityClassName: {{ $globalPriorityClassName | toYaml | trim }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with include "sourcegraph.priorityClassName" (list . "executor") | trim }}{{ . | nindent 6 }}{{- end }}
{{- with .Values.executor.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
Loading