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

Can't tap a service tied to a deployment #14

Open
marcgarciajr opened this issue May 5, 2021 · 1 comment
Open

Can't tap a service tied to a deployment #14

marcgarciajr opened this issue May 5, 2021 · 1 comment

Comments

@marcgarciajr
Copy link

marcgarciajr commented May 5, 2021

Description

The following command
$ kubectl tap on -n mynamepsace -p443 --https myservice
Returns:
Error: error resolving Deployment from Service selectors: the Service selector did not match any Deployments

Screenshots or other information

My service and deployment

Go version:
Kubernetes client version: Major:"1", Minor:"19", GitVersion:"v1.19.0"
Kubernetes server version: Major:"1", Minor:"19", GitVersion:"v1.19.4"

@daxxog
Copy link

daxxog commented Jul 8, 2021

I had the same issue and it turned out I needed to add the same selector I used in my pod spec selector match labels to the deployment labels. Something like this:

 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: my-cool-app
   namespace: my-namespace
+  labels:
+    app: my-cool-app
 spec:
   selector:
     matchLabels:
      app: my-cool-app
   template:
     metadata:
       labels:
         app: my-cool-app
 ...
apiVersion: v1
kind: Service
metadata:
  name: my-cool-app
  namespace: my-namespace
spec:
  selector:
    app: my-cool-app
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants