Webhook call fails while deploying a new cluster

I followed the steps mentioned in the following documents to install a fresh Couchbase cluster on Kubernetes:

  1. Install the Operator on Kubernetes | Couchbase Docs
  2. Create a Couchbase Deployment | Couchbase Docs

I have installed kubernetes operator v 2.7 on my Kubernetes cluster v 1.28.1. The commands to install the custom resource definitions, operator and admission controller succeed.

When I run kubectl apply -f couchbase-cluster.yaml it gives me the following error:

secret/cb-example-auth created

Error from server (InternalError): error when creating "couchbase-cluster.yaml": Internal error occurred: failed calling webhook "release-1-couchbase-admission-controller.couchbase.svc": failed to call webhook: Post "https://release-1-couchbase-admission-controller.couchbase.svc:443/couchbaseclusters/validate?timeout=10s": service "release-1-couchbase-admission-controller" not found

Error from server (InternalError): error when creating "couchbase-cluster.yaml": Internal error occurred: failed calling webhook "release-1-couchbase-admission-controller.couchbase.svc": failed to call webhook: Post "https://release-1-couchbase-admission-controller.couchbase.svc:443/couchbaseclusters/validate?timeout=10s": service "release-1-couchbase-admission-controller" not found

These are the actual services created by cao:

NAME                           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)             AGE
couchbase-operator             ClusterIP   xx.xx.xx.xx   <none>        8080/TCP,8383/TCP   19m
couchbase-operator-admission   ClusterIP   xx.xx.xx.xx   <none>        443/TCP             19m

It seems while creating the cluster, Couchbase is looking for a different service name for the operator and admission controller than what was actually installed by cao. How can I solve this issue?

Hello!

This sounds like an artifact from a previously installed admission controller that wasn’t properly removed.

run kubectl get validatingwebhookconfigurations and you should see an entry for release-1-couchbase-admission-controller, delete that webhook configuration and the associated service with the same name.

Thanks,

Justin Ashworth
Manager, Cloud Native Engineering

1 Like

Thank you! That was the issue. Deleting these resources worked for me.