• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Consul
  • Install
  • Tutorials
  • Documentation
  • API
  • CLI
  • Try Cloud(opens in new tab)
  • Sign up
Consul Home

Documentation

Skip to main contentOverview
  • What is Consul?




  • HCP Consul

    • Overview
    • Installation
    • Technical Specifications
    • Upgrades
      • Overview
      • Gateway
      • GatewayClass
      • GatewayClassConfig
      • Routes
      • MeshService

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Consul
  3. Documentation
  4. Consul API Gateway
  5. Configuration
  6. MeshService
  • Consul
  • v1.13.x
  • v1.12.x
  • v1.11.x
  • v1.10.x
  • v1.9.x
  • v1.8.x

ยปMeshService Resource Configuration

This topic provides full details about the MeshService resource.

Introduction

A MeshService is a resource in the Kubernetes cluster that enables Kubernetes configuration models, such as HTTPRoute and TCPRoute, to reference services that only exist in Consul. A MeshService represents a service in the Consul service mesh outside the Kubernetes cluster where Consul API Gateway is deployed. The service represented by the MeshService resource must either be in the same Consul datacenter as the Kubernetes cluster or imported from a peered Consul cluster.

Configuration Model

The following outline shows how to format the configurations in the MeshService object. Click on a property name to view details about the configuration.

  • name: string | required
  • peer: string | optional

Specification

This topic provides details about the configuration parameters.

name

Specifies the name of the service in the Consul service mesh to send traffic to.

  • Type: string
  • Required: required

peer

Specifies the name of the peered Consul cluster that exported the service. If not specified, Consul defaults to the local datacenter.

You must apply a ServiceResolver for the referenced service. The ServiceResolver configuration entry enables Consul to resolve routes to upstream service instances.

  • Type: string
  • Required: optional

Example Configuration

The following example creates a mesh service called example-mesh-service. Routes that use example-mesh-service as a backend route traffic to the Consul service in the local datacenter named echo.

meshservice.yaml
apiVersion: api-gateway.consul.hashicorp.com/v1alpha1
kind: MeshService
metadata:
  name: example-mesh-service
spec:
  name: echo
Edit this page on GitHub

On this page

  1. MeshService Resource Configuration
  2. Introduction
  3. Configuration Model
  4. Specification
  5. Example Configuration
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)