Open marcgarciajr opened 3 years ago
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
...
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"