Skip to content

Commit

Permalink
Merge pull request #2627 from MingZhang-YBPS/enhance-customresourcein…
Browse files Browse the repository at this point in the history
…terpreter-doc

enhance the doc to give more description about InterpretStatus、InterpretHealth、AggregateStatus
  • Loading branch information
karmada-bot authored Oct 15, 2022
2 parents 78fb5db + abd60aa commit 05be79f
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,41 @@ Check if it is retained successfully.
kubectl --kubeconfig $HOME/.kube/members.config --context member1 get workload nginx --template={{.spec.paused}}
```

> Note: If you want to use `Retain` function in pull mode cluster, you need to deploy interpreter webhook example in this member cluster.
#### InterpretStatus

There is no `Workload` controller deployed on member clusters, so in order to simulate the `Workload` CR handling,
we will manually update `status.readyReplicas` of `Workload` object in member1 cluster to 1.

```bash
kubectl proxy --port=8001 &
curl http://127.0.0.1:8001/apis/workload.example.io/v1alpha1/namespaces/default/workloads/nginx/status -XPATCH -d'{"status":{"readyReplicas": 1}}' -H "Content-Type: application/merge-patch+json
```
Then you can get `ResourceBinding` to check if the `status.aggregatedStatus[x].status` field is interpreted successfully.
```bash
kubectl get rb nginx-workload --kubeconfig $HOME/.kube/karmada.config --context karmada-apiserver -o yaml
```
You can also check the `status.manifestStatuses[x].status` field of Karmada `Work` object in namespace karmada-es-member1.
#### InterpretHealth
You can get `ResourceBinding` to check if the `status.aggregatedStatus[x].health` field is interpreted successfully.
```bash
kubectl get rb nginx-workload --kubeconfig $HOME/.kube/karmada.config --context karmada-apiserver -o yaml
```
You can also check the `status.manifestStatuses[x].health` field of Karmada `Work` object in namespace karmada-es-member1.
#### AggregateStatus
You can check if the `status` field of `Workload` object is aggregated correctly.
```bash
kubectl get workload nginx --kubeconfig $HOME/.kube/karmada.config --context karmada-apiserver -o yaml
```
> Note: If you want to use `Retain`/`InterpretStatus`/`InterpretHealth` function in pull mode cluster, you need to deploy interpreter webhook example in this member cluster.

0 comments on commit 05be79f

Please sign in to comment.