Skip to content
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

Comment out runAsUser and runAsGroup in values.yaml #618

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

peterguy
Copy link
Contributor

@peterguy peterguy commented Jan 16, 2025

Since PR 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

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".

@peterguy peterguy self-assigned this Jan 16, 2025
@peterguy peterguy marked this pull request as ready for review January 17, 2025 17:00
@peterguy peterguy merged commit e215bde into main Jan 17, 2025
5 checks passed
@peterguy peterguy deleted the peterguy/remove-default-values-user-group branch January 17, 2025 17:05
@sourcegraph-release-bot
Copy link
Collaborator

The backport to 6.0.x failed at https://github.com/sourcegraph/deploy-sourcegraph-helm/actions/runs/12940695653:

The process '/usr/bin/git' failed with exit code 1

To backport this PR manually, you can either:

Via the sg tool

Use the sg backport command to backport your commit to the release branch.

sg backport -r 6.0.x -p 618
Via your terminal

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-6.0.x 6.0.x
# Navigate to the new working tree
cd .worktrees/backport-6.0.x
# Create a new branch
git switch --create backport-618-to-6.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e215bdeb2edbf2518be8aa79acdbe677aafc3b57
# Push it to GitHub
git push --set-upstream origin backport-618-to-6.0.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-6.0.x

If you encouter conflict, first resolve the conflict and stage all files, then run the commands below:

git cherry-pick --continue
# Push it to GitHub
git push --set-upstream origin backport-618-to-6.0.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-6.0.x
  • Follow above instructions to backport the commit.
  • Create a pull request where the base branch is 6.0.x and the compare/head branch is backport-618-to-6.0.x., click here to create the pull request.

Once the pull request has been created, please ensure the following:

  • Make sure to tag @sourcegraph/release in the pull request description.

  • kindly remove the release-blocker from this pull request.

peterguy added a commit that referenced this pull request Jan 24, 2025
…#626)

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".`
 <br> Backport e215bde from #618

Co-authored-by: Peter Guy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants