calling webhook - connection refused #3802
-
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): 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.
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.
Hi @raminderis,
Webhook Server
The 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
See in the main.go that the server is created within the Manager:
kubebuilder/testdata/project-v4/cmd/main.go
Line 104 in 2b25ade
See the controller-runtime impleme…