Kubernetes serivce: NodePort and ClusterIP in the same service definition

development

#1

Hi All,

I have a Kubernetes service which has 3 ports, all of which are NodePorts. Now, I want to modify that service where 2 ports should be ClusterIPs and 1 port should be NodePort.

Can anybody please suggest the syntax and/or ways that I can accomplish this?

Thanks in advance!

Regards,
Deepthi


#2

@Deepthi_Vishwanath
I think in same service its not possible, you can create 2 different services like external-svc with NodePort and internal-svc with ClusterIP


#3

Yes this method is working. Thank you Sudhakar!