I have a legacy system (the guy who build it has resigned and can not be contacted). So it is microservice app hosted in GKE. There is one particular service that is quite strange. This is a redis service (as the other pods who use this service via its internal IP address can use the redis service and do the redis PING-PONG). However, I see that there are no pods for this service 0/0. Any idea how this could happen?
The YAML file of the service is below:
I don't see any services, deployments, nor pods called node-1, node-2, nor node-3 in our kubernetes cluster. SO it is quite strange for me. Anyone knows about this?
I have read kubernetes documentation and googled for solutions but I could not find any explanation.
apiVersion: v1
kind: Service
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"kubernetes.io/change-cause":"kubectl apply --record=true --filename=production/svc/dispatchcache-shard-service.yaml"},"name":"dispatchcache-shard","namespace":"default"},"spec":{"ports":[{"name":"node-1","port":7000,"protocol":"TCP","targetPort":7000},{"name":"node-2","port":7001,"protocol":"TCP","targetPort":7000},{"name":"node-3","port":7002,"protocol":"TCP","targetPort":7000}],"type":"ClusterIP"}}
kubernetes.io/change-cause: kubectl apply --record=true --filename=production/svc/dispatchcache-shard-service.yaml
creationTimestamp: 2018-10-03T08:11:41Z
name: dispatchcache-shard
namespace: default
resourceVersion: "297308103"
selfLink: /api/v1/namespaces/default/services/dispatchcache-shard
uid: f55bd4d0-c6e3-11e8-9489-42010af00219
spec:
clusterIP: 10.171.255.152
ports:
- name: node-1
port: 7000
protocol: TCP
targetPort: 7000
- name: node-2
port: 7001
protocol: TCP
targetPort: 7000
- name: node-3
port: 7002
protocol: TCP
targetPort: 7000
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
I expected I could find the pods/deployment/or instances that actually serving the redis service.
You can easily find IPs of pods that are serving this service using this command:
kubectl get endpoints dispatchcache-shard
After that you may find actual pods by IP addresses with this command:
kubectl get pod -o wide
I want to add that there should be very strong reason to define service without label selectors. Not sure this is your case.