|
| 1 | +# ClusterProfile API Overview |
| 2 | + |
| 3 | +This document provides an overview of the [ClusterProfile API](https://github.com/kubernetes-sigs/cluster-inventory-api?tab=readme-ov-file#cluster-profile-api). |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +A Cluster Profile is a namespace-level resource and essentially represents an individual member of the Cluster Inventory |
| 8 | +that details properties and status of a cluster. This API proposes a standardized interface that defines how cluster information should be presented |
| 9 | +and interacted with across different platforms and implementations. |
| 10 | + |
| 11 | +You can read more details about the API in the [KEP-4322](https://github.com/kubernetes/enhancements/blob/master/keps/sig-multicluster/4322-cluster-inventory/README.md). |
| 12 | + |
| 13 | +## Terminology |
| 14 | + |
| 15 | +- **Cluster Inventory**: A conceptual term referring to a collection of clusters. A cluster inventory may or may not represent |
| 16 | +a [ClusterSet](../api-types/cluster-set.md). A cluster inventory is considered a clusterSet if all its member clusters adhere to the |
| 17 | +[namespace sameness](https://github.com/kubernetes/community/blob/master/sig-multicluster/namespace-sameness-position-statement.md) principle. |
| 18 | + |
| 19 | +- **Cluster Manager**: An entity that creates the ClusterProfile API object per member cluster, |
| 20 | + and keeps their status up-to-date. Each cluster manager MUST be identified with a unique name. |
| 21 | + Each ClusterProfile resource SHOULD be managed by only one cluster manager. A cluster manager SHOULD |
| 22 | + have sufficient permission to access the member cluster to fetch the information so it can update the status |
| 23 | + of the ClusterProfile API resource. |
| 24 | + |
| 25 | +- **ClusterProfile API Consumer**: the person running the cluster managers |
| 26 | + or the person developing extensions for cluster managers for the purpose of |
| 27 | + workload distribution, operation management etc. |
| 28 | + |
| 29 | +## API Example |
| 30 | + |
| 31 | +[CRD definition](https://github.com/kubernetes-sigs/cluster-inventory-api/blob/main/config/crd/bases/multicluster.x-k8s.io_clusterprofiles.yaml) |
| 32 | + |
| 33 | +```yaml |
| 34 | +apiVersion: multicluster.x-k8s.io/v1alpha1 |
| 35 | +kind: ClusterProfile |
| 36 | +metadata: |
| 37 | + name: some-cluster-name |
| 38 | + namespace: fleet-system |
| 39 | + labels: |
| 40 | + x-k8s.io/cluster-manager: some-cluster-manager |
| 41 | +spec: |
| 42 | + displayName: some-cluster |
| 43 | + clusterManager: |
| 44 | + name: some-cluster-manager |
| 45 | +status: |
| 46 | + version: |
| 47 | + kubernetes: 1.28.0 |
| 48 | + properties: |
| 49 | + - name: clusterset.k8s.io |
| 50 | + value: some-clusterset |
| 51 | + - name: location |
| 52 | + value: apac |
| 53 | + conditions: |
| 54 | + - type: ControlPlaneHealthy |
| 55 | + status: True |
| 56 | + lastTransitionTime: "2023-05-08T07:56:55Z" |
| 57 | + message: "" |
| 58 | + - type: Joined |
| 59 | + status: True |
| 60 | + lastTransitionTime: "2023-05-08T07:58:55Z" |
| 61 | + message: "" |
| 62 | +``` |
0 commit comments