Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Configure ClusterIP Service by Assigning Endpoints

ClusterIP Service without a Selector and Manually Assigned Endpoints

Juniper® Cloud-Native Contrail Networking (CN2) supports the ClusterIP service to work with manually assigned endpoints without adding a selector in the service. ClusterIP is the default type of service, which is used to expose a service on an IP address internal to the cluster. Access is only permitted from within the cluster.

When creating the endpoint for the service, it's important to add the IP address and targetRef in the endpoint. The targetRef should include the pod details such as kind, name, and namespace. Without these details, connectivity to the ClusterIP service will not work.

Pod details provided in the targetRef of the endpoint are used to add the virtual machine interface (VMI) reference of the corresponding pod in the service floating IP (FIP) object.

See the following example of pod details provided in targetRef:

Configure ClusterIP Service

Following is an example procedure to configure ClusterIP service by manually assigning endpoints and without adding a selector.

  1. Deploy the application deployment. In this example, the NGINX application is deployed.
  2. Check the pods.
  3. Deploy the ClusterIP service without defining a selector in spec. In this example, the ClusterIP service maps to port 8080 on the application pod.
  4. Verify the service.
  5. Create the endpoints for the service. Add the IP address and targetRef with pod details in the endpoints.
  6. Check the connectivity to the ClusterIP service from any test pod.