Skip to content

Commit 65d81a4

Browse files
authored
About api (#489)
* Add about-api doc Signed-off-by: Jian Qiu <[email protected]> * Add about-api doc Signed-off-by: Jian Qiu <[email protected]> --------- Signed-off-by: Jian Qiu <[email protected]>
1 parent 15cd329 commit 65d81a4

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

content/en/docs/concepts/cluster-inventory/clusterclaim.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,91 @@ status:
5353
- name: id.k8s.io
5454
value: myCluster
5555
```
56+
57+
## About-API Support in Open Cluster Management
58+
59+
Open Cluster Management (OCM) supports the use of `ClusterProperty` via the
60+
[about-api](https://github.com/kubernetes-sigs/about-api),
61+
which allows administrators to define and expose cluster-scoped properties. These properties are
62+
synced to the managed cluster's `ManagedCluster` status and can coexist with
63+
`ClusterClaim` but take precedence if a same-named property exists.
64+
65+
### Enabling the Feature
66+
67+
To enable the `ClusterProperty` feature on the spoke cluster, the `ClusterProperty` feature gate must be
68+
set on the Klusterlet component. This can be done by setting the feature gate in the Klusterlet configuration:
69+
70+
```yaml
71+
featureGates:
72+
ClusterProperty: "true"
73+
```
74+
75+
Ensure that the feature gate is enabled appropriately based on your cluster management strategy.
76+
77+
### Using ClusterProperty
78+
79+
#### Creating a ClusterProperty
80+
81+
Cluster administrators can create a `ClusterProperty` custom resource in the spoke cluster. The following
82+
is an example YAML for creating a `ClusterProperty`:
83+
84+
```yaml
85+
apiVersion: about.k8s.io/v1alpha1
86+
kind: ClusterProperty
87+
metadata:
88+
name: example-property
89+
spec:
90+
value: "example-value"
91+
```
92+
93+
Once created, the `ClusterProperty` will be automatically synced to the hub cluster and reflected within
94+
the `ManagedCluster` resource's status.
95+
96+
#### Syncing Existing Properties
97+
98+
After enabling the feature, any existing `ClusterProperty` resources will be synced to the `ManagedCluster`
99+
status on the hub cluster.
100+
101+
Example: If `example-property` with value `example-value` already exists on the spoke cluster, its value
102+
will populate into the `ManagedCluster` as:
103+
104+
```yaml
105+
status:
106+
clusterClaims:
107+
- name: "example-property"
108+
value: "example-value"
109+
```
110+
111+
#### Handling Conflicts with ClusterClaim
112+
113+
In case a `ClusterClaim` resource with the same name as a `ClusterProperty` exists, the `ClusterProperty`
114+
will take precedence and the corresponding `ClusterClaim` will be ignored.
115+
116+
#### Updating ClusterProperties
117+
118+
Updating the value of an existing `ClusterProperty` will automatically reflect the change in the managed
119+
cluster's status:
120+
121+
```yaml
122+
spec:
123+
value: "updated-value"
124+
```
125+
126+
#### Deleting ClusterProperties
127+
128+
When a `ClusterProperty` is deleted from the spoke cluster, its corresponding entry in the `ManagedCluster`
129+
status is removed:
130+
131+
```shell
132+
kubectl delete clusterproperty example-property
133+
```
134+
135+
This will result in the removal of the `example-property` from the `ManagedCluster` status on the hub cluster.
136+
137+
### Additional Notes
138+
- Both `ClusterProperty` and `ClusterClaim` can co-exist, with `ClusterProperty` taking precedence in
139+
naming conflicts.
140+
- The feature uses the existing OCM infrastructure for status synchronization, ensuring minimal disruption to
141+
ongoing operations.
142+
- Ensure compatibility and testing in your environment before enabling the `ClusterProperty` feature gate in
143+
production settings.

0 commit comments

Comments
 (0)