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

No logs from container when using "skaffold dev --kubeconfig k8sconfig" #4925

Closed
Exchizz opened this issue Oct 19, 2020 · 3 comments
Closed
Labels
area/logging kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@Exchizz
Copy link

Exchizz commented Oct 19, 2020

Expected behavior

Skaffold deploys pod and shows stdout from the container

Actual behavior

Skaffold deploys the pod but does not show stdout from the cont

Information

  • Skaffold version: v1.15.0-22-ga549c7a1d-dirty
  • Operating system: Ubuntu 18.04
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta8
kind: Config
build:
  artifacts:
  - image: skaffold-example
deploy:
  kubectl:
    manifests:
      - k8s-*

Steps to reproduce the behavior

  1. Clone skaffold repository
  2. Create "k8sconfig"-file containing cluster different from what you have in ~/.kube/config
  3. Run example "getting-started" using "skaffold dev --kubeconfig k8sconfig"
  4. Note how the image is build and deployed but no output from the container
  5. mv ~/.kube/config ~/.kube/config_bk
  6. mv k8sconfig ~/.kube/config
  7. Run "skaffold dev" and you should get output from the container

From --help:

    --kubeconfig='': Path to the kubeconfig file to use for CLI requests."

So it says --kubeconfig is used when deploying, but I would assume it is also used for getting output from containers ?

I discovered this by inserting the following at pkg/skaffold/kubernetes/watcher.go:79 and noticed it wasn't listing pods from my k8sconfig cluster by from the cluster defined in ~/.kube/config.

pods, _ := kubeclient.CoreV1().Pods("default").List(metav1.ListOptions{
    TimeoutSeconds: &forever,
})
for _, pod := range pods.Items {
    fmt.Println(pod.Name)
}
@MarlonGamez MarlonGamez added area/logging kind/bug Something isn't working triage/discuss Items for discussion labels Oct 21, 2020
@nkubala nkubala added the priority/p1 High impact feature/bug. label Oct 26, 2020
@tejal29
Copy link
Contributor

tejal29 commented Oct 27, 2020

@Exchizz for the investigation.
You could be right.
We have noticed that that --kubecontext flag is not respected in #4477

@MarlonGamez MarlonGamez removed the triage/discuss Items for discussion label Nov 2, 2020
@briandealwis
Copy link
Member

Our local cluster detection doesn't respect --kubeconfig either but this is #4347.

@tejal29 #4477 is different in that we're not validating the provided kube-context and as '' is not matched as a local cluster then builds are happening in the local docker daemon rather than the minikube hosted daemon. In this case, we seem to have code invoking subcommands with --context but not also passing along --kubeconfig.

@briandealwis
Copy link
Member

briandealwis commented Nov 13, 2020

We do invoke kubectl with the configured kube config files, but our update-check is causing our kubernetes configuration to be initialized too early.

Duplicate of #4347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
Development

No branches or pull requests

5 participants