Repository navigation
|
Hi, first of all thank you for maintaining such an excellent tool for the k8s community. I also appreciate the extensive tutorial I'm following to get into operator development with kubebuilder. I've gotten stuck on a particularly confusing section (to me at least) which seems like it's missing some instructions. Apologies if I'm the one who missed them instead. In any case, I think some of the confusion in that chapter could be resolved, and I haven't fully solved the issue myself, so I'm writing this as a support question. My problemGoing through my process in chronological order to highlight potential issues with the structure and contents of that chapter:
Understandably so, because I inevitably copied some markers along with v1/cronjob_webhook.go. The missing command?So I grew suspicious that I did something that wasn't intended by the book, and using what I learned from the first tutorial, I started over with Webhook setup for v2 after running $ kubebuilder create webhook --group batch --version v2 --kind CronJob --defaulting --programmatic-validationand copied the logic including some changes for the v2 types from the book. This feels like a step in the correct direction, because make install deploy no longer complains. However, when proceeding to Deployment and testing the changes locally with a v2 cronjob resource, I get: I don't know how to proceed from here. I tried rebuilding and redeploying the docker image with the IMG var as suggested in chapter 1, but that did not change anything. SupportI'm willing to help improve the documentation and create a PR if anybody can help me figure this out. |
Replies: 1 comment
|
Your second For Check the Service backend and manager startup logs: kubectl -n project-system get endpointslices -l kubernetes.io/service-name=project-webhook-service
kubectl -n project-system logs deployment/project-controller-manager -c manager |
Your second
create webhookcommand is the missing step for v2. Copying v1 also copies its webhook names, which explains the duplicate-name errors. Conversion itself is registered by the manager's webhook setup call when the types implementHub/Convertible(book).For
connection refused, check the deployment wiring first. Enablemanager_webhook_patch.yamlinconfig/default/kustomization.yaml, along with../webhookand../certmanager. The example patch mounts the serving certificate and declareswebhook-serveron port 9443. Make sureENABLE_WEBHOOKSisn'tfalse.Check the Service backend and manager startup logs: