How to Drop Traffic to The Pod Kubernetes

Hi guys, let me share the technique for dropping traffic to the Pod Kubernetes. This is just a note, and maybe you need this if you have the same study case.

The study case is pretty simple, just for dropping the traffic without deleting the Pod in a short time.

  1. Edit your Service manifest, you can use kubectl edit svc yourservice. Ref: https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_edit/
  2. Change the value of selector, save.
  selector:
    app.kubernetes.io/name: givewrongvalueofselector

Done, thanks…