Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller Manager Quickstart #267

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RolandMa1986
Copy link
Member

No description provided.

Roland.Ma added 2 commits November 25, 2020 03:49
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RolandMa1986
To complete the pull request process, please assign zryfish
You can assign the PR to them by writing /assign @zryfish in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 26, 2020
@RolandMa1986
Copy link
Member Author

/assign @zryfish

Copy link
Member

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your quickstart. I believe it can help many contributors. I left some comments which do not block this PR.

@@ -0,0 +1,145 @@
# Controller Manager Quickstart

KubeSphere follows the [sample-controller](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/sample-controller) pattern to implement controllers for the reconciliation process. It watches CustomResourceDefinition(CRD) desired state and actual state through informers and listers. Then, it sends instructions through clients to try and make the current state be more like the desired state.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if you can put the relevant links here. For example, put the official link of CustomResourceDefinition.


To implement a controller, you should define your API Groups, Versions, and Kinds firstly. Please read more about the [Kubernetes API Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#websockets-and-spdy) if you want to understand those concepts deeper.

For an example, the `Group` Kind that was defined under `iam.kubershpere.io` API Group as below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an example, I guess you want to say For instance here.

type Group struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status GroupStatus `json:"status,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you just missed here. Please provide a good indent code for all code lines.

@yangchuansheng yangchuansheng force-pushed the master branch 4 times, most recently from 4a41274 to a30f1e3 Compare November 29, 2022 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants