-
Notifications
You must be signed in to change notification settings - Fork 106
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
Failed calling webhook "webhook.openpolicyagent.org" error #197
Comments
Thanks for opening this, just to confirm you aren't seeing any logs from OPA at all? I'm trying to work out if |
Looks like both opa mgmt have started
mgmt Interesting to note along with health checks its also returning 404 errors, prehaps the webhook service path needs to be updated? |
Yeah, that doesn't seem right. I think that the url is going to need to be set in the client config too, i.e. https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#url I think that you want to set this to this path: https://www.openpolicyagent.org/docs/latest/rest-api/#get-a-document-webhook i.e. |
I tried the configuration below but got a auth error:
In the opa pod logs it has:
I havent loaded any bundles in yet besides what the chart is providing |
I think I got this wrong. The reason that no path is set in the web hook config is that there's an expectation that default_decision will be used. You can read about that here: https://www.openpolicyagent.org/docs/latest/configuration/#miscellaneous I think that what you need is a policy to be loaded into OPA with the package system and a main rule, as we see here: https://www.openpolicyagent.org/docs/latest/kubernetes-tutorial/#combine-policies I think that OPA is running with authz on, but it should allow anyone into the root path and the default decision:
|
While validating upgrading to the latest version of OPA and kube-mgmt on Kubernetes 1.26, we are seeing
Failed calling webhook "webhook.openpolicyagent.org" error
in the api server logs.E0321 15:06:15.586026 dispatcher.go:183] failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource
W0321 15:06:17.357212 1 dispatcher.go:176] Failed calling webhook, failing open webhook.openpolicyagent.org: failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource
E0321 15:06:17.357275 1 dispatcher.go:183] failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource
Reproduction Steps
Starting with blank kind cluster
kind create cluster --image=kindest/node:v1.26.0
Install latest chart via Helm
helm upgrade -i -n opa --create-namespace opa opa/opa-kube-mgmt --set admissionController.enabled=true --version 8.1.0
validatingwebhookconfiguration is created as expected below
k get svc opa-opa-kube-mgmt -n opa
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE opa-opa-kube-mgmt ClusterIP 10.96.164.211 <none> 8181/TCP 5m38s
E0321 15:06:15.586026 dispatcher.go:183] failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource W0321 15:06:17.357212 1 dispatcher.go:176] Failed calling webhook, failing open webhook.openpolicyagent.org: failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource E0321 15:06:17.357275 1 dispatcher.go:183] failed calling webhook "webhook.openpolicyagent.org": failed to call webhook: the server could not find the requested resource
The text was updated successfully, but these errors were encountered: