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
2 changes: 2 additions & 0 deletions charts/sourcegraph-executor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<!-- START CHANGELOG -->
## Unreleased

* Set `EXECUTOR_DEPLOY_TYPE` to `helm-k8s` in the `sourcegraph-executor-k8s` chart and `helm-dind` in the `sourcegraph-executor-dind` chart, so pings report which chart deployed the executors. The `sourcegraph-executor-dind` chart rejects `EXECUTOR_DEPLOY_TYPE` in `executor.env` and `queues[].env`.

## 8.0.0

* Added a `network-policy` example to the `sourcegraph-executor-k8s` and `sourcegraph-executor-dind` charts, with `CiliumNetworkPolicy` resources which limit Executor and job pods to the frontend API.
Expand Down
5 changes: 4 additions & 1 deletion charts/sourcegraph-executor/dind/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ spec:
value: "false"
- name: EXECUTOR_USE_KUBERNETES
value: "false"
- name: EXECUTOR_DEPLOY_TYPE
value: helm-dind
- name: EXECUTOR_HEALTH_SERVER_ADDR
value: ":8080"
- name: EXECUTOR_JOB_NUM_CPUS
Expand Down Expand Up @@ -376,7 +378,8 @@ Usage: include "executor.validateEnv" (list $envDict "label")
"EXECUTOR_MAXIMUM_NUM_JOBS"
"EXECUTOR_MAXIMUM_RUNTIME_PER_JOB"
"EXECUTOR_DOCKER_ADD_HOST_GATEWAY"
"EXECUTOR_KEEP_WORKSPACES" -}}
"EXECUTOR_KEEP_WORKSPACES"
"EXECUTOR_DEPLOY_TYPE" -}}
{{- range $managed -}}
{{- if hasKey $envDict . -}}
{{- fail (printf "%s: env must not contain managed variable %s; use the structured executor fields instead" $label .) -}}
Expand Down
18 changes: 18 additions & 0 deletions charts/sourcegraph-executor/dind/tests/executor_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ tests:
name: EXECUTOR_QUEUE_NAME
value: batches
template: executor/executor.Deployment.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: EXECUTOR_DEPLOY_TYPE
value: helm-dind
template: executor/executor.Deployment.yaml

- it: should refuse EXECUTOR_DEPLOY_TYPE in env
template: executor/executor.Deployment.yaml
set:
executor:
queueName: batches
env:
EXECUTOR_DEPLOY_TYPE:
value: custom
asserts:
- failedTemplate:
errorPattern: "env must not contain managed variable EXECUTOR_DEPLOY_TYPE"

- it: should render one Deployment per entry in queues
template: executor/executor.Deployment.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
{{- include "executor.labels" . | nindent 4 }}
data:
EXECUTOR_USE_FIRECRACKER: "false"
EXECUTOR_DEPLOY_TYPE: "helm-k8s"
EXECUTOR_FRONTEND_URL: "{{ .Values.executor.frontendUrl }}"
EXECUTOR_MAXIMUM_NUM_JOBS: "{{ .Values.executor.maximumNumJobs }}"
EXECUTOR_MAXIMUM_RUNTIME_PER_JOB: "{{ .Values.executor.maximumRuntimePerJob }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/sourcegraph-executor/k8s/tests/executor_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ tests:
apiVersion: v1
name: executor-test
template: executor.ConfigMap.yaml
- equal:
path: data.EXECUTOR_DEPLOY_TYPE
value: helm-k8s
template: executor.ConfigMap.yaml

- it: should render default containerSecurityContext with privileged false
template: executor.Deployment.yaml
Expand Down
Loading