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

feat: Support arbitrarily setting privileged: true for runner container #1383

Merged

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Apr 25, 2022

You can now override the securityContext.privileged per container in both RunnerDeployment and RunnerSet, by specifying it in the containers field for the specifically named container.

In case you'd like to run privileged operations from within your Actions workflow jobs, you'd want to just enable privileged on the runner container:

kind: RunnerDeployment
spec:
  template:
    spec:
      containers:
      - name: runner
        securityContext:
          privileged: true

The default privileged value for the runner container is false as you may know, but the above setting overrides it to true.

To be precise, you were already able to imply privileged: true for the runner container by enabling dockerdWithinRunnerContainer. But that implies you still run dockerd within the runner container, which can be unnecessary depending on your use-case. That's where this new setting comes handy.

Note that you can also utilize the same pattern in RunnerSet, too.

kind: RunnerSet
spec:
  template:
    spec:
      containers:
      - name: runner
        securityContext:
          privileged: true

In case you'd like to disable docker (the docker sidecar) at all, you'd need to set the existing dockerEnabled too, under spec.template.spec for RunnerDeployment and under spec for RunnerSet.

kind: RunnerDeployment
spec:
  template:
    spec:
     dockerEnabled: false
      containers:
      - name: runner
        securityContext:
          privileged: true
kind: RunnerSet
spec:
  dockerEnabled: false
  template:
    spec:
      containers:
      - name: runner
        securityContext:
          privileged: true

Resolves #1282

Copy link
Collaborator

@toast-gear toast-gear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support arbitrarily setting privileged: true for runner container
2 participants