calling webhook - connection refused #3802
Replies: 1 comment
-
Hi @raminderis, Webhook ServerThe webhook server typically runs as a part of the controller-manager pod. The manager container inside this pod is responsible for running both the controllers and the webhook server. See: kubebuilder/testdata/project-v4/cmd/main.go Lines 159 to 162 in 2b25ade
Connection Refused ErrorThe "connection refused" error usually indicates that something is preventing the Kubernetes API server from communicating with your webhook service. Here are a few things you can check and try:
You can check the patch: https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v4/config/default/manager_webhook_patch.yaml You need uncomment: kubebuilder/testdata/project-v4/config/default/kustomization.yaml Lines 39 to 142 in 2b25ade PS.: The e2e tests are done with webhooks, you might want to give a look at: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/e2e/v4/plugin_cluster_test.go Other points to check
I hope that answered your question, so I am closing this one. Some refs: |
Beta Was this translation helpful? Give feedback.
-
so i am following the famous kubebuilder book. all went well until i started playing with webhooks to introduce mutliple versions.
when i try to create the cronjob it calls either mutating webhook (if v1) or conversion webhook(if v2).
but both cases i get (this one is when i try to create v1 job):
Error from server (InternalError): error when creating "config/samples/batch_v1_cronjob.yaml": Internal error occurred: failed calling webhook "mcronjob.kb.io": failed to call webhook: Post "https://kubebuilder-webhook-service.kubebuilder-system.svc:443/mutate-batch-tutorial-kubebuilder-io-v1-cronjob?timeout=10s": dial tcp 10.96.169.192:443: connect: connection refused
I see the service, the end points and the kubebuilder-controller-manager pod running normally.
Few Q:
i am stuck here for more then 3 days now. Any help is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions