kcp-dev / contrib-tmc

An experimental add-on readding some Kubernetes compute APIs and impement transparent multi-cluster scheduling
Apache License 2.0
5 stars 3 forks source link

bug: kcp workload cordon & drain command behaves similarly #51

Open kasturinarra opened 1 year ago

kasturinarra commented 1 year ago

Describe the bug

When run kcp workload cordon or kcp workload drain i see that both commands move running workloads to another existing cluster in the same location where as i would expect drain command to move the workloads and cordon command not to move the workloads and do not schedule any more workloads on it once it is cordoned.

Version: kcp version v1.24.3+kcp-v0.10.0

Steps To Reproduce

  1. Add a workspace called lw1 kubectl ws create lw1
  2. Add two synctargets (ocp clusters, built using flexy) called cluster1 & cluster2 using workload sync command kubectl kcp workload sync <cluster_name> --syncer-image=ghcr.io/kcp-dev/kcp/syncer:v0.10.0 -o cluster-syncer.yaml
  3. Apply the syncer.yaml file using the command export KUBECONFIG=<path_to_ocp_cluster_kubeconfig> kubectl apply -f syncer.yaml
  4. Repeat steps 3 &4 and create another synctarget with name cluster2 and add it to kcp
  5. Now create another workspace called ww1 kubectl ws create ww1
  6. Create clusterrole and clusterolebinding if you are running above commands as home user by following steps here https://github.com/kcp-dev/kcp/issues/2597#issuecomment-1380862841
  7. Bind workload workspace to location workspace using the command kubectl kcp bind compute <full_path_lw1_workspace>
  8. Create deployment in the kcp using the command kubectl create deployment kuard --image gcr.io/kuar-demo/kuard-amd64:blue
  9. Check which cluster the deployment gets synced to by running the command on the physical cluster using oc get pods --all-namespaces | grep kuard
  10. Now cordon that cluster where the deployment is synced by running the command kcp workload cordon <cluster_name>
  11. I see that workload as well moves to the other cluster which is not expected

Expected Behaviour

In openshift, drain moves the workloads & cordon does not move workload . Expect similar behavior for kcp as well

Additional Context

No response

mjudeikis commented 11 months ago

/transfer-issue contrib-tmc