Signed-off-by: wei.wei6 <wei.wei6@neolink.com> |
||
|---|---|---|
| .. | ||
| README.md | ||
| guestbook.yaml | ||
| guestbooks-clusterpropagationpolicy.yaml | ||
| guestbooks-crd.yaml | ||
| guestbooks-overridepolicy.yaml | ||
| guestbooks-propagationpolicy.yaml | ||
README.md
Propagate CRD application
The following steps demonstrating how to propagate a Guestbook which is defined by CRD.
Assume you are under the guestbook directory.
cd samples/guestbook
and set the KUBECONFIG environment with Karmada configuration.
export KUBECONFIG=${HOME}/.kube/karmada.config
- Create Guestbook CRD in Karmada
kubectl apply -f guestbooks-crd.yaml
The CRD should be applied to karmada-apiserver.
- Create ClusterPropagationPolicy that will propagate Guestbook CRD to member cluster
kubectl apply -f guestbooks-clusterpropagationpolicy.yaml
The CRD will be propagated to member clusters according to the rules defined in ClusterPropagationPolicy
Note: We can only use ClusterPropagationPolicy not PropagationPolicy here. Please refer to FAQ Difference between PropagationPolicy and ClusterPropagationPolicy for more details.
- Create a Guestbook named
guestbook-samplein Karmada
kubectl apply -f guestbook.yaml
- Create PropagationPolicy that will propagate
guestbook-sampleto member cluster
kubectl apply -f guestbooks-propagationpolicy.yaml
- Check the
guestbook-samplestatus from Karmada
kubectl get guestbook -oyaml
- Create OverridePolicy that will override the size field of guestbook-sample in member cluster
kubectl apply -f guestbooks-overridepolicy.yaml
- Check the size field of
guestbook-samplefrom member cluster
kubectl --kubeconfig=${HOME}/.kube/members.config config use-context member1
kubectl --kubeconfig=${HOME}/.kube/members.config get guestbooks -o yaml
If it works as expected, the .spec.size will be overwritten to 4.