zet

Use watch Instead of -w with Kubernetes

📺 https://youtu.be/IeOJVNAY1Jw

Just use watch and forget -w exists (unless you really need to watch for only manifest changes). Here are the problems with -w:

  1. Buggy and doesn’t refresh well
  2. Doesn’t do what you think it should (only manifest changes)
  3. Not included in other kubectl commands
  4. Not consistent with UNIX philosophy
  5. UNIX watch has been around forever
  6. Requires one-line exec script (no aliases or functions)

Here’s an example of k so that it will work with watch.

#!/bin/sh
exec kubectl "$@"