This document provides instructions on how to discover service endpoints using Kubernetes (K8s) service information. Service discovery enables you to find the endpoints where a given service is available. To know more information about service discovery, see Volterra Service Discovery.
Using the instructions provided in this guide, you can create a discovery object for a Kubernetes cluster and an endpoint for a service using the service name.
The following prerequisites apply:
- Note: If you do not have an account, see Create a VES Account.
- Note: The Kubernetes service should be of type
Volterra enables users to discover existing service endpoints either natively or using external methods. This guide covers service discovery on sites, virtual sites, or virtual networks using Kubernetes service information.
The following figure shows the workflow for creating service discovery with Kubernetes service information:
Discovering services using the Kubernetes service information requires performing the following sequence of actions:
|Create Discovery for External Kubernetes Cluster||Create a service discovery object of type Kubernetes.|
|Create Endpoint with K8s Service Information||Configure endpoint with K8s as the discovery type and associate sites with it.|
Note: The site of discovery object and the endpoint must be the same.
Step: 1 Create a discovery configuration object in the System namespace. Select the
system from the namespace menu. Select
Manage from the configuration menu and
Discovery from the options pane. Click
Add discovery. The discovery object form gets loaded.
Step 2: Enter name, labels, and description in the
Description fields respectively.
Step 3: Select
Kubernetes for the
Type field. Select
Virtual Network or
Virtual Site for the
Virtual site or site or network field and accordingly, select an appropriate object from the
Select ref field. Select
Site Local Network for the
Network Type field.
Network Typefield is not applicable for the
Step 4: Click
Discovery Service Access Information field to open the service access information form. Select
k8s for the
Discovery Service Access Information field and
Kubeconfig for the
Step 5: Click
Kubeconfig to open the kubeconfig information form. Select
Clear Secret for the
Secret Info field and enter the
URL for the secret. Select
EncodingNone for the
Secret Encoding field. Click the
Apply buttons to return the add discovery form.
Note: This example uses
Clear Secretfor the
Secret Info. However, you can use other supported type of secrets available in the drop down menu for the
Step 6: Click the
VIP Publish to load the VIP publish form and select the
VIP publish enable checkbox. Configure the values as per the following guidelines:
DNS delegationfor the
VIP publish methodfield.
KUBE DNSfor the
DNS modefield depending on your external k8s cluster DNS provider.
Step 7: Click the
Apply button to return to the add discovery form and click
Add discovery button to create the discovery object.
Step 1: Select desired namespace or create a namespace.
Step 2: Select
Manage from the configuration menu and
Endpoints from the options pane. Click
Add endpoint form gets loaded.
Step 3: Using your Kubeconfig file, obtain the Kubernetes service or application information from your cluster.
Step 4: Configure endpoint address information as per the following guidelines:
Service infofor the
Service namefor the
Enter your service name in the
Service name field.
Note: Obtain service name from Step 3.
Step 5: Configure where the endpoint should be discovered. Select an appropriate option in the
RefOrSelector field. Click
Select ref. This site or virtual site or virtual network must be same as that of the discovery object created.
Note: Any reference object (site, virtual site, and virtual network) needs to be created and listed before configuring the
RefOrSelectorfield. All the available object list gets displayed on a cascading menu where you can select one or more objects.
Step 9: Enter port and protocol values for the fields
Note: The port must be the service port of the Kubernetes service and not the node port.
With the steps above, you can discover a service endpoint from external Kubernetes providers using ‘Service Info’ on a location specified using the selector. Once the service is discovered, the object can be used with other configuration objects of Volterra platform. For example, you can advertise it across sites in cloud or edge.