Service is a central concept in Tanzu Service Mesh. Tanzu Service Mesh provides control and security for services across clusters, clouds, and platforms. A service represents a group of service versions. A service can be accessed through its IP address or port.
A user makes a request to a service, and the service responds to the request by providing requested data or functionality. For example, a user can send a request to a shopping-cart service for information about the items in his or her shopping cart, and the service returns the contents of the shopping cart through the user interface (UI). Requests to a service can also come from other services in your mesh.
Services can be continuously running, ready to respond to requests, or they can be triggered at configured time intervals. For example, a service can be run every hour to back up data or synchronize data with a database.
Tanzu Service Mesh has a broader definition of service than Kubernetes and includes Kubernetes service and other objects, such as Cron jobs and daemon sets.
In Tanzu Service Mesh, service is used with the related concepts service version and service instance. Services, service versions, and service instances form the following conceptional hierarchy:
Service. At the top of the service hierarchy is the abstract concept of service. It represents a distinct functionality exposed as a network service. Requests are made to a service, and the service is then responsible for responding to the request. The service versions and service instances of that destination service are used in processing the request, but are hidden from the request. The service figures out how to fulfill the request through its versions and instances.
Service version. A service can have one or more service versions simultaneously. A service version is an abstract concept that denotes a distinct variant of a service and contains a definition of what the service (its software code) does. For more information about service versions, see the Service Versions section.
Service instance. A service instance is an instance of a service version. Unlike service and service version, service instance is a concrete entity that represents the service code that provides specific functionality or performs a specific operation. For example, a service instance (code) can calculate and return current pricing information in response to a request. For more information about service instances, see the Service Instances section.
Similar concepts used in Kubernetes and other supported platforms are mapped to what service, service version, and service instance are in Tanzu Service Mesh.
Each service is assigned a type to establish its purpose in Tanzu Service Mesh. Service types are used in creating policies and showing metrics for groups of like service types. These are examples of service types:
Job (Cron job)
You can group services by relevant criteria into service groups (a type of resource group) to consistently apply policies to all the services in the group or monitor key performance metrics for the group as a whole. For more information about resource groups, see Resource Groups.
You can also connect services and other resources from two or more clusters into virtual groups called global namespaces to manage their identity, discovery, traffic routing, and security. For more information about global namespaces, see Global Namespaces.
The Tanzu Service Mesh user interface provides all relevant information for you to monitor the behavior and health of all services in your infrastructure.
You can see a summary view of all services and drill down into a specific service to view its details, including the following information:
A summary for that service, including its global namespace, the number of instances, and the platform that the service is running on (for example, Kubernetes)
Service dependencies (the services that this service makes requests to and the services that send requests to the service) visualized in a topology graph
Charts for key performance metrics, including requests per second, requests count, latency metrics, and error and success rates
Summary information about the service instances, including the parent service version, the node and cluster that each instance is running on, and relevant performance metrics
Summary information about the nodes where the service instances are running
You can select to view the information for a specific service version or all service versions collectively.
Service version is an abstract concept that represents a distinct variant of a service. A service version contains a definition of what the service does.
Service version in Tanzu Service Mesh is similar to deployment in Kubernetes.
From time to time, you need to make changes to a service to improve or expand its functionality. To release the updates in your environment, you create new versions of the service. You need to configure an endpoint for each version and deploy the version through your container orchestration system (such as Kubernetes).
Multiple service versions are commonly used in testing scenarios (such as A/B testing) and canary rollouts.
In Tanzu Service Mesh, a combination of a service and a service version can have no instances at a given time. For more details about service instances, see the section Service Instances.
Service instance is a concrete instance of a specific version of service code. Service instances take and respond to requests from other services or users. For example, when a user makes a request to a service for a list of items in his or her shopping cart, appropriate service instances work behind the scenes to process the request and return the requested information.
Service instance in Tanzu Service Mesh is similar to pod in Kubernetes.
You can consider instances of a services to be replicas of that service designed to reduce the load on the service. A load balancer scales up or down the number of instances according to loads on the service.
In your infrastructure, instances of a service can be running on the same or different nodes, in the same or different clusters. For more information about the concepts of cluster and node in Tanzu Service Mesh, see Clusters and Nodes.
You can monitor the current number of service instances running for a service in the Tanzu Service Mesh user interface. From the service instance details page, you can view summary information for the service instance and its key performance metrics, such as request count, latency metrics, and error and success rates.