Search code examples
kuberneteskubernetes-helmskaffold

Skaffold dev stream logs of pods created by helm hooks


I would like to see the output from my pre-install/post-install helm hooks when using skaffold dev, but this does not seem to work.

Which filters does skaffold use to get all the pods for log tailing? Is there a way to force skaffold to pick up the hooks by applying some labels (e.g. skaffold.dev/run-id: static) ?

Context

Doing dev with local docker, the image building is pretty fast, so for some use cases there is no need to use file sync and special dev-mode container images with file watching inside.

There is this feature request: https://github.com/GoogleContainerTools/skaffold/issues/1441, but this is for adding hooks to skaffold itself.

The pods created by helm hooks are not removed (https://github.com/GoogleContainerTools/skaffold/issues/2876), but this is expected behavior for helm delete.


Solution

  • Thanks @acristu for the question. Skaffold dev here. Currently, skaffold is unaware of pods deployed in the pre and post helm hooks. The reason, we don't parse the manifests in these hooks and hence can't transform those to add the required label skaffold.dev/run-id

    Currently there is no way to force skaffold to pick up the logs from these pods/containers

    That said we had a pending feature request to extend the current log configuration to include resourceType or resourceName like portForward section

    portForward:    #   describes user defined resources to port-forward.
    - resourceType: #   Kubernetes type that should be port forwarded.           
      resourceName:
    

    Supporting this in skaffold would be great idea.