Skip to content

Commit

Permalink
update the website sidebar content
Browse files Browse the repository at this point in the history
Signed-off-by: haoqing0110 <[email protected]>
  • Loading branch information
haoqing0110 committed Nov 15, 2023
1 parent d7ac97e commit 0917793
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 31 deletions.
8 changes: 7 additions & 1 deletion content/en/concepts/addon.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: Add-ons
weight: 4
weight: 8
---

<!-- spellchecker-disable -->

{{< toc >}}

<!-- spellchecker-enable -->

## What is an add-on?

Open-cluster-management has a built-in mechanism named [addon-framework](https://github.com/open-cluster-management-io/addon-framework)
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/managedcluster.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: ManagedCluster
weight: 2
weight: 3
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/managedclusterset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: ManagedClusterSet
weight: 2
weight: 4
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/manifestwork.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: ManifestWork
weight: 2
weight: 6
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/manifestworkreplicaset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: ManifestWorkReplicaSet
weight: 3
weight: 7
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/multicluster-controlplane.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Multicluster Control Plane
weight: 2
weight: 10
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/placement.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Placement
weight: 3
weight: 5
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/en/concepts/policy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Policy
weight: 5
weight: 9
---

<!-- spellchecker-disable -->
Expand Down
8 changes: 7 additions & 1 deletion content/zh/concepts/addon.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: 自定义插件
weight: 4
weight: 8
---

<!-- spellchecker-disable -->

{{< toc >}}

<!-- spellchecker-enable -->

## What is an add-on?

Open-cluster-management has a built-in mechanism named [addon-framework](https://github.com/open-cluster-management-io/addon-framework)
Expand Down
6 changes: 3 additions & 3 deletions content/zh/concepts/clusterclaim.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: ClusterClaim
title: 集群声明
weight: 2
---

Expand Down Expand Up @@ -32,7 +32,7 @@ to the status of `ManagedCluster`.

Here is a `ClusterClaim` example specifying a `id.k8s.io`:

```
```yaml
apiVersion: cluster.open-cluster-management.io/v1alpha1
kind: ClusterClaim
metadata:
Expand All @@ -44,7 +44,7 @@ spec:
After applying the `ClusterClaim` above to any managed cluster, the value of the `ClusterClaim`
is reflected in the `ManagedCluster` on the hub cluster:

```
```yaml
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
metadata: ...
Expand Down
4 changes: 2 additions & 2 deletions content/zh/concepts/managedcluster.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 托管集群
weight: 2
weight: 3
---

<!-- spellchecker-disable -->
Expand Down Expand Up @@ -56,7 +56,7 @@ command-line tool `clusteradm` to manage the whole registration process.
When we're registering a new cluster into OCM, the registration agent will be
starting by creating an unaccepted `ManagedCluster` into the hub cluster along
with a temporary [CertificateSigningRequest (CSR)](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/)
resource. The cluster will be accepted by the hub control plan, if the
resource. The cluster will be accepted by the hub control plane, if the
following requirements is meet:

- The CSR is approved and signed by any certificate provider setting filling
Expand Down
2 changes: 1 addition & 1 deletion content/zh/concepts/managedclusterset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 托管集群分组
weight: 2
weight: 4
---

<!-- spellchecker-disable -->
Expand Down
2 changes: 1 addition & 1 deletion content/zh/concepts/manifestwork.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 资源下发
weight: 2
weight: 6
---

<!-- spellchecker-disable -->
Expand Down
168 changes: 168 additions & 0 deletions content/zh/concepts/manifestworkreplicaset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
title: 资源下发组
weight: 7
---

<!-- spellchecker-disable -->

{{< toc >}}

<!-- spellchecker-enable -->

## What is `ManifestWorkReplicaSet`

`ManifestWorkReplicaSet` is an aggregator API that use [Manifestwork](https://github.com/open-cluster-management-io/open-cluster-management-io.github.io/blob/main/content/en/concepts/manifestwork.md) and [Placement](https://github.com/open-cluster-management-io/open-cluster-management-io.github.io/blob/main/content/en/concepts/placement.md) to create manifeswork for the placement selected clusters.

An example of `ManifestWorkReplicaSet` to deploy a CronJob and Namespace for a group of clusters selected by a placement.

```yaml
apiVersion: work.open-cluster-management.io/v1alpha1
kind: ManifestWorkReplicaSet
metadata:
name: mwrset-cronjob
namespace: ocm-ns
spec:
placementRefs:
- name: placement-byname # Name of a created Placement
manifestWorkTemplate:
deleteOption:
propagationPolicy: SelectivelyOrphan
selectivelyOrphans:
orphaningRules:
- group: ''
name: ocm-ns
namespace: ''
resource: Namespace
manifestConfigs:
- feedbackRules:
- jsonPaths:
- name: lastScheduleTime
path: .status.lastScheduleTime
- name: lastSuccessfulTime
path: .status.lastSuccessfulTime
type: JSONPaths
resourceIdentifier:
group: batch
name: sync-cronjob
namespace: ocm-ns
resource: cronjobs
workload:
manifests:
- kind: Namespace
apiVersion: v1
metadata:
name: ocm-ns
- kind: CronJob
apiVersion: batch/v1
metadata:
name: sync-cronjob
namespace: ocm-ns
spec:
schedule: '* * * * *'
concurrencyPolicy: Allow
suspend: false
jobTemplate:
spec:
backoffLimit: 2
template:
spec:
containers:
- name: hello
image: 'quay.io/prometheus/busybox:latest'
args:
- /bin/sh
- '-c'
- date; echo Hello from the Kubernetes cluster
```
The placement reference must be in the same namespace as the manifestWorkReplicaSet.
## Status tracking
Assuming the used placement reference in the previous example **plcament-byname** has 10 clusters selected. The manifestWorkReplicaSet monitor the Placement selected clusters and create/delete manifestWork for the placement clusters's. The ManifestWorkReplicaSet track the status conditions of the created manifestWorks and report a summery for all manifestWorks status in the manifestWorkReplicaSet status.
The manifestWorkReplicaSet has two status conditions;
1. **PlacementVerified** to verify the placementRefs (not exist or empty cluster selection).
1. **ManifestWorkApplied** to verify all the created manifestWork status conditions (applied, progressing, degraded or available).
Here is an example.
```yaml
apiVersion: work.open-cluster-management.io/v1alpha1
kind: ManifestWorkReplicaSet
metadata:
name: mwrset-cronjob
namespace: ocm-ns
spec:
placementRefs:
- name: placement-byname # Name of a created Placement
manifestWorkTemplate:
...
status:
conditions:
- lastTransitionTime: '2023-04-27T02:30:54Z'
message: ''
reason: AsExpected
status: 'True'
type: PlacementVerified
- lastTransitionTime: '2023-04-27T02:30:54Z'
message: ''
reason: AsExpected
status: 'True'
type: ManifestworkApplied
summary:
applied: 10
available: 10
progressing: 0
degraded: 0
total: 10
```
## Release and Enable Feature
ManifeastWorkReplicaSet is in alpha release and it is not enable by default. In order to enable the ManifeastWorkReplicaSet feature, it has to be enabled in the cluster-manager instance in the hub. Use the following command to edit the cluster-manager CR (custom resource) in the hub cluster.
```shell
$ oc edit ClusterManager cluster-manager
```
Add the workConfiguration field to the cluster-manager CR as below and save.

```yaml
kind: ClusterManager
metadata:
name: cluster-manager
spec:
...
workConfiguration:
featureGates:
- feature: ManifestWorkReplicaSet
mode: Enable
```
In order to assure the ManifestWorkReplicaSet has been enabled successfully check the cluster-manager using the command below
```shell
$ oc get ClusterManager cluster-manager -o yml
```
You should find under the status->generation the cluster-manager-work-controller deployment has been added as below

```yaml
kind: ClusterManager
metadata:
name: cluster-manager
spec:
...
status:
...
generations:
...
- group: apps
lastGeneration: 2
name: cluster-manager-work-webhook
namespace: open-cluster-management-hub
resource: deployments
version: v1
- group: apps
lastGeneration: 1
name: cluster-manager-work-controller
namespace: open-cluster-management-hub
resource: deployments
version: v1
```
Loading

0 comments on commit 0917793

Please sign in to comment.