How do I get the --watch flag to work on OSX command line?

4/18/2020

I'm attempting to watch my Kubernetes deployment spin up by using the kubectl get deploy <name> --watch on the command line on my MacBook. The output just returns the number of seconds that have occurred, but no actual information from the command.

--watch flag output

Is there something I need to be doing differently on OSX to get this command to work? Same results across all terminal programs.

-- James Mundia
kubernetes
macos
posix
terminal

1 Answer

4/19/2020

The function of argument --watch is just watching the status changes like you said. If you want to see the logs of your command and following it, use this command:

kubectl logs -l app=[your_deployment_name] --follow
-- Fauzan
Source: StackOverflow