kubebuilder
kubebuilder copied to clipboard
Writing controllers without generating api
What do you want to happen?
Sometimes the users don't need to create an API for themselves(e.g. implementing a loadbalancer svc provider only needs to watch kubernetes native service), how to do that? Any suggestions would be appreciated!
Extra Labels
No response
Then. that means that you will reconcile a core type. That is supported already. You ought to run such as :
$kb create api --group apps --version v1 --kind Deployment --controller=true --resource=false
Note that all that is scaffolded by the tool is tracked in the PROJECT file. Why? The tool uses the data to provide helpers and we wish to have more plugins and helpers in the future.
However, we need to document in the KB docs:
- How to work with core types? ( That is your case )
- Also, how to work with external types which also is possible when we want to reconcile a resource that is not owned by the project. E.g reconcile the CRD created in Operator B in Operator A.
See that we have:
- https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/using_an_external_type.md (which probably is outdated and needs to be added to the book docs)
- https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/src/reference/project-config.md which describe the project config and is added to the book docs. See:

We need a doc which describes the above command + links the KB code with all core types mapped. See: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/options.go#L28-L51
Would you like to help with that? PS. I am changing this one for docs.
Then. that means that you will reconcile a core type. That is supported already. You ought to run such as :
$kb create api --group apps --version v1 --kind Deployment --controller=true --resource=false
Note that all that is scaffolded by the tool is tracked in the PROJECT file. Why? The tool uses the data to provide helpers and we wish to have more plugins and helpers in the future.
However, we need to document in the KB docs:
- How to work with core types? ( That is your case )
- Also, how to work with external types which also is possible when we want to reconcile a resource that is not owned by the project. E.g reconcile the CRD created in Operator B in Operator A.
See that we have:
- https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/using_an_external_type.md (which probably is outdated and needs to be added to the book docs)
- https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/src/reference/project-config.md which describe the project config and is added to the book docs. See:
![]()
We need a doc which describes the above command + links the KB code with all core types mapped. See: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/options.go#L28-L51
Would you like to help with that? PS. I am changing this one for docs.
Thanks for your so clear answer! I'm going to help with that this weekend. /assign
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
Hi @swiftslee,
Have you any position about this one? Are you working on this one? If not that is OK. However, could you please remove the assignment for another person to be able to contribute?
Hi @camilamacedo86 @swiftslee, is this issue open can I work on this? :slightly_smiling_face:
Hi, I found this issue interesting. @swiftslee @Nivedita-coder could I work along with you on this PR?
Hi @swiftslee,
Have you any position about this one? Are you working on this one? If not that is OK. However, could you please remove the assignment for another person to be able to contribute?
Sorry for the miss.
I don't have much time recently. Let's assign it to @AshwinRamachandran2002.
/unassign
/assign @AshwinRamachandran2002
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
Hey @AshwinRamachandran2002 are you working on this ?
I would like to work on this /assign
hello, @camilamacedo86 I have understood the issue. If this issue is still valid I would like to work on this.
I worked on this a bit but a bit confused @camilamacedo86
Do you mean we need to extend the content in resources.path and update the mentioned here part with another link/url.
Could you help me @Sajiyah-Salat by elaborating a bit?
This one is about document the explanation give in https://github.com/kubernetes-sigs/kubebuilder/issues/2398#issuecomment-952709317
See that we have the issue and a PR that we need to finish which cover it already, see: https://github.com/kubernetes-sigs/kubebuilder/issues/3210
Also, please feel free to contribute for we finish the open pr (address the comments so we can get that merged) And if you see any other point where we are missing to doc please feel free to open prs to provide suggestions for we improve the documentation.
In this way, I am closing this one in favor of https://github.com/kubernetes-sigs/kubebuilder/issues/3210