Reputation: 2195
Suppose in my microservice architecture, I have a microservice that receives API calls, and sends the required RPCs to other microservices in order to respond the calls. Let's call it server
.
In order to be exposed to outside world, I have a NodePort
Service for this microservice named after its name (server
).
Currently I am using RabbitMQ for my inter-service communications, and server
is talking to other microservices via RMQ queues.
Now I want to deploy a service mesh and use gRPC for inter-service communications. So I need to create K8s Service for gRPC port for all of my microservices with their microservice name (including server
). However, the K8s Service with name server
already exists and I need to change the name of that NodePort
in order to be able to create its gRPC Service, but K8s doesn't let me change the Service name. If I delete the NodePort
and create another one with a new name, my application would be down for that couple of seconds.
Final question is, how can I achieve renaming this NodePort
while having my application available to users?
Upvotes: 2
Views: 4978
Reputation: 797
You can do the following:
Create a brand new NodePort service "server-renamed" (with the same selectors and everything as "server")
Change your microservices config to use it and check all is OK
Remove the "server" service and recreate it with the new required specs.
Upvotes: 3