Skip to content

Commit e215bde

Browse files
authored
Comment out runAsUser and runAsGroup in values.yaml (#618)
Since [PR 2456](sourcegraph/sourcegraph#2456) in the Sourcegraph repo, support for the default value of -1 for the `KUBERNETES_RUN_AS_USER` and `KUBERNETES_RUN_AS_GROUP` Executor environment variables has been removed - those environment variables now require either blank values or non-negative integers in the range [0, 2147483647], to match the range for Unix UIDs and GIDs. This PR updates `charts/sourcegraph-executor/k8s/values.yaml` so that `runAsUser` and `runAsGroup` are commented out, with comments to explain that the user can uncomment them to use them. Having those settings commented out causes `KUBERNETES_RUN_AS_USER` and `KUBERNETES_RUN_AS_GROUP` in `charts/sourcegraph-executor/k8s/templates/executor.ConfigMap.yaml` to be blank, which is the new default value. ### Checklist - [ ] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan A Helm deployment is successful and does not fail with errors like `KUBERNETES_RUN_AS_USER must be a UID in the range 0 to 2,147,483,647, but got "-1".`
1 parent d1b1a39 commit e215bde

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

charts/sourcegraph-executor/k8s/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ In addition to the documented values, the `executor` and `private-docker-registr
7777
| executor.kubernetesJob.resources.limits.memory | string | `"12Gi"` | The maximum memory for a job. |
7878
| executor.kubernetesJob.resources.requests.cpu | string | `""` | The requested CPU for a job. |
7979
| executor.kubernetesJob.resources.requests.memory | string | `"1Gi"` | The requested memory for a job. |
80-
| executor.kubernetesJob.runAsGroup | int | `-1` | The group ID to run Kubernetes jobs as. |
81-
| executor.kubernetesJob.runAsUser | int | `-1` | The user ID to run Kubernetes jobs as. |
80+
| executor.kubernetesJob.runAsGroup | int | `nil`; accepts [0, 2147483647] | The group ID to run Kubernetes jobs as. |
81+
| executor.kubernetesJob.runAsUser | int | `nil`; accepts [0, 2147483647] | The user ID to run Kubernetes jobs as. |
8282
| executor.log.format | string | `"condensed"` | |
8383
| executor.log.level | string | `"warn"` | Possible values are `dbug`, `info`, `warn`, `eror`, `crit`. |
8484
| executor.log.trace | string | `"false"` | |

charts/sourcegraph-executor/k8s/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ executor:
9494
kubernetesJob:
9595
# -- The number of seconds after which a Kubernetes job will be terminated.
9696
deadline: "1200"
97-
# -- The user ID to run Kubernetes jobs as.
98-
runAsUser: -1
99-
# -- The group ID to run Kubernetes jobs as.
100-
runAsGroup: -1
97+
# -- (int) The user ID to run Kubernetes jobs as.
98+
# @default -- `nil`; accepts [0, 2147483647]
99+
runAsUser:
100+
# -- (int) The group ID to run Kubernetes jobs as.
101+
# @default -- `nil`; accepts [0, 2147483647]
102+
runAsGroup:
101103
# -- The group ID which is set on the job PVC file system.
102104
fsGroup: "1000"
103105
resources:

0 commit comments

Comments
 (0)