dfc3ad015a
* Chore (dev portal): update learn nav data links (#15515) * Update docs-nav-data.json * Update docs-nav-data.json * website: fixes internal redirects (#15750) * chore: remove duplicate overview item (#15805) * Use `badge` for `<sup>` tags in nav data JSON files (#15928) * Replacing <sup> tags with badge * Adding type and color to badges * fix broken links in vault docs (#15976) * website: Update old learn links to redirect locations (#16047) * update previews to render developer UI * update redirects * adjust content so it is backwards compat Co-authored-by: HashiBot <62622282+hashibot-web@users.noreply.github.com> Co-authored-by: Kendall Strautman <36613477+kendallstrautman@users.noreply.github.com> Co-authored-by: Ashlee M Boyer <43934258+ashleemboyer@users.noreply.github.com>
68 lines
2.1 KiB
Plaintext
68 lines
2.1 KiB
Plaintext
---
|
|
layout: docs
|
|
page_title: Service Registration - Configuration
|
|
description: |-
|
|
The optional `service_registration` stanza configures Vault's mechanism for
|
|
service registration.
|
|
---
|
|
|
|
# `service_registration` Stanza
|
|
|
|
The optional `service_registration` stanza configures Vault's mechanism for
|
|
service registration. The `service_registration` stanza is designed for use cases
|
|
where you would like to use a system like [Consul][consul] for [service
|
|
discovery][consul-discovery], but use a different system for the [storage
|
|
backend][storage-backend].
|
|
|
|
When Consul is configured as the [storage backend][consul-backend], Vault
|
|
implicitly uses Consul for service registration, so the `service_registration` stanza
|
|
is not needed.
|
|
|
|
For times when you would like to use a different storage backend, like
|
|
[Raft][raft-backend], but still have service registration available, the
|
|
`service_registration` stanza can be used:
|
|
|
|
```hcl
|
|
service_registration "consul" {
|
|
address = "127.0.0.1:8500"
|
|
}
|
|
storage "raft" {
|
|
path = "/path/to/raft/data"
|
|
node_id = "raft_node_1"
|
|
}
|
|
```
|
|
|
|
For information about a specific service registration provider, visit the [Consul Service Registration][consul-service-registration] or [Kubernetes Service Registration
|
|
][kubernetes-service-registration] pages.
|
|
|
|
## Configuration
|
|
|
|
Service registration configuration is done through the Vault configuration file
|
|
using the `service_registration` stanza:
|
|
|
|
```hcl
|
|
service_registration [NAME] {
|
|
[PARAMETERS...]
|
|
}
|
|
```
|
|
|
|
For example:
|
|
|
|
```hcl
|
|
service_registration "consul" {
|
|
address = "127.0.0.1:8500"
|
|
}
|
|
```
|
|
|
|
For configuration options which also read an environment variable, the
|
|
environment variable will take precedence over values in the configuration
|
|
file.
|
|
|
|
[consul]: https://www.consul.io/
|
|
[consul-discovery]: https://www.consul.io/
|
|
[storage-backend]: /docs/configuration/storage
|
|
[consul-backend]: /docs/configuration/storage/consul
|
|
[raft-backend]: /docs/configuration/storage/raft
|
|
[consul-service-registration]: /docs/configuration/service-registration/consul
|
|
[kubernetes-service-registration]: /docs/configuration/service-registration/kubernetes
|