Skaffold: Skaffold dev - not streamed log to stdout

Created on 6 Feb 2020  路  5Comments  路  Source: GoogleContainerTools/skaffold

Expected behavior

Logs get tailed after skaffold dev|run

Actual behavior

No logs are tailed

Information

  • Skaffold version: version 1.3.1
  • Operating system: MacOS Mojave 10.14.6
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2alpha3
kind: Config
metadata:
  name: skaffold
profiles:
- name: demo
  build:
    artifacts:
    - image: skaffold-demo
      docker:
        dockerfile: Dockerfile
    tagPolicy:
      envTemplate:
        template: "{{.IMAGE_NAME}}:latest"
  deploy:
    kubectl:
      manifests:
      - demo.yaml
  • Contents of demo.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: skaffold-demo
spec:
  selector:
    matchLabels:
      app: skaffold-demo
  replicas: 1
  template:
    metadata:
      labels:
        app: skaffold-demo
    spec:
      containers:
      - name: skaffold-demo
        image: registry.xxx/library/skaffold-demo
        imagePullPolicy: Always

Steps to reproduce the behavior

  1. clone getting-started sample skaffold project
  2. skaffold -p demo dev --status-check
  3. skaffold log with --status-check flag
WARN[0000] image [skaffold-demo] is not used by the deployment 
 - deployment.apps/skaffold-demo configured
Waiting for deployments to stabilize
 - development:deployment/skaffold-demo Waiting for deployment "skaffold-demo" rollout to finish: 1 old replicas are pending termination...
 - development:deployment/skaffold-demo is ready.
Deployments stabilized in 3.092964101s
  1. Pod ran but no log sent to stdout
arelogging arestatus-check kinbug

Most helpful comment

I experiences similar issue where:

  1. the first deployment from skaffold dev streamed the logs to my console
  2. once i changed the code, and it triggers a redeploy, even though the deployment was successful, the log messages no longer appears.

All 5 comments

@tuananh170489 Is the container skaffold-demo a long lived container?
Can you give us the output of kubectl logs <podName> if possible?

Thanks
Tejal

@tuananh170489 Is the container skaffold-demo a long lived container?
Can you give us the output of kubectl logs <podName> if possible?

Thanks
Tejal

Yep, the container still working, but it not stream log to the stdout ~.~
kubectl logs <Podname> still work properly

Log output:
```
Hello world!
Hello world!

I experiences similar issue where:

  1. the first deployment from skaffold dev streamed the logs to my console
  2. once i changed the code, and it triggers a redeploy, even though the deployment was successful, the log messages no longer appears.

I'm going to close this issue because it comes from the deployment.yaml not using the image that was built by Skaffold.

  • Skaffold builds a skaffold-demo image
  • The deployment.yaml should reference that image, not a registry.xxx/library/skaffold-demo image
  • At the end if the build, Skaffold complains that skaffold-demo image is never used.

I'm going to close this issue because it comes from the deployment.yaml not using the image that was built by Skaffold.

  • Skaffold builds a skaffold-demo image
  • The deployment.yaml should reference that image, not a registry.xxx/library/skaffold-demo image
  • At the end if the build, Skaffold complains that skaffold-demo image is never used.

thank for your reply

Was this page helpful?
0 / 5 - 0 ratings