skaffold
skaffold copied to clipboard
skaffold dev log tailing problem: doesn't output to terminal in real time
Expected behavior
Logs are streamed to the terminal line by line in real time.
Actual behavior.
Logs are are streamed to the terminal all at once every ~4 minutes.
Information
- Skaffold version: v1.35.0
- Operating system: macOS Big Sur 11.6 and Linux Ubuntu 20.04 (identical problem on both)
- Installed via: skaffold.dev
- Contents of skaffold.yaml:
apiVersion: skaffold/v2beta26
kind: Config
metadata:
name: hello-app
build:
artifacts:
- image: hello
docker:
dockerfile: Dockerfile
deploy:
kubectl:
manifests:
- k8s.yaml
Steps to reproduce the behavior
- Clone: https://github.com/manocormen/hello-app
- Install skaffold, kubectl, and minikube, and run
minikube start. - Run
skaffold dev
More details
Stack Overflow --- skaffold dev: no output to terminal (or delayed output)
The problem wasn't with Skaffold nor Minikube. Python was buffering the output, and only writing it to stdout once the buffer was full. There are a number of ways to avoid this, including using the -u flag or flush parameter.