open-consul/website/pages/commands/connect/expose.mdx
Jasmine W 8ae3332165
docs: update structure (#8506)
- moved and renamed files/folders based on new structure
- updated docs navigation based on new structure
- moved CLI to top nav (created commands.jsx and commands-navigation.js)
- updated and added redirects
- updating to be consistent with standalone categories
- changing "overview" link in top nav to lead to where intro was moved (docs/intro)
- adding redirects for intro content
- deleting old intro folders
- format all data/navigation files
- deleting old commands folder
- reverting changes to glossary page
- adjust intro navigation for removal of 'vs' paths
- add helm page redirect
- fix more redirects
- add a missing redirect
- fix broken anchor links and formatting mistakes
- deleted duplicate section, added redirect, changed link
- removed duplicate glossary page
2020-09-01 11:14:13 -04:00

72 lines
2.3 KiB
Plaintext

---
layout: commands
page_title: 'Commands: Connect Expose'
sidebar_title: expose
description: >
The connect expose subcommand is used to expose a Connect-enabled service
through an Ingress gateway by modifying the gateway's configuration and adding
an intention to allow traffic from the gateway to the service.
---
# Consul Connect Expose
Command: `consul connect expose`
The connect expose subcommand is used to expose a Connect-enabled service
through an Ingress gateway by modifying the gateway's configuration and adding
an intention to allow traffic from the gateway to the service. See the
[Ingress gateway documentation](/docs/connect/ingress-gateway) for more information
about Ingress gateways.
```text
Usage: consul connect expose [options]
Exposes a Connect-enabled service through the given ingress gateway, using the
given protocol and port.
```
#### API Options
@include 'http_api_options_client.mdx'
@include 'http_api_options_server.mdx'
#### Expose Options
- `-ingress-gateway` - (Required) The name of the ingress gateway service to use.
A namespace can optionally be specified as a prefix via the
'namespace/service' format
- `-port` - (Required) The listener port to use for the service on the Ingress
gateway.
- `-service` - (Required) The name of destination service to expose. A namespace
can optionally be specified as a prefix via the 'namespace/service'
format.
- `-protocol` - The protocol for the service. Defaults to 'tcp'.
- `-host` - Additional DNS hostname to use for routing to this service. Can be
specified multiple times.
## Examples
The example below shows using the `expose` command to make the `foo` service available
through the Ingress gateway service `ingress`. The protocol argument is optional and
defaults to `tcp` if not provided.
```shell-session
$ consul connect expose -service=foo -ingress-gateway=ingress -port 8888 -protocol=tcp
Successfully updated config entry for ingress service "ingress"
Successfully set up intention for "ingress" -> "foo"
```
Running the command again when the config entry/intention are already set up will result
in a no-op:
```shell-session
$ consul connect expose -service=foo -ingress-gateway=ingress -port 8888 -protocol=tcp
Service "foo" already exposed through listener with port 8888
Intention already exists for "ingress" -> "foo"
```