I have a kubernetes service called staging
that selects all app=jupiter
pods. It exposes an HTTP service on port 1337. Here's the describe output:
$ kubectl describe service staging
Name: staging
Namespace: default
Labels: run=staging
Selector: app=jupiter
Type: NodePort
IP: 10.11.255.80
Port: <unnamed> 1337/TCP
NodePort: <unnamed> 30421/TCP
Endpoints: 10.8.0.21:1337
Session Affinity: None
No events.
But when I run a kubectl rolling-update
on the RC, which removes the 1 pod running the application and adds another, and run describe again, I get:
$ kubectl describe service staging
Name: staging
Namespace: default
Labels: run=staging
Selector: app=jupiter
Type: NodePort
IP: 10.11.255.80
Port: <unnamed> 1337/TCP
NodePort: <unnamed> 30421/TCP
Endpoints: 10.8.0.22:1337
Session Affinity: None
No events.
Everything is the same, except for the Endpoint IP address. In fact, it goes up by 1 every time I do this. This is the one thing I expected not to change, since services are an abstraction over pods, so they shouldn't change when the pods change.
I know you can hardcode the endpoint address, so this is more of a curiosity.
Also, can anyone tell me what the IP
field in the describe output is for?