Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

2.Create nginx deployment yaml file.

Create a deployment and name it sentiment. Execute commands as follow:

kubectl --kubeconfig /etc/karmada/karmada-apiserver.config create -f deployment.yaml

3. Create a distribution yaml file,  PropagationPolicy.yaml:

apiVersion: policy.karmada.io/v1alpha1

kind: PropagationPolicy

metadata:

  name: sentiment-propagation

spec:

  resourceSelectors:

    - apiVersion: apps/v1

      kind: Deployment

      name: sentiment

  placement:

    clusterAffinity:

      clusterNames:

        - member1

        - member2

    replicaScheduling:

      replicaDivisionPreference: Weighted

      replicaSchedulingType: Divided

      weightPreference:

        staticWeightList:

          - targetCluster:

              clusterNames:

                - member1

            weight: 1

          - targetCluster:

              clusterNames:

                - member2

            weight: 1

4.Create PropagationPolicy that will propagate distribute sentiment to worker cluster
 We need to create a policy to propagate distribute the deployment to our member worker cluster. Execute commands as follow:

...

7.Retry, Check the deployment status
We can check deployment status, don't need to access member cluster.  Execute commands as follow:

in In worker cluseter,we can see results the result as follow:

Case 2. Rescheduling

...

# get the pod in cluster worker1

$ kubectl --context worker1 get pod

No resources found in default namespace.

# get a list of pods in cluster worker2

$ kubectl --context worker2 get pod

NAME                         READY   STATUS    RESTARTS   AGE

sentiment-6fd4c7867c-hvzfd   1/1     Running   0          6m3s

sentiment-6fd4c7867c-vrmnm   1/1     Running   0          4s




Test Dashboards

N/A


Additional Testing

N/A

Bottlenecks/Errata

...