Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Tail logs of all deployed containers #3712

Open
DennisVis opened this issue Feb 20, 2020 · 8 comments
Open

[Feature request] Tail logs of all deployed containers #3712

DennisVis opened this issue Feb 20, 2020 · 8 comments
Labels
area/logging kind/feature-request kind/friction Issues causing user pain that do not have a workaround priority/p2 May take a couple of releases

Comments

@DennisVis
Copy link

For Skaffold to be truly useful as a CI tool it will need to be able to tail the logs of all containers in the deployed cluster.

Say I've written a database integration test for my application. My application is built by Skaffold, the database image is ready made and fetched from docker hub, both are included in a deployment. When running skaffold run in this situation I'll only see my application logs. If the database container crashed I won't be able to see why that happened.

@tejal29
Copy link
Contributor

tejal29 commented Feb 20, 2020

Revive #1911

@tstromberg
Copy link
Contributor

This personally feels a bit like scope-creep to me, but at the same time it sounds like we should provide the necessary duct-tape to piece this together yourself. Leaving open for now.

@tstromberg tstromberg added priority/awaiting-more-evidence Lowest Priority. May be useful, but there is not yet enough supporting evidence. and removed priority/p2 May take a couple of releases labels Apr 30, 2020
@briandealwis
Copy link
Member

I support this request. I use jobs to run checks, and I'm fortunate that the gcr.io/cloud-builders/kubectl image includes a number of useful tools such that I can just script them directly within the job's yaml definition:

apiVersion: batch/v1
kind: Job
metadata:
  name: connect-to-nodejs12
spec:
  ttlSecondsAfterFinished: 10
  backoffLimit: 1
  template:
    spec:
      restartPolicy: Never
      containers:
      - name: verify-nodejs12
        image: gcr.io/cloud-builders/kubectl
        command: [sh, -c, 'sleep 5;
          kubectl port-forward pod/nodejs12pod 9229:9229 &
          sleep 2;
          set -x;
          curl -i localhost:9229/json']

But because I didn't create this as an image, Skaffold doesn't show logs.

Skaffold annotates the actual k8s object — it has a run-id, it has skaffold.dev/tail = true — and it's an image I created, so I'd like Skaffold to log it for me too.

I'd be happy for Skaffold to mark objects with non-built containers as skaffold.dev/tail = false, or even have skaffold.dev/tail be a list of container names to log.

@briandealwis
Copy link
Member

I encounter this somewhat regularly #2303 (review)

@briandealwis
Copy link
Member

A user in #3946 has an initContainer invoking shell scripts using the busybox image whose output is not logged.

@gsquared94
Copy link
Contributor

@briandealwis if you haven't started working on this already, then I can take it up.

@gsquared94 gsquared94 self-assigned this Jul 22, 2020
@gsquared94 gsquared94 added priority/p2 May take a couple of releases and removed priority/awaiting-more-evidence Lowest Priority. May be useful, but there is not yet enough supporting evidence. labels Jul 22, 2020
@gsquared94 gsquared94 assigned dgageot and unassigned gsquared94 Jul 29, 2020
@gsquared94
Copy link
Contributor

Assigning to @dgageot since he's working on #4586

@briandealwis briandealwis added kind/friction Issues causing user pain that do not have a workaround and removed july-chill labels Jul 31, 2020
@nkubala nkubala added this to the Icebox [P2+] milestone Sep 1, 2020
@nkubala nkubala removed this from the Icebox [P2+] milestone May 11, 2021
@aaron-prindle aaron-prindle added this to the v2.3.0 milestone Jan 30, 2023
@aaron-prindle aaron-prindle modified the milestones: v2.3.0, skaffold-backlog Apr 4, 2023
@nathanperkins
Copy link

nathanperkins commented Dec 20, 2024

Similarly, our service deploys an operator, which creates more deployments. The deployments that the operator creates are the most important component in the entire system and we want to be able to see those logs. Otherwise, the skaffold tail logs cease to be useful and we have to go look them up logs in Cloud Logging or similar.

Would love to be able to provide a pod label selector or something to watch for logs from deployments managed outside skaffold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging kind/feature-request kind/friction Issues causing user pain that do not have a workaround priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

9 participants