Skip to content
Open
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
1 change: 1 addition & 0 deletions charts/sourcegraph-executor/dind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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
Expand Up @@ -131,6 +131,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.sourcegraph.tolerations }}
{{- if or .Values.executor.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.executor.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.sourcegraph.tolerations }}
{{- if or .Values.privateDockerRegistry.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.privateDockerRegistry.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/sourcegraph-executor/dind/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
9 changes: 5 additions & 4 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.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.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 @@ -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
Expand Up @@ -100,6 +100,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.executor.tolerations }}
{{- if or .Values.executor.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.executor.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
38 changes: 20 additions & 18 deletions charts/sourcegraph-executor/k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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 Down Expand Up @@ -68,7 +70,7 @@ executor:
requests:
cpu: 500m
memory: 200Mi
# -- 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).
# -- 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.
frontendUrl: ""
# -- Name of existing k8s Secret to use for frontend password
Expand All @@ -86,13 +88,13 @@ executor:
maximumNumJobs: 10
# - The maximum wall time that can be spent on a single job.
maximumRuntimePerJob: "30m"

log:
# -- Possible values are `dbug`, `info`, `warn`, `eror`, `crit`.
level: "warn"
format: "condensed"
trace: "false"

# -- The storage size of the PVC attached to the executor deployment.
storageSize: 10Gi
# -- The namespace in which jobs are generated by the executor.
Expand All @@ -102,24 +104,24 @@ executor:
# -- The containerSecurityContext for the executor image
securityContext:
# @default -- nil; accepts [0, 2147483647]
runAsUser:
runAsUser:
# @default -- nil; accepts [0, 2147483647]
runAsGroup:
runAsGroup:
# @default -- nil; accepts [0, 2147483647]
fsGroup:
# @default -- false; accepts [true, false]
privileged: false

kubernetesJob:
# -- The number of seconds after which a Kubernetes job will be terminated.
deadline: "1200"
# -- (int) The user ID to run Kubernetes jobs as.
# @default -- `nil`; accepts [0, 2147483647]
runAsUser:
runAsUser:
# -- (int) The group ID to run Kubernetes jobs as.
# @default -- `nil`; accepts [0, 2147483647]
runAsGroup:
# -- The group ID which is set on the job PVC file system.
runAsGroup:
# -- The group ID which is set on the job PVC file system.
fsGroup: "1000"
resources:
requests:
Expand All @@ -132,11 +134,11 @@ executor:
cpu: ""
# -- The maximum memory for a job.
memory: "12Gi"

node:
# -- The name of the Kubernetes Node to create job pods on. If not specified, the pods are created on the first available node.
# -- The name of the Kubernetes Node to create job pods on. If not specified, the pods are created on the first available node.
name: ""
# -- A comma separated list of values to use as a node selector for Kubernetes Jobs. e.g. `foo=bar,app=my-app`
# -- A comma separated list of values to use as a node selector for Kubernetes Jobs. e.g. `foo=bar,app=my-app`
selector: ""
# -- The JSON encoded tolerations for Kubernetes Jobs. e.g. '[{\"key\":\"foo\",\"operator\":\"Equal\",\"value\":\"bar\",\"effect\":\"NoSchedule\"}]'
tolerations: ""
Expand All @@ -150,28 +152,28 @@ executor:
affinity: ""
# -- The JSON encoded pod anti-affinity for Kubernetes Jobs. e.g. '[{\"labelSelector\": {\"matchExpressions\": [{\"key\": \"foo\",\"operator\": \"In\",\"values\": [\"bar\"]}]},\"topologyKey\": \"kubernetes.io/hostname\"}]'
antiAffinity: ""

debug:
# -- If true, Kubernetes jobs will not be deleted after they complete. Not recommended for production use as it can hit cluster limits.
keepJobs: "false"
keepWorkspaces: "false"

# -- Affinity,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
affinity: { }

# -- NodeSelector,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector)
nodeSelector: { }

# -- Tolerations,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
tolerations: [ ]

# -- Sets extra environment variables on the executor deployment. See `values.yaml` for the format.
extraEnv:
# - name: MY_ENV
# value: my_value

# -- For local deployments the host is 'host.docker.internal' and this needs to be true
dockerAddHostGateway: "false"
1 change: 1 addition & 0 deletions charts/sourcegraph-migrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ In addition to the documented values, the `migrator` service also supports the f
| 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/) |

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.sourcegraph.tolerations }}
{{- if or .Values.migrator.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.migrator.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/sourcegraph-migrator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""


# Generic application configuration options, used by most applications below
Expand Down
1 change: 1 addition & 0 deletions charts/sourcegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ In addition to the documented values, all services also support the following va
| sourcegraph.nodeSelector | object | `{}` | Global 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.revisionHistoryLimit | int | `10` | Global deployment clean up policy, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy) |
| sourcegraph.serviceLabels | object | `{}` | Add extra labels to all services |
| sourcegraph.tolerations | list | `[]` | Global Tolerations, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
Expand Down
3 changes: 3 additions & 0 deletions charts/sourcegraph/templates/_worker.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ spec:
{{- if $top.Values.worker.extraContainers }}
{{- toYaml $top.Values.worker.extraContainers | nindent 6 }}
{{- end }}
{{- if or $top.Values.worker.priorityClassName $top.Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce $top.Values.worker.priorityClassName $top.Values.sourcegraph.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml $top.Values.worker.podSecurityContext | nindent 8 }}
{{- include "sourcegraph.nodeSelector" (list $top "worker" ) | trim | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ spec:
{{- if .Values.blobstore.extraContainers }}
{{- toYaml .Values.blobstore.extraContainers | nindent 6 }}
{{- end }}
{{- if or .Values.blobstore.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.blobstore.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.blobstore.podSecurityContext | nindent 8 }}
{{- include "sourcegraph.nodeSelector" (list . "blobstore" ) | trim | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/sourcegraph/templates/cadvisor/cadvisor.DaemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ spec:
{{- toYaml .Values.cadvisor.extraContainers | nindent 6 }}
{{- end }}
automountServiceAccountToken: false
{{- if or .Values.cadvisor.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.cadvisor.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
terminationGracePeriodSeconds: 30
securityContext:
{{- toYaml .Values.cadvisor.podSecurityContext | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ spec:
{{- if .Values.codeInsightsDB.extraContainers }}
{{- toYaml .Values.codeInsightsDB.extraContainers | nindent 6 }}
{{- end }}
{{- if or .Values.codeInsightsDB.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.codeInsightsDB.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.codeInsightsDB.podSecurityContext | nindent 8 }}
{{- include "sourcegraph.nodeSelector" (list . "codeInsightsDB" ) | trim | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ spec:
{{- if .Values.codeIntelDB.extraContainers }}
{{- toYaml .Values.codeIntelDB.extraContainers | nindent 6 }}
{{- end }}
{{- if or .Values.codeIntelDB.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.codeIntelDB.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
terminationGracePeriodSeconds: 120
securityContext:
{{- toYaml .Values.codeIntelDB.podSecurityContext | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ spec:
{{- if .Values.frontend.extraContainers }}
{{- toYaml .Values.frontend.extraContainers | nindent 6 }}
{{- end }}
{{- if or .Values.frontend.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.frontend.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.frontend.podSecurityContext | nindent 8 }}
{{- include "sourcegraph.nodeSelector" (list . "frontend" ) | trim | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ spec:
{{- if .Values.gitserver.extraVolumes }}
{{- toYaml .Values.gitserver.extraVolumes | nindent 6 }}
{{- end }}
{{- if .Values.gitserver.priorityClassName }}
priorityClassName: {{ .Values.gitserver.priorityClassName }}
{{- if or .Values.gitserver.priorityClassName .Values.sourcegraph.priorityClassName }}
priorityClassName: {{ coalesce .Values.gitserver.priorityClassName .Values.sourcegraph.priorityClassName }}
{{- end }}
updateStrategy:
type: RollingUpdate
Expand Down
Loading
Loading