Skip to content

Failed calling webhook "webhook.openpolicyagent.org" error #197

@marcusdroy

Description

@marcusdroy

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

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

  2. validatingwebhookconfiguration is created as expected below

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  annotations:
    meta.helm.sh/release-name: opa
    meta.helm.sh/release-namespace: opa
  creationTimestamp: "2023-03-21T15:04:27Z"
  generation: 1
  labels:
    app: opa-opa-kube-mgmt
    app.kubernetes.io/managed-by: Helm
    chart: opa-kube-mgmt-8.1.0
    heritage: Helm
    release: opa
  name: opa-opa-kube-mgmt
  resourceVersion: "622"
  uid: c696feb5-c5dc-4fbd-a842-c02105027269
webhooks:
- admissionReviewVersions:
  - v1
  - v1beta1
  clientConfig:
    caBundle: "<redacted>"
    service:
      name: opa-opa-kube-mgmt
      namespace: opa
      port: 8181
  failurePolicy: Ignore
  matchPolicy: Equivalent
  name: webhook.openpolicyagent.org
  namespaceSelector:
    matchExpressions:
    - key: openpolicyagent.org/webhook
      operator: NotIn
      values:
      - ignore
  objectSelector: {}
  rules:
  - apiGroups:
    - '*'
    apiVersions:
    - '*'
    operations:
    - '*'
    resources:
    - '*'
    scope: '*'
  sideEffects: None
  timeoutSeconds: 10
  1. Service is available 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

  1. However seeing this 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions