EMC
EMC

Reputation: 1940

Why can't I delete the MutatingWebhookConfiguration I created?

I'm experimenting with mutating admission controllers, and I seem to be able to create one, but not delete it, why is this?

Creating webhook config:

apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
  name: webhook
webhooks:
  - name: webhook.test.com
    clientConfig:
      service:
        name: my-service
        namespace: my-role
        path: "/foo"
      caBundle: "XXX"
    rules:
      - operations: ["CREATE", "UPDATE"]
        apiGroups: ["*"]
        apiVersions: ["*"]
        resources: ["pods"]
        scope:       "Namespaced"
    failurePolicy: Fail

Attempting to delete it: kubectl delete MutatingingWebhookConfiguration webhook Response: error: the server doesn't have a resource type "MutatingingWebhookConfiguration"

I believe that error often has to do with the different versions of different resources, but I don't see why I would be able to create but not delete.

Upvotes: 1

Views: 4919

Answers (1)

EMC
EMC

Reputation: 1940

This was a silly mistake, I forgot to lowercase the resource name when using Kubectl, so kubectl delete mutatingwebhookconfiguration webhook works just fine.

Upvotes: 7

Related Questions