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

kubeconfig using server paths does not work with tap #3558

Open
grampelberg opened this issue Oct 10, 2019 · 4 comments

Comments

@grampelberg
Copy link
Member

@grampelberg grampelberg commented Oct 10, 2019

What is the issue?

Given a kubeconfig with clusters[0].cluster.server = https://localhost:8443/k8s/clusters/c-c6rsk, linkerd tap always fails with a 404. The URL being fetched is /apis/tap.linkerd.io/v1alpha1/namespaces/default/deployments/tap and should be /k8s/clusters/c-c6rsk/apis/tap.linkerd.io/v1alpha1/namespaces/default/deployments/tap

How can it be reproduced?

Stand up a rancher cluster with all default settings.

@ihcsim

This comment has been minimized.

Copy link
Member

@ihcsim ihcsim commented Oct 10, 2019

fwiw, I remember helping a user with a similar problem. kubectl proxy won't work if clusters[0].cluster.server = https://<hostname>:<port>/<some-path> where <some-path> needs to be prepended to /apis/tap.linkerd.io/v1alpha1/namespaces/foo. An issue was raised at kubernetes/kubectl#715, as it didn't look like a Linkerd issue.

@grampelberg

This comment has been minimized.

Copy link
Member Author

@grampelberg grampelberg commented Oct 10, 2019

It definitely works for APIServices and kubectl (at least 1.16) as that's how I figured out how it was broken to begin with.

@pietervogelaar

This comment has been minimized.

Copy link

@pietervogelaar pietervogelaar commented Oct 10, 2019

A possible related problem. I have Rancher v2.2.8 and installed a default Kubernetes cluster with Rancher.

With helm 3, I installed linkerd2 edge-19.9.4. Installation works great. After running helm upgrade --install I get:

Release "linkerd" has been upgraded. Happy Helming!
NAME: linkerd
LAST DEPLOYED: Thu Oct 10 17:59:20 2019
NAMESPACE: linkerd
STATUS: deployed
REVISION: 2
NOTES:
The Linkerd control plane was successfully installed 🎉

To help you manage your Linkerd service mesh you can install the Linkerd CLI by running:

  curl -sL https://run.linkerd.io/install | sh

Alternatively, you can download the CLI directly via the Linkerd releases page:

  https://github.com/linkerd/linkerd2/releases/

Looking for more? Visit https://linkerd.io/2/getting-started/

However after this, it never works again. Every time I execute helm upgrade --install I get:

Error: UPGRADE FAILED: could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: tap.linkerd.io/v1alpha1: the server is currently unable to handle the request
@pietervogelaar

This comment has been minimized.

Copy link

@pietervogelaar pietervogelaar commented Oct 24, 2019

This line

url.Path = protohttp.TapReqToURL(req)
must be:

url.Path = path.Join(url.Path, protohttp.TapReqToURL(req))

After that it says:

./bin/go-run cli tap -n ambassador deploy/ambassador --verbose
DEBU[0000] Response from [https://rancher.localdev/k8s/clusters/c-wwnf8/apis/tap.linkerd.io/v1alpha1/watch/namespaces/ambassador/deployments/ambassador/tap] had headers: map[Content-Length:[45] Content-Type:[application/octet-stream] Date:[Thu, 24 Oct 2019 15:45:04 GMT] Linkerd-Error:[Internal Server Error] Server:[openresty/1.15.8.1] Strict-Transport-Security:[max-age=15724800; includeSubDomains]]
Error: no pods found for deployment/ambassador
Usage:
  linkerd tap [flags] (RESOURCE)
...

However kubectl get pods -n ambassador says:

NAME                          READY   STATUS    RESTARTS   AGE
ambassador-589cd96449-7zdns   2/2     Running   0          3h1m
ambassador-589cd96449-l8drp   2/2     Running   0          3h1m
ambassador-589cd96449-v8fzv   2/2     Running   0          3h1m
pietervogelaar added a commit to pietervogelaar/linkerd2 that referenced this issue Oct 25, 2019
…with tap

Signed-off-by: Pieter Vogelaar <pieter@pietervogelaar.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2.7 - Backlog
  
To do
3 participants
You can’t perform that action at this time.