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

docs: Add API reference #592

Merged
merged 2 commits into from
Nov 10, 2023
Merged

docs: Add API reference #592

merged 2 commits into from
Nov 10, 2023

Conversation

michaelawyu
Copy link
Contributor

Description of your changes

This PR adds API reference documentation.

How has this code been tested

N/A

Special notes for your reviewer

N/A

@michaelawyu michaelawyu changed the title doc: Add API reference docs: Add API reference Nov 6, 2023


### Resource Types
- [InternalMemberCluster](#internalmembercluster)
Copy link
Contributor

Choose a reason for hiding this comment

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

please only include external facing API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will hide InternalMemberCluster and AppliedWorks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also removed reference to v1alpha1 APIs.



| Field | Description |
| --- | --- |
Copy link
Contributor

Choose a reason for hiding this comment

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

Confusion on why there are two kinds and two apiVersions

- [MemberClusterList](#memberclusterlist)

| Field | Description |
| --- | --- |
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as MemberClusterList, why is there two?




ClusterResourceBinding represents a scheduling decision that binds a group of resources to a cluster. It MUST have a label named `CRPTrackingLabel` that points to the cluster resource policy that creates it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is the first instance of CRPTrackingLabel I recommend putting what it is here as well, or instead.



ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet.
If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. Note that you can't select the following resources: - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, ClusterSchedulingPolicySnapshot, ClusterResourceSnapshot, ClusterResourceBinding, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Bold the note for reserved namespaces to be sure the user catches it.



ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet.
If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. Note that you can't select the following resources: - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, ClusterSchedulingPolicySnapshot, ClusterResourceSnapshot, ClusterResourceBinding, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

@ryanzhang-oss are we wanting to include InternalMemberCluster here?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, that's an internal object.


| Field | Description |
| --- | --- |
| `resourceSelectors` _[ClusterResourceSelector](#clusterresourceselector) array_ | ResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`. You can have 1-100 selectors. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Define ORed, this might be the first time a user sees this.




Manifest represents a resource to be deployed on spoke cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

First mention of spoke cluster might need a small definition




PlacementPolicy contains the rules to select target member clusters to place the selected resources. Note that only clusters that are both joined and satisfying the rules will be selected.
Copy link
Contributor

Choose a reason for hiding this comment

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

Make the note bold


| Field | Description |
| --- | --- |
| `weight` _integer_ | Weight associated with matching the corresponding clusterSelectorTerm, in the range [-100, 100]. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Explain what negative weight does vs positive.

@michaelawyu
Copy link
Contributor Author

Hi @britaniar ! Thanks so much for the comments. The tricky part is, this is an auto-generated file; the contents are pulled from the comments in the source code through the journey of development, and to fix them we would need a separate PR to update the code, the CRDs, and release them first, which is a little bit difficult to follow through considering the timeframe and CCOA restrictions. If possible, I could keep your comments in a GitHub issue, and make the required edits when we are out of the embargo; would this be OK?

@britaniar
Copy link
Contributor

Hi @britaniar ! Thanks so much for the comments. The tricky part is, this is an auto-generated file; the contents are pulled from the comments in the source code through the journey of development, and to fix them we would need a separate PR to update the code, the CRDs, and release them first, which is a little bit difficult to follow through considering the timeframe and CCOA restrictions. If possible, I could keep your comments in a GitHub issue, and make the required edits when we are out of the embargo; would this be OK?

I think that would be okay!


### Resource Types
- [MemberCluster](#membercluster)
- [MemberClusterList](#memberclusterlist)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this?

Comment on lines +146 to +151
- [ClusterResourceBinding](#clusterresourcebinding)
- [ClusterResourcePlacement](#clusterresourceplacement)
- [ClusterResourceSnapshot](#clusterresourcesnapshot)
- [ClusterSchedulingPolicySnapshot](#clusterschedulingpolicysnapshot)
- [Work](#work)
- [WorkList](#worklist)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we order this list by the importance of the object like put CRP first followed by Work and the rest more internal fields.

Comment on lines +146 to +151
- [ClusterResourceBinding](#clusterresourcebinding)
- [ClusterResourcePlacement](#clusterresourceplacement)
- [ClusterResourceSnapshot](#clusterresourcesnapshot)
- [ClusterSchedulingPolicySnapshot](#clusterschedulingpolicysnapshot)
- [Work](#work)
- [WorkList](#worklist)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move the list?



ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet.
If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. Note that you can't select the following resources: - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, ClusterSchedulingPolicySnapshot, ClusterResourceSnapshot, ClusterResourceBinding, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

no, that's an internal object.

Copy link
Contributor

@ryanzhang-oss ryanzhang-oss left a comment

Choose a reason for hiding this comment

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

I need this link to link to Azure doc

@ryanzhang-oss ryanzhang-oss merged commit e95ee8a into Azure:main Nov 10, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants