-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
docs: Quickstart for Go-based Operators, kind=Memcached fails #4364
Comments
Hi @bentito, The error faced "Invalid value: 65532: must be in the ranges: [1000600000, 1000609999]]" is specific to the OCP environment. Then, by applying your solution "by removing runAsUser" you are raising security concerns. Could you please try to change the user id in the Dockerfile and manager manifests for a value in the range [1000600000, 1000609999]] and let us know? If it works well as expected, we might need to push this change to upstream https://github.com/kubernetes-sigs/kubebuilder/search?q=65532. |
I tried changing the UID, and I agree on security concern of my proposed workaround, but the UID range changes each time, it's a moving target, you can't guess it correctly every time. I think the problem must lie in the |
Hi @bentito, Sorry. I missed that you are using The reason for the specific used ID be set shows to be because of the K8s security police issue "container has runAsNonRoot and the image has non-numeric user (nonroot), cannot verify user is non-root" raised by the k8s code implementation. More info: "https://stackoverflow.com/questions/49720308/kubernetes-podsecuritypolicy-set-to-runasnonroot-container-has-runasnonroot-and It was introduced in upstream in the PR: kubernetes-sigs/kubebuilder#1635. However, as @joelanford spoke with me shows that "specifying a specific UID doesn't work in OCP (and possibly other non-upstream k8s distros)". By checking the K8S code implementation is the master branch the check still in place. Because of this, I do not think that we should change the upstream/kubebuilder implementation. However, I think that we can:
|
PR adding specific workaround to the FAQ is: #4368 |
Before adding this to the FAQ I'd like to see this addressed upstream, i.e. is there another workaround that will work for both OCP and vanilla k8s. /triage needs-information |
My understanding is if you specify a specific user on OpenShift it will attempt to honor that setting. So a My understanding was for upstream we needed to add |
Yeah that sounds correct. My comment is referring to |
The migration guide for #4402 should include a section for changing this value, since it is fixed upstream. |
https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/
The underlying
operatorsdk --kind=Memcached
called out in the Quickstart docs,Memcached
, fails to deploy with an error like this:This is likely due to changes in the
gcr.io/distroless/static:nonroot
image. Was able to fix the instantiated fileconfig/manager/manager.yaml
by removingrunAsUser
and addingrunAsNonRoot: true
to thespec.securityContext
.I'm not sure this is really a docs issue so much as at this point I'm researching where
operator-sdk
goes for "kinds" such that I might file an issue on the Memcached kind there instead. But it is true that the Quickstart doc currently doesn't produce a working example due to the problem.The text was updated successfully, but these errors were encountered: