-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ERROR controller-runtime.controller - Privileged containers are not allowed spec.containers[1].securityContext.privileged #792
Comments
@mssanjay Hey! Just curious but what do you want me to do? The information provided by you says that you got the error due to that you created some PSP to disallow privileged pods in your cluster. Then, there might be no way to make actions runners work. Perhaps anyone could try to integrate rootless docker into actions-runner-controller, but I'm not going to do that myself anytime soon. If you could, I'll gladly review your work! |
@mumoshu Our corporate policy does not allow Privileged pods in our cluster. Hence the policy is in place. Also, I am using the image "docker:dind-rootless" which I thought is a rootless docker. So I am not sure why this error. Thanks for the update! |
@mssanjay Ah, good to know that there's now rootless version of the official dind image! Well, actions-runner-controller mostly hardcodes If it doesn't work, I'd suggest trying the
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I had the same thing (preparing to add PSP that will disallow privileged containers). I suspect it will work for the dind container, but the deployment will always need a privileged container since it spins up new pods? Anyway, I've tried using a mimimal seLinuxOptions since that should set the # runner-deployment.yaml
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: xxx-gh-runner-deployment
spec:
template:
spec:
organization: xxx-gh
labels:
- xxx-gh-org
- k8s
securityContext:
seLinuxOptions:
# level: "s0"
# role: "system_r"
# type: "super_t"
# user: "system_u"
privileged: false I've no clue what proper values could be for the level / role / type / user, I have tried that the values above, but still the same result. Note: I'm checking the privileged status with this command, which returns true: kubectl get pod xxx-gh-runner-deployment-mzfx9-rj9rs -o json | jq -r '.spec.containers[].securityContext' Note: I had to modify the official |
If anyone could come up with a working changeset that enables you to run runners w/ dind-rootless w/o privileged, I'd be happy to review it :) |
rootless docker still requires privileged set to true |
The controller still spins up both containers (the runner and the dind container) in the pod with --priviledged, which I haven't found a way to change @elebioda. Hence the error. Using a different image (dind-rootless) doesn't matter then, they're still spin up as privileged :-). |
@rajbos gotcha. Sadly, I am just having to disable the dind sidecar and use the runner for any workflow that holds no container actions... which is slim to none... |
@elebioda Thanks for sharing! That's absolutely sad news to hear. I'm now wondering if we could use rootless podman via a |
I am seeing a similar error because I am running on a GKE Autopilot cluster which does not allow privileged pods:
|
I've researched this a bit. The bad news is that the state-of-the-art looks like we still need (1)a rootful container or alike to run a dockerd(with root or non-root user, with or without priv) in the runner pod to run (2)action and service containers(requested by your GitHub Actions workflow). (1) can be a runc container, a sysbox container, a firecracker VM, etc and (2) is usually a docker container, podman container(e.g. if you do I believe we have been discussing about alternatives in (2) so far. But my theory says that we'd need to find one in (1), which isn't trivial and also out of the scope of actions-runner-controller. The good news is:
I haven't considered using other container runtimes like |
Hi , even we are looking for running DinD in non-privileged mode . since our CaaS policy wont allow running any container as root. |
@flopotok did you ever manage to get this working on GKE Autopilot? As I've been running into the same issues. |
We don't use docker inside our actions workflow. Is it possible to add a runner configuration where we can specify privileged: false? |
Hey. Yep see #1383 |
Describe the bug
Controller is unable to create runner pods. I see error as below
2021-09-06T22:15:37.929Z ERROR controller-runtime.controller Reconciler error {"controller": "runner-controller", "request": "gha-runner-controller/example-runner", "error": "pods "example-runner" is forbidden: PodSecurityPolicy: unable to admit pod: [spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]"}
Checks
Manager logs shows below error
Privileged containers are not allowed spec.containers[1].securityContext.privileged
To Reproduce
Disable Previleged Pods in the cluster
Expected behavior
Runner Pod created
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: