Cluster information:
Kubernetes version:1.14.4
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: CentOS7.6
CNI and version: Calico 3.3.6
CRI and version: Docker 18.09.5
I’v got a svc:
apiVersion: v1
kind: Service
metadata:
labels:
app: service-apollo-admin-server
name: service-apollo-admin-server
namespace: apollo
spec:
ports:
- nodePort: 31346
port: 8090
protocol: TCP
targetPort: 8090
selector:
app: pod-apollo-admin-server
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800
type: NodePort
The label of this svc is “app: service-apollo-admin-server”,
but the selector is “app: pod-apollo-admin-server”.
When performed
kubectl get svc -n apollo --selector=app=pod-apollo-admin-server
There are no resources found.
But
kubectl get svc -n apollo --selector=app=service-apollo-admin-server
gives a result
What I understand is with “–selector=app=pod-apollo-admin-server”, gives the right result.
Is that right?