diff --git a/website/pages/docs/acl/acl-legacy.mdx b/website/pages/docs/acl/acl-legacy.mdx index bbf095a172..83331980ee 100644 --- a/website/pages/docs/acl/acl-legacy.mdx +++ b/website/pages/docs/acl/acl-legacy.mdx @@ -10,10 +10,10 @@ description: >- them. It is very similar to AWS IAM in many ways. --- --> **1.3.0 and earlier:** This document only applies in Consul versions 1.3.0 and before. If you are using version 1.4.0 or later please use the updated documentation [here](/docs/acl/acl-system.html) - # ACL System in Legacy Mode +-> **1.3.0 and earlier:** This document only applies in Consul versions 1.3.0 and before. If you are using version 1.4.0 or later please use the updated documentation [here](/docs/acl/acl-system.html) + ~> **Alert: Deprecation Notice** The ACL system described here was Consul's original ACL implementation. In Consul 1.4.0 the ACL system was rewritten and the legacy system was deprecated. The new ACL system information can be found [here](/docs/acl/acl-system.html). @@ -327,7 +327,7 @@ Once the ACL system is bootstrapped, ACL tokens can be managed through the After the servers are restarted above, you will see new errors in the logs of the Consul servers related to permission denied errors: -``` +```text 2017/07/08 23:38:24 [WARN] agent: Node info update blocked by ACLs 2017/07/08 23:38:44 [WARN] agent: Coordinate update blocked by ACLs ``` @@ -381,7 +381,7 @@ $ curl \ With that ACL agent token set, the servers will be able to sync themselves with the catalog: -``` +```text 2017/07/08 23:42:59 [INFO] agent: Synced node info ``` @@ -482,7 +482,7 @@ node-2 127.0.0.2:8301 alive client 0.9.0dev 2 dc1 The anonymous token is also used for DNS lookups since there's no way to pass a token as part of a DNS request. Here's an example lookup for the "consul" service: -``` +```shell $ dig @127.0.0.1 -p 8600 consul.service.consul ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul @@ -524,7 +524,7 @@ $ curl \ With that new policy in place, the DNS lookup will succeed: -``` +```shell $ dig @127.0.0.1 -p 8600 consul.service.consul ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul @@ -1082,9 +1082,7 @@ name that starts with "admin". ## Advanced Topics - - -#### Outages and ACL Replication +#### Outages and ACL Replication ((#replication)) The Consul ACL system is designed with flexible rules to accommodate for an outage of the [`acl_datacenter`](/docs/agent/options.html#acl_datacenter) or networking @@ -1146,9 +1144,7 @@ using a process like this: 4. Rolling restart the agents in other datacenters and change their `acl_datacenter` configuration to the target datacenter. - - -#### Complete ACL Coverage in Consul 0.8 +#### Complete ACL Coverage in Consul 0.8 ((#version_8_acls)) Consul 0.8 added many more ACL policy types and brought ACL enforcement to Consul agents for the first time. To ease the transition to Consul 0.8 for existing ACL diff --git a/website/pages/docs/acl/acl-rules.mdx b/website/pages/docs/acl/acl-rules.mdx index 49325a511b..1bf941b439 100644 --- a/website/pages/docs/acl/acl-rules.mdx +++ b/website/pages/docs/acl/acl-rules.mdx @@ -10,10 +10,10 @@ description: >- them. It is very similar to AWS IAM in many ways. --- --> **1.4.0 and later:** This document only applies in Consul versions 1.4.0 and later. The documentation for the legacy ACL system is [here](/docs/acl/acl-legacy.html) - # ACL Rules +-> **1.4.0 and later:** This document only applies in Consul versions 1.4.0 and later. The documentation for the legacy ACL system is [here](/docs/acl/acl-legacy.html) + Consul provides an optional Access Control List (ACL) system which can be used to control access to data and APIs. To learn more about Consul's ACL review the [ACL system documentation](/docs/acl/acl-system.html) diff --git a/website/pages/docs/acl/acl-system.mdx b/website/pages/docs/acl/acl-system.mdx index c411632589..783127cb7c 100644 --- a/website/pages/docs/acl/acl-system.mdx +++ b/website/pages/docs/acl/acl-system.mdx @@ -10,10 +10,10 @@ description: >- them. It is very similar to AWS IAM in many ways. --- --> **1.4.0 and later:** This guide only applies in Consul versions 1.4.0 and later. The documentation for the legacy ACL system is [here](/docs/acl/acl-legacy.html) - # ACL System +-> **1.4.0 and later:** This guide only applies in Consul versions 1.4.0 and later. The documentation for the legacy ACL system is [here](/docs/acl/acl-legacy.html) + Consul provides an optional Access Control List (ACL) system which can be used to control access to data and APIs. The ACL is [Capability-based](https://en.wikipedia.org/wiki/Capability-based_security), relying on tokens which are associated with policies to determine which fine grained rules can be applied. Consul's capability based @@ -101,7 +101,7 @@ applied as a policy with the following preconfigured [ACL rules](/docs/acl/acl-system.html#acl-rules-and-scope): ```hcl -// Allow the service and its sidecar proxy to register into the catalog. +# Allow the service and its sidecar proxy to register into the catalog. service "" { policy = "write" } @@ -109,7 +109,7 @@ service "-sidecar-proxy" { policy = "write" } -// Allow for any potential upstreams to be resolved. +# Allow for any potential upstreams to be resolved. service_prefix "" { policy = "read" } diff --git a/website/pages/docs/acl/auth-methods/index.mdx b/website/pages/docs/acl/auth-methods/index.mdx index de244d6df3..984c7aae12 100644 --- a/website/pages/docs/acl/auth-methods/index.mdx +++ b/website/pages/docs/acl/auth-methods/index.mdx @@ -9,10 +9,10 @@ description: >- within the local datacenter. --- --> **1.5.0+:** This guide only applies in Consul versions 1.5.0 and newer. - # ACL Auth Methods +-> **1.5.0+:** This guide only applies in Consul versions 1.5.0 and newer. + An auth method is a component in Consul that performs authentication against a trusted external party to authorize the creation of an ACL tokens usable within the local datacenter. diff --git a/website/pages/docs/acl/auth-methods/kubernetes.mdx b/website/pages/docs/acl/auth-methods/kubernetes.mdx index 8c391a4178..336637aff6 100644 --- a/website/pages/docs/acl/auth-methods/kubernetes.mdx +++ b/website/pages/docs/acl/auth-methods/kubernetes.mdx @@ -76,9 +76,9 @@ needs to have access to two Kubernetes APIs: - [**TokenReview**](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#create-tokenreview-v1-authentication-k8s-io) - -> Kubernetes should be running with `--service-account-lookup`. This is - defaulted to true in Kubernetes 1.7, but any versions prior should ensure - the Kubernetes API server is started with this setting. + -> Kubernetes should be running with `--service-account-lookup`. This is + defaulted to true in Kubernetes 1.7, but any versions prior should ensure + the Kubernetes API server is started with this setting. - [**ServiceAccount**](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#read-serviceaccount-v1-core) (`get`) diff --git a/website/pages/docs/agent/checks.mdx b/website/pages/docs/agent/checks.mdx index f260206638..cd62228b29 100644 --- a/website/pages/docs/agent/checks.mdx +++ b/website/pages/docs/agent/checks.mdx @@ -48,7 +48,7 @@ There are several different kinds of checks: blog post](https://www.hashicorp.com/blog/protecting-consul-from-rce-risk-in-specific-configurations) for more details. -- HTTP + Interval - These checks make an HTTP `GET` request to the specified URL, +- `HTTP + Interval` - These checks make an HTTP `GET` request to the specified URL, waiting the specified `interval` amount of time between requests (eg. 30 seconds). The status of the service depends on the HTTP response code: any `2xx` code is considered passing, a `429 Too ManyRequests` is a warning, and anything else is @@ -66,7 +66,7 @@ There are several different kinds of checks: Certificate verification can be turned off by setting the `tls_skip_verify` field to `true` in the check definition. -- TCP + Interval - These checks make a TCP connection attempt to the specified +- `TCP + Interval` - These checks make a TCP connection attempt to the specified IP/hostname and port, waiting `interval` amount of time between attempts (e.g. 30 seconds). If no hostname is specified, it defaults to "localhost". The status of the service depends on @@ -81,7 +81,7 @@ There are several different kinds of checks: It is possible to configure a custom TCP check timeout value by specifying the `timeout` field in the check definition. -- Time to Live (TTL) - These checks retain their last known state +- `Time to Live (TTL)` ((#ttl)) - These checks retain their last known state for a given TTL. The state of the check must be updated periodically over the HTTP interface. If an external system fails to update the status within a given TTL, the check is set to the failed state. This mechanism, conceptually similar to a @@ -95,7 +95,7 @@ There are several different kinds of checks: status of the check across restarts. Persisted check status is valid through the end of the TTL from the time of the last check. -- Docker + Interval - These checks depend on invoking an external application which +- `Docker + Interval` - These checks depend on invoking an external application which is packaged within a Docker Container. The application is triggered within the running container via the Docker Exec API. We expect that the Consul agent user has access to either the Docker HTTP API or the unix socket. Consul uses `$DOCKER_HOST` to @@ -108,7 +108,7 @@ There are several different kinds of checks: must be configured with [`enable_script_checks`](/docs/agent/options.html#_enable_script_checks) set to `true` in order to enable Docker health checks. -- gRPC + Interval - These checks are intended for applications that support the standard +- `gRPC + Interval` - These checks are intended for applications that support the standard [gRPC health checking protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md). The state of the check will be updated by probing the configured endpoint, waiting `interval` amount of time between probes (eg. 30 seconds). By default, gRPC checks will be configured @@ -120,7 +120,7 @@ There are several different kinds of checks: `tls_skip_verify` field to `true` in the check definition. To check on a specific service instead of the whole gRPC server, add the service identifier after the `gRPC` check's endpoint in the following format `/:service_identifier`. -- Alias - These checks alias the health state of another registered +- `Alias` - These checks alias the health state of another registered node or service. The state of the check will be updated asynchronously, but is nearly instant. For aliased services on the same agent, the local state is monitored and no additional network resources are consumed. For other services and nodes, diff --git a/website/pages/docs/agent/config-entries/service-resolver.mdx b/website/pages/docs/agent/config-entries/service-resolver.mdx index c62ce5da74..9cd6b09898 100644 --- a/website/pages/docs/agent/config-entries/service-resolver.mdx +++ b/website/pages/docs/agent/config-entries/service-resolver.mdx @@ -8,10 +8,10 @@ description: >- should satisfy Connect upstream discovery requests for a given service name. --- --> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. - # Service Resolver +-> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. + The `service-resolver` config entry kind controls which service instances should satisfy Connect upstream discovery requests for a given service name. diff --git a/website/pages/docs/agent/config-entries/service-router.mdx b/website/pages/docs/agent/config-entries/service-router.mdx index ff8530ef34..bf28dace82 100644 --- a/website/pages/docs/agent/config-entries/service-router.mdx +++ b/website/pages/docs/agent/config-entries/service-router.mdx @@ -8,10 +8,10 @@ description: >- manipulation at networking layer 7 (e.g. HTTP). --- --> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. - # Service Router +-> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. + The `service-router` config entry kind controls Connect traffic routing and manipulation at networking layer 7 (e.g. HTTP). @@ -158,9 +158,9 @@ routes = [ - `PathRegex` `(string: "")` - Regular expression to match on the HTTP request path. - The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript). + The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript). - At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured. + At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured. - `Header` `(array)` - A set of criteria that can match on HTTP request headers. If more than one is configured all must match @@ -243,8 +243,8 @@ routes = [ - `PrefixRewrite` `(string: "")` - Defines how to rewrite the HTTP request path before proxying it to its final destination. - This requires that either `Match.HTTP.PathPrefix` or - `Match.HTTP.PathExact` be configured on this route. + This requires that either `Match.HTTP.PathPrefix` or + `Match.HTTP.PathExact` be configured on this route. - `RequestTimeout` `(duration: 0s)` - The total amount of time permitted for the entire downstream request (and retries) to be processed. diff --git a/website/pages/docs/agent/config-entries/service-splitter.mdx b/website/pages/docs/agent/config-entries/service-splitter.mdx index 726b24147d..fbf80faaf7 100644 --- a/website/pages/docs/agent/config-entries/service-splitter.mdx +++ b/website/pages/docs/agent/config-entries/service-splitter.mdx @@ -10,10 +10,10 @@ description: >- rewrite or other type of codebase migration). --- --> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. - # Service Splitter +-> **1.6.0+:** This config entry is available in Consul versions 1.6.0 and newer. + The `service-splitter` config entry kind controls how to split incoming Connect requests across different subsets of a single service (like during staged canary rollouts), or perhaps across different services (like during a v2 diff --git a/website/pages/docs/agent/options.mdx b/website/pages/docs/agent/options.mdx index 2810a17201..095723e49b 100644 --- a/website/pages/docs/agent/options.mdx +++ b/website/pages/docs/agent/options.mdx @@ -75,16 +75,14 @@ The options below are all specified on the command-line. client agents, and it allows client agents to be reached at this address when being accessed from a remote datacenter if the remote datacenter is configured with [`translate_wan_addrs`](#translate_wan_addrs). In Consul 1.0 and later this can be set to a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template -- - `-bootstrap` - This flag is used to control if a server - is in "bootstrap" mode. It is important that no more than one server _per_ datacenter +- `-bootstrap` ((#\_bootstrap) - This flag is used to control if a server + is in "bootstrap" mode. It is important that no more than one server **per** datacenter be running in this mode. Technically, a server in bootstrap mode is allowed to self-elect as the Raft leader. It is important that only a single node is in this mode; otherwise, consistency cannot be guaranteed as multiple nodes are able to self-elect. It is not recommended to use this flag after a cluster has been bootstrapped. -- - `-bootstrap-expect` - This flag provides the number +- `-bootstrap-expect` ((#\_bootstrap_expect) - This flag provides the number of expected servers in the datacenter. Either this value should not be provided or the value must agree with other servers in the cluster. When provided, Consul waits until the specified number of servers are available and then bootstraps the @@ -92,8 +90,7 @@ The options below are all specified on the command-line. be used in conjunction with the legacy [`-bootstrap`](#_bootstrap) flag. This flag requires [`-server`](#_server) mode. -- - `-bind` - The address that should be bound to for internal +- `-bind` ((#\_bind) - The address that should be bound to for internal cluster communications. This is an IP address that should be reachable by all other nodes in the cluster. By default, this is "0.0.0.0", meaning Consul will bind to all addresses on the local machine and will [advertise](/docs/agent/options.html#_advertise) @@ -121,16 +118,14 @@ The options below are all specified on the command-line. $ consul agent -bind '{{ GetAllInterfaces | include "name" "^eth" | include "flags" "forwardable|up" | attr "address" }}' ``` -- - `-serf-wan-bind` - The address that should be bound +- `-serf-wan-bind` ((#\_serf_wan_bind)) - The address that should be bound to for Serf WAN gossip communications. By default, the value follows the same rules as [`-bind` command-line flag](#_bind), and if this is not specified, the `-bind` option is used. This is available in Consul 0.7.1 and later. In Consul 1.0 and later this can be set to a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template -- - `-serf-lan-bind` - The address that should be bound +- `-serf-lan-bind` ((#\_serf_lan_bind)) - The address that should be bound to for Serf LAN gossip communications. This is an IP address that should be reachable by all other LAN nodes in the cluster. By default, the value follows the same rules as [`-bind` command-line flag](#_bind), and if this is not specified, the `-bind` @@ -138,22 +133,19 @@ The options below are all specified on the command-line. later this can be set to a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template -- - `-check_output_max_size` - Override the default +- `-check_output_max_size` - Override the default limit of 4k for maximum size of checks, this is a positive value. By limiting this size, it allows to put less pressure on Consul servers when many checks are having a very large output in their checks. In order to completely disable check output capture, it is possible to use [`discard_check_output`](#discard_check_output). -- - `-client` - The address to which Consul will bind client +- `-client` ((#\_client)) - The address to which Consul will bind client interfaces, including the HTTP and DNS servers. By default, this is "127.0.0.1", allowing only loopback connections. In Consul 1.0 and later this can be set to a space-separated list of addresses to bind to, or a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template that can potentially resolve to multiple addresses. -- - `-config-file` - A configuration file to load. For +- `-config-file` ((#\_config_file)) - A configuration file to load. For more information on the format of this file, read the [Configuration Files](#configuration_files) section. This option can be specified multiple times to load multiple configuration files. If it is specified multiple times, configuration files loaded later will @@ -161,8 +153,7 @@ The options below are all specified on the command-line. keys (string, int, bool) will simply have their values replaced while list types will be appended together. -- - `-config-dir` - A directory of configuration files to +- `-config-dir` ((#\_config_dir)) - A directory of configuration files to load. Consul will load all files in this directory with the suffix ".json" or ".hcl". The load order is alphabetical, and the the same merge routine is used as with the [`config-file`](#_config_file) option above. This option can be specified multiple @@ -170,37 +161,27 @@ The options below are all specified on the command-line. not loaded. For more information on the format of the configuration files, see the [Configuration Files](#configuration_files) section. -- - `-config-format` - The format of the configuration +- `-config-format` ((#\_config_format)) - The format of the configuration files to load. Normally, Consul detects the format of the config files from the ".json" or ".hcl" extension. Setting this option to either "json" or "hcl" forces Consul to interpret any file with or without extension to be interpreted in that format. -- - `-data-dir` - This flag provides a data directory for +- `-data-dir` ((#\_data_dir)) - This flag provides a data directory for the agent to store state. This is required for all agents. The directory should be durable across reboots. This is especially critical for agents that are running in server mode as they must be able to persist cluster state. Additionally, the directory must support the use of filesystem locking, meaning some types of mounted folders (e.g. VirtualBox shared folders) may not be suitable. - **Note:** both server - and non-server agents may store ACL tokens in the state in this directory so read - access may grant access to any tokens on servers and to any tokens used during - service registration on non-servers. On Unix-based platforms the files are written - with 0600 permissions so you should ensure only trusted processes can execute as - the same user as Consul. On Windows, you should ensure the directory has suitable - permissions configured as these will be inherited. + **Note:** both server and non-server agents may store ACL tokens in the state in this directory so read access may grant access to any tokens on servers and to any tokens used during service registration on non-servers. On Unix-based platforms the files are written with 0600 permissions so you should ensure only trusted processes can execute as the same user as Consul. On Windows, you should ensure the directory has suitable permissions configured as these will be inherited. -- - `-datacenter` - This flag controls the datacenter in +- `-datacenter` ((#\_datacenter)) - This flag controls the datacenter in which the agent is running. If not provided, it defaults to "dc1". Consul has first-class support for multiple datacenters, but it relies on proper configuration. Nodes in the same datacenter should be on a single LAN. -- - `-dev` - Enable development server mode. This is useful for +- `-dev` ((#\_dev)) - Enable development server mode. This is useful for quickly starting a Consul agent with all persistence options turned off, enabling an in-memory server which can be used for rapid prototyping or developing against the API. In this mode, [Connect is enabled](/docs/connect/configuration.html) and @@ -208,8 +189,7 @@ The options below are all specified on the command-line. intended for production use as it does not write any data to disk. The gRPC port is also defaulted to `8502` in this mode. -- - `-disable-host-node-id` - Setting this to +- `-disable-host-node-id` ((#\_disable_host_node_id)) - Setting this to true will prevent Consul from using information from the host to generate a deterministic node ID, and will instead generate a random node ID which will be persisted in the data directory. This is useful when running multiple Consul agents on the same @@ -220,28 +200,23 @@ The options below are all specified on the command-line. to host-based IDs then Consul and Nomad will use information on the host to automatically assign the same ID in both systems. -- - `-disable-keyring-file` - If set, the keyring +- `-disable-keyring-file` ((#\_disable_keyring_file)) - If set, the keyring will not be persisted to a file. Any installed keys will be lost on shutdown, and only the given `-encrypt` key will be available on startup. This defaults to false. -- - `-dns-port` - the DNS port to listen on. This overrides +- `-dns-port` ((#\_dns_port)) - the DNS port to listen on. This overrides the default port 8600. This is available in Consul 0.7 and later. -- - `-domain` - By default, Consul responds to DNS queries in +- `-domain` ((#\_domain)) - By default, Consul responds to DNS queries in the "consul." domain. This flag can be used to change that domain. All queries in this domain are assumed to be handled by Consul and will not be recursively resolved. -- - `-alt-domain` - This flag allows Consul to respond to +- `-alt-domain` ((#\_alt_domain)) - This flag allows Consul to respond to DNS queries in an alternate domain, in addition to the primary domain. If unset, no alternate domain is used. -- - `-enable-script-checks` This controls whether +- `-enable-script-checks` ((#\_enable_script_checks)) This controls whether [health checks that execute scripts](/docs/agent/checks.html) are enabled on this agent, and defaults to `false` so operators must opt-in to allowing these. This was added in Consul 0.9.0. @@ -252,14 +227,12 @@ The options below are all specified on the command-line. blog post](https://www.hashicorp.com/blog/protecting-consul-from-rce-risk-in-specific-configurations) for more details. -- - `-enable-local-script-checks` +- `-enable-local-script-checks` ((#\_enable_local_script_checks)) Like [`enable_script_checks`](#_enable_script_checks), but only enable them when they are defined in the local configuration files. Script checks defined in HTTP API registrations will still not be allowed. -- - `-encrypt` - Specifies the secret key to use for encryption +- `-encrypt` ((#\_encrypt)) - Specifies the secret key to use for encryption of Consul network traffic. This key must be 32-bytes that are Base64-encoded. The easiest way to create an encryption key is to use [`consul keygen`](/docs/commands/keygen.html). All nodes within a cluster must share the same encryption key to communicate. The @@ -269,24 +242,20 @@ The options below are all specified on the command-line. If it is provided after Consul has been initialized with an encryption key, then the provided key is ignored and a warning will be displayed. -- - `-grpc-port` - the gRPC API port to listen on. Default +- `-grpc-port` ((#\_grpc_port)) - the gRPC API port to listen on. Default -1 (gRPC disabled). See [ports](#ports) documentation for more detail. -- - `-hcl` - A HCL configuration fragment. This HCL configuration +- `-hcl` ((#\_hcl)) - A HCL configuration fragment. This HCL configuration fragment is appended to the configuration and allows to specify the full range of options of a config file on the command line. This option can be specified multiple times. This was added in Consul 1.0. -- - `-http-port` - the HTTP API port to listen on. This overrides +- `-http-port` ((#\_http_port)) - the HTTP API port to listen on. This overrides the default port 8500. This option is very useful when deploying Consul to an environment which communicates the HTTP port through the environment e.g. PaaS like CloudFoundry, allowing you to set the port directly via a Procfile. -- - `-https-port` - the HTTPS API port to listen on. Default +- `-https-port` ((#\_https_port)) - the HTTPS API port to listen on. Default -1 (https disabled). See [ports](#ports) documentation for more detail. - `-log-file` ((#\_log_file)) - writes all the Consul agent log messages @@ -298,47 +267,38 @@ The options below are all specified on the command-line. [`-log-rotate-bytes`](#_log_rotate_bytes) and [-log-rotate-duration](#_log_rotate_duration) for a fine-grained log rotation experience. -- - `-log-rotate-bytes` - to specify the number of +- `-log-rotate-bytes` ((#\_log_rotate_bytes)) - to specify the number of bytes that should be written to a log before it needs to be rotated. Unless specified, there is no limit to the number of bytes that can be written to a log file. -- - `-log-rotate-duration` - to specify the maximum +- `-log-rotate-duration` ((#\_log_rotate_duration)) - to specify the maximum duration a log should be written to before it needs to be rotated. Must be a duration value such as 30s. Defaults to 24h. -- - `-log-rotate-max-files` - to specify the maximum +- `-log-rotate-max-files` ((#\_log_rotate_max_files)) - to specify the maximum number of older log file archives to keep. Defaults to 0 (no files are ever deleted). Set to -1 to discard old log files when a new one is created. -- - `-default-query-time` - This flag controls the +- `-default-query-time` ((#\_default_query_time)) - This flag controls the amount of time a blocking query will wait before Consul will force a response. This value can be overridden by the `wait` query parameter. Note that Consul applies some jitter on top of this time. Defaults to 300s. -- - `-max-query-time` - this flag controls the maximum +- `-max-query-time` ((#\_max_query_time)) - this flag controls the maximum amount of time a blocking query can wait before Consul will force a response. Consul applies jitter to the wait time. The jittered time will be capped to this time. Defaults to 600s. -- - `-join` - Address of another agent to join upon starting up. +- `-join` ((#\_join)) - Address of another agent to join upon starting up. This can be specified multiple times to specify multiple agents to join. If Consul is unable to join with any of the specified addresses, agent startup will fail. - By default, the agent won't join any nodes when it starts up. Note that using [`retry_join`](#retry_join) - could be more appropriate to help mitigate node startup race conditions when automating + By default, the agent won't join any nodes when it starts up. Note that using [`retry_join`](#retry_join) could be more appropriate to help mitigate node startup race conditions when automating a Consul cluster deployment. In Consul 1.1.0 and later this can be set to a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template - - - `-retry-join` - Similar to [`-join`](#_join) but allows retrying a join until it is successful. Once it joins successfully to a member in a list of members it will never attempt to join again. Agents will then solely maintain their @@ -384,17 +344,14 @@ The options below are all specified on the command-line. $ consul agent -retry-join "provider=aws tag_key=..." ``` -- - `-retry-interval` - Time to wait between join attempts. +- `-retry-interval` ((#\_retry_interval)) - Time to wait between join attempts. Defaults to 30s. -- - `-retry-max` - The maximum number of [`-join`](#_join) +- `-retry-max` ((#\_retry_max)) - The maximum number of [`-join`](#_join) attempts to be made before exiting with return code 1. By default, this is set to 0 which is interpreted as infinite retries. -- - `-join-wan` - Address of another wan agent to join upon +- `-join-wan` ((#\_join_wan)) - Address of another wan agent to join upon starting up. This can be specified multiple times to specify multiple WAN agents to join. If Consul is unable to join with any of the specified addresses, agent startup will fail. By default, the agent won't [`-join-wan`](#_join_wan) any nodes @@ -404,8 +361,7 @@ The options below are all specified on the command-line. [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template. -- - `-retry-join-wan` - Similar to [`retry-join`](#_retry_join) +- `-retry-join-wan` ((#\_retry_join_wan)) - Similar to [`retry-join`](#_retry_join) but allows retrying a wan join if the first attempt fails. This is useful for cases where we know the address will become available eventually. As of Consul 0.9.3 [Cloud Auto-Joining](#cloud-auto-joining) is supported as well. @@ -414,31 +370,26 @@ The options below are all specified on the command-line. [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template -- - `-retry-interval-wan` - Time to wait between +- `-retry-interval-wan` ((#\_retry_interval_wan)) - Time to wait between [`-join-wan`](#_join_wan) attempts. Defaults to 30s. - `-retry-max-wan` ((#\_retry_max_wan)) - The maximum number of [`-join-wan`](#_join_wan) attempts to be made before exiting with return code 1. By default, this is set to 0 which is interpreted as infinite retries. -- - `-log-level` - The level of logging to show after the +- `-log-level` ((#\_log_level)) - The level of logging to show after the Consul agent has started. This defaults to "info". The available log levels are "trace", "debug", "info", "warn", and "err". You can always connect to an agent via [`consul monitor`](/docs/commands/monitor.html) and use any log level. Also, the log level can be changed during a config reload. -- - `-log-json` - This flag enables the agent to output logs +- `-log-json` ((#\_log_json)) - This flag enables the agent to output logs in a JSON format. By default this is false. -- - `-node` - The name of this node in the cluster. This must +- `-node` ((#\_node)) - The name of this node in the cluster. This must be unique within the cluster. By default this is the hostname of the machine. -- - `-node-id` - Available in Consul 0.7.3 and later, this +- `-node-id` ((#\_node_id)) - Available in Consul 0.7.3 and later, this is a unique identifier for this node across all time, even if the name of the node or address changes. This must be in the form of a hex string, 36 characters long, such as `adf4238a-882b-9ddc-4a9d-5b6758e4159e`. If this isn't supplied, which is @@ -448,8 +399,7 @@ The options below are all specified on the command-line. node ID if possible, unless [`-disable-host-node-id`](#_disable_host_node_id) is set to true. -- - `-node-meta` - Available in Consul 0.7.3 and later, this +- `-node-meta` ((#\_node_meta)) - Available in Consul 0.7.3 and later, this specifies an arbitrary metadata key/value pair to associate with the node, of the form `key:value`. This can be specified multiple times. Node metadata pairs have the following restrictions: @@ -462,16 +412,12 @@ The options below are all specified on the command-line. - Metadata values for keys beginning with `rfc1035-` are encoded verbatim in DNS TXT requests, otherwise the metadata kv-pair is encoded according [RFC1464](https://www.ietf.org/rfc/rfc1464.txt). -- - `-pid-file` - This flag provides the file path for the +- `-pid-file` ((#\_pid_file)) - This flag provides the file path for the agent to store its PID. This is useful for sending signals (for example, `SIGINT` to close the agent or `SIGHUP` to update check definite -- - `-protocol` - The Consul protocol version to use. Consul - agents speak protocol 2 by default, however agents will automatically use protocol - >2 when speaking to compatible agents. This should be set only when [upgrading](/docs/upgrading.html). - You can view the protocol versions supported by Consul by running `consul -v`. +- `-protocol` ((#\_protocol)) - The Consul protocol version to use. Consul + agents speak protocol 2 by default, however agents will automatically use protocol > 2 when speaking to compatible agents. This should be set only when [upgrading](/docs/upgrading.html). You can view the protocol versions supported by Consul by running `consul -v`. - `-primary-gateway` ((#\_primary_gateway)) - Similar to [`retry-join-wan`](#_retry_join_wan) but allows retrying discovery of fallback addresses for the mesh gateways in the @@ -480,45 +426,35 @@ The options below are all specified on the command-line. is supported as well as [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) templates. This was added in Consul 1.8.x **TODO(wanfed)**. -- - `-raft-protocol` - This controls the internal version +- `-raft-protocol` ((#\_raft_protocol)) - This controls the internal version of the Raft consensus protocol used for server communications. This must be set - to 3 in order to gain access to Autopilot features, with the exception of [`cleanup_dead_servers`](#cleanup_dead_servers). - Defaults to 3 in Consul 1.0.0 and later (defaulted to 2 previously). See [Raft - Protocol Version Compatibility](/docs/upgrade-specific.html#raft-protocol-version-compatibility) - for more details. + to 3 in order to gain access to Autopilot features, with the exception of [`cleanup_dead_servers`](#cleanup_dead_servers). Defaults to 3 in Consul 1.0.0 and later (defaulted to 2 previously). See [Raft Protocol Version Compatibility](/docs/upgrade-specific.html#raft-protocol-version-compatibility) for more details. -- - `-recursor` - Specifies the address of an upstream DNS +- `-recursor` ((#\_recursor)) - Specifies the address of an upstream DNS server. This option may be provided multiple times, and is functionally equivalent to the [`recursors` configuration option](#recursors). -- - `-rejoin` - When provided, Consul will ignore a previous +- `-rejoin` ((#\_rejoin)) - When provided, Consul will ignore a previous leave and attempt to rejoin the cluster when starting. By default, Consul treats leave as a permanent intent and does not attempt to join the cluster again when starting. This flag allows the previous state to be used to rejoin the cluster. -- - `-segment` - (Enterprise-only) This flag is used to set +- `-segment` ((#\_segment)) - (Enterprise-only) This flag is used to set the name of the network segment the agent belongs to. An agent can only join and communicate with other agents within its network segment. See the [Network Segments Guide](https://learn.hashicorp.com/consul/day-2-operations/network-segments) for more details. By default, this is an empty string, which is the default network segment. -- - `-serf-lan-port` - the Serf LAN port to listen on. +- `-serf-lan-port` ((#\_serf_lan_port)) - the Serf LAN port to listen on. This overrides the default Serf LAN port 8301. This is available in Consul 1.2.2 and later. -- - `-serf-wan-port` - the Serf WAN port to listen on. +- `-serf-wan-port` ((#\_serf_wan_port)) - the Serf WAN port to listen on. This overrides the default Serf WAN port 8302. This is available in Consul 1.2.2 and later. -- - `-server` - This flag is used to control if an agent is +- `-server` ((#\_server)) - This flag is used to control if an agent is in server or client mode. When provided, an agent will act as a Consul server. Each Consul cluster must have at least one server and ideally no more than 5 per datacenter. All servers participate in the Raft consensus algorithm to ensure that @@ -528,39 +464,34 @@ The options below are all specified on the command-line. nodes in other datacenters. Servers act as gateways to other datacenters and forward traffic as appropriate. -- - `-server-port` - the server RPC port to listen on. +- `-server-port` ((#\_server_port)) - the server RPC port to listen on. This overrides the default server RPC port 8300. This is available in Consul 1.2.2 and later. -- - `-non-voting-server` - (Enterprise-only) This +- `-non-voting-server` ((#\_non_voting_server)) - (Enterprise-only) This flag is used to make the server not participate in the Raft quorum, and have it only receive the data replication stream. This can be used to add read scalability to a cluster in cases where a high volume of reads to servers are needed. -- - `-syslog` - This flag enables logging to syslog. This is +- `-syslog` ((#\_syslog)) - This flag enables logging to syslog. This is only supported on Linux and OSX. It will result in an error if provided on Windows. -- - `-ui` - Enables the built-in web UI server and the required +- `-ui` ((#\_ui)) - Enables the built-in web UI server and the required HTTP routes. This eliminates the need to maintain the Consul web UI files separately from the binary. -- - `-ui-dir` - This flag provides the directory containing +- `-ui-dir` ((#\_ui_dir)) - This flag provides the directory containing the Web UI resources for Consul. This will automatically enable the Web UI. The directory must be readable to the agent. Starting with Consul version 0.7.0 and later, the Web UI assets are included in the binary so this flag is no longer necessary; specifying only the `-ui` flag is enough to enable the Web UI. Specifying both the '-ui' and '-ui-dir' flags will result in an error. -- - `-ui-content-path` - This flag provides the option + +- `-ui-content-path` ((#\_ui\_content\_path)) - This flag provides the option to change the path the Consul UI loads from and will be displayed in the browser. By default, the path is `/ui/`, for example `http://localhost:8500/ui/`. Only alphanumerics, - `-`, and `_` are allowed in a custom path. `/v1/` is not allowed as it would overwrite + `-`, and `_` are allowed in a custom path.`/v1/` is not allowed as it would overwrite the API endpoint. ## Configuration Files ((#configuration_files)) @@ -642,39 +573,33 @@ duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as '300ms', '-1.5h' or '2h45m'. Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." -- - `acl` - This object allows a number of sub-keys to be set which +- `acl` ((#acl)) - This object allows a number of sub-keys to be set which controls the ACL system. Configuring the ACL system within the ACL stanza was added in Consul 1.4.0 The following sub-keys are available: - - - `enabled` - Enables ACLs. + - `enabled` ((#acl_enabled)) - Enables ACLs. - - - `policy_ttl` - Used to control Time-To-Live caching + - `policy_ttl` ((#acl_policy_ttl)) - Used to control Time-To-Live caching of ACL policies. By default, this is 30 seconds. This setting has a major performance impact: reducing it will cause more frequent refreshes while increasing it reduces the number of refreshes. However, because the caches are not actively invalidated, ACL policy may be stale up to the TTL value. - - - `role_ttl` - Used to control Time-To-Live caching + - `role_ttl` ((#acl_role_ttl)) - Used to control Time-To-Live caching of ACL roles. By default, this is 30 seconds. This setting has a major performance impact: reducing it will cause more frequent refreshes while increasing it reduces the number of refreshes. However, because the caches are not actively invalidated, ACL role may be stale up to the TTL value. - - - `token_ttl` - Used to control Time-To-Live caching + - `token_ttl` ((#acl_token_ttl)) - Used to control Time-To-Live caching of ACL tokens. By default, this is 30 seconds. This setting has a major performance impact: reducing it will cause more frequent refreshes while increasing it reduces the number of refreshes. However, because the caches are not actively invalidated, ACL token may be stale up to the TTL value. - - - `down_policy` - Either "allow", "deny", "extend-cache" + - `down_policy` ((#acl_down_policy)) - Either "allow", "deny", "extend-cache" or "async-cache"; "extend-cache" is the default. In the case that a policy or token cannot be read from the [`primary_datacenter`](#primary_datacenter) or leader node, the down policy is applied. In "allow" mode, all actions are permitted, @@ -685,45 +610,38 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." thus, if latency is bad between the primary and secondary datacenters, latency of operations is not impacted. - - - `default_policy` - Either "allow" or "deny"; + - `default_policy` ((#acl_default_policy)) - Either "allow" or "deny"; defaults to "allow" but this will be changed in a future major release. The default policy controls the behavior of a token when there is no matching rule. In "allow" mode, ACLs are a blacklist: any operation not specifically prohibited is allowed. In "deny" mode, ACLs are a whitelist: any operation not specifically allowed - is blocked. _Note_: this will not take effect until you've enabled ACLs. + is blocked. **Note**: this will not take effect until you've enabled ACLs. - - - `enable_key_list_policy` - Either "enabled" + - `enable_key_list_policy` ((#acl_enable_key_list_policy)) - Either "enabled" or "disabled", defaults to "disabled". When enabled, the `list` permission will be required on the prefix being recursively read from the KV store. Regardless of being enabled, the full set of KV entries under the prefix will be filtered to remove any entries that the request's ACL token does not grant at least read permissions. This option is only available in Consul 1.0 and newer. - - - `enable_token_replication` - By default + - `enable_token_replication` ((#acl_enable_token_replication)) - By default secondary Consul datacenters will perform replication of only ACL policies and roles. Setting this configuration will will enable ACL token replication and allow for the creation of both [local tokens](/api/acl/tokens.html#local) and [auth methods](/docs/acl/acl-auth-methods.html) in connected secondary datacenters. - - - `enable_token_persistence` - Either + - `enable_token_persistence` ((#acl_enable_token_persistence)) - Either `true` or `false`. When `true` tokens set using the API will be persisted to disk and reloaded when an agent restarts. - - - `tokens` - This object holds all of the configured + - `tokens` ((#acl_tokens)) - This object holds all of the configured ACL tokens for the agents usage. - - - `master` - Only used for servers in the [`primary_datacenter`](#primary_datacenter). + - `master` ((#acl_tokens_master)) - Only used for servers in the [`primary_datacenter`](#primary_datacenter). This token will be created with management-level permissions if it does not exist. It allows operators to bootstrap the ACL system with a token Secret ID that is well-known. -
-
+ The `master` token is only installed when a server acquires cluster leadership. If you would like to install or change the `acl_master_token`, set the new value for `master` in the configuration for all servers. Once @@ -733,77 +651,54 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." backwards compatibility and an upgrade path this restriction is not currently enforced but will be in a future major Consul release. - - - `default` - When provided, the agent will + - `default` ((#acl_tokens_default)) - When provided, the agent will use this token when making requests to the Consul servers. Clients can override this token on a per-request basis by providing the "?token" query parameter. When not provided, the empty token, which maps to the 'anonymous' ACL token, is used. - - - `agent` - Used for clients and servers to perform + - `agent` ((#acl_tokens_agent)) - Used for clients and servers to perform internal operations. If this isn't specified, then the - `default` will be used. -
-
+ `default` ((#acl_tokens_default)) will be used. + This token must at least have write access to the node name it will register as in order to set any of the node-level information in the catalog such as metadata, or the node's tagged addresses. - - - `agent_master` - Used to access - agent endpoints - that require agent read or write privileges, or node read privileges, - even if Consul servers aren't present to validate any tokens. This should only - be used by operators during outages, regular ACL tokens should normally be - used by applications. + - `agent_master` ((#acl_tokens_agent_master)) - Used to access [agent endpoints](/api/agent) + that require agent read or write privileges, or node read privileges, even if Consul servers aren't present to validate any tokens. This should only be used by operators during outages, regular ACL tokens should normally be used by applications. - - - `replication` - The ACL token used to + - `replication` ((#acl_tokens_replication)) - The ACL token used to authorize secondary datacenters with the primary datacenter for replication - operations. This token is required for servers outside the [`primary_datacenter`](#primary_datacenter) - when ACLs are enabled. This token may be provided later using the [agent token - API](/api/agent.html#update-acl-tokens) on each server. This token must have - at least "read" permissions on ACL data but if ACL token replication is enabled - then it must have "write" permissions. This also enables Connect replication, - for which the token will require both operator "write" and intention "read" - permissions for replicating CA and Intention data. + operations. This token is required for servers outside the [`primary_datacenter`](#primary_datacenter) when ACLs are enabled. This token may be provided later using the [agent token API](/api/agent.html#update-acl-tokens) on each server. This token must have at least "read" permissions on ACL data but if ACL token replication is enabled then it must have "write" permissions. This also enables Connect replication, for which the token will require both operator "write" and intention "read" permissions for replicating CA and Intention data. - - - - `managed_service_provider` - - **(Enterprise Only)** An array of ACL tokens used by Consul managed - service providers for cluster operations. + - `managed_service_provider` ((#acl_tokens_managed_service_provider)) - **(Enterprise Only)** An + array of ACL tokens used by Consul managed service providers for cluster operations. - ```javascript + ```json "managed_service_provider": [ - { - "accessor_id": "ed22003b-0832-4e48-ac65-31de64e5c2ff", - "secret_id": "cb6be010-bba8-4f30-a9ed-d347128dde17" - } + { + "accessor_id": "ed22003b-0832-4e48-ac65-31de64e5c2ff", + "secret_id": "cb6be010-bba8-4f30-a9ed-d347128dde17" + } ] - ``` + ``` -- - `acl_datacenter` - **This field is deprecated in - Consul 1.4.0. See the [`primary_datacenter`](#primary_datacenter) field instead.** +- `acl_datacenter` - **This field is deprecated in Consul 1.4.0. See the [`primary_datacenter`](#primary_datacenter) field instead.** This designates the datacenter which is authoritative for ACL information. It must be provided to enable ACLs. All servers and datacenters must agree on the ACL datacenter. Setting it on the servers is all you need for cluster-level enforcement, but for the APIs to forward properly from the clients, it must be set on them too. In Consul 0.8 and later, this also enables agent-level enforcement of ACLs. Please see the [ACL Guide](https://learn.hashicorp.com/consul/security-networking/production-acls) for more details. -- - `acl_default_policy` - **Deprecated in - Consul 1.4.0. See the [`acl.default_policy`](#acl_default_policy) field instead.** +- `acl_default_policy` ((#acl_default_policy_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.default_policy`](#acl_default_policy) field instead.** Either "allow" or "deny"; defaults to "allow". The default policy controls the behavior of a token when there is no matching rule. In "allow" mode, ACLs are a blacklist: any operation not specifically prohibited is allowed. In "deny" mode, - ACLs are a whitelist: any operation not specifically allowed is blocked. _Note_: + ACLs are a whitelist: any operation not specifically allowed is blocked. **Note**: this will not take effect until you've set `primary_datacenter` to enable ACL support. -- - `acl_down_policy` - **Deprecated in Consul - 1.4.0. See the [`acl.down_policy`](#acl_down_policy) field instead.**Either "allow", +- `acl_down_policy` ((#acl_down_policy_legacy)) - **Deprecated in Consul + 1.4.0. See the [`acl.down_policy`](#acl_down_policy) field instead.** Either "allow", "deny", "extend-cache" or "async-cache"; "extend-cache" is the default. In the case that the policy for a token cannot be read from the [`primary_datacenter`](#primary_datacenter) or leader node, the down policy is applied. In "allow" mode, all actions are permitted, @@ -814,36 +709,30 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." is bad between ACL authoritative and other datacenters, latency of operations is not impacted. -- - `acl_agent_master_token` - **Deprecated +- `acl_agent_master_token` ((#acl_agent_master_token_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.tokens.agent_master`](#acl_tokens_agent_master) - field instead.** Used to access agent endpoints that + field instead.** Used to access [agent endpoints](/api/agent) that require agent read or write privileges, or node read privileges, even if Consul servers aren't present to validate any tokens. This should only be used by operators during outages, regular ACL tokens should normally be used by applications. This - was added in Consul 0.7.2 and is only used when - `acl_enforce_version_8` is set to true. + was added in Consul 0.7.2 and is only used when [`acl_enforce_version_8`](#acl_enforce_version_8) is set to true. -- - `acl_agent_token` - **Deprecated in Consul +- `acl_agent_token` ((#acl_agent_token_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.tokens.agent`](#acl_tokens_agent) field instead.** Used for clients and servers to perform internal operations. If this isn't specified, then - the - `acl_token` will be used. This was added in Consul 0.7.2. + the [`acl_token`](#acl_token) will be used. This was added in Consul 0.7.2. This token must at least have write access to the node name it will register as in order to set any of the node-level information in the catalog such as metadata, or the node's tagged addresses. -- - `acl_enforce_version_8` - **Deprecated in +- `acl_enforce_version_8` - **Deprecated in Consul 1.4.0** Used for clients and servers to determine if enforcement should occur for new ACL policies being previewed before Consul 0.8. Added in Consul 0.7.2, this defaults to false in versions of Consul prior to 0.8, and defaults to true in Consul 0.8 and later. This helps ease the transition to the new ACL features by allowing policies to be in place before enforcement begins. -* - `acl_master_token` - **Deprecated in Consul +- `acl_master_token` ((#acl_master_token_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.tokens.master`](#acl_tokens_master) field instead.** Only used for servers in the [`primary_datacenter`](#primary_datacenter). This token will be created with management-level permissions if it does not exist. It allows @@ -856,8 +745,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." token. When you provide a value, it can be any string value. Using a UUID would ensure that it looks the same as the other tokens, but isn't strictly necessary. -* - `acl_replication_token` - **Deprecated +- `acl_replication_token` ((#acl_replication_token_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.tokens.replication`](#acl_tokens_replication) field instead.** Only used for servers outside the [`primary_datacenter`](#primary_datacenter) running Consul 0.7 or later. When provided, this will enable [ACL replication](https://learn.hashicorp.com/consul/day-2-operations/acl-replication) @@ -872,27 +760,23 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." [`acl_down_policy`](/docs/agent/options.html#acl_down_policy) is set to "extend-cache", tokens not in the cache can be resolved during the outage using the replicated set of ACLs. -* - `acl_token` - **Deprecated in Consul 1.4.0. See +- `acl_token` ((#acl_token_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.tokens.default`](#acl_tokens_default) field instead.** When provided, the agent will use this token when making requests to the Consul servers. Clients can override this token on a per-request basis by providing the "?token" query parameter. When not provided, the empty token, which maps to the 'anonymous' ACL policy, is used. -* - `acl_ttl` - **Deprecated in Consul 1.4.0. See the +- `acl_ttl` ((#acl_ttl_legacy)) - **Deprecated in Consul 1.4.0. See the [`acl.token_ttl`](#acl_token_ttl) field instead.**Used to control Time-To-Live caching of ACLs. By default, this is 30 seconds. This setting has a major performance impact: reducing it will cause more frequent refreshes while increasing it reduces the number of refreshes. However, because the caches are not actively invalidated, ACL policy may be stale up to the TTL value. -* - `addresses` - This is a nested object that allows setting +- `addresses` - This is a nested object that allows setting bind addresses. In Consul 1.0 and later these can be set to a space-separated list - of addresses to bind to, or a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) - template that can potentially resolve to multiple addresses. + of addresses to bind to, or a [go-sockaddr](https://godoc.org/github.com/hashicorp/go-sockaddr/template) template that can potentially resolve to multiple addresses. `http`, `https` and `grpc` all support binding to a Unix domain socket. A socket can be specified in the form `unix:///path/to/socket`. A new domain @@ -907,7 +791,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." For TCP addresses, the environment variable value should be an IP address _with the port_. For example: `10.0.0.1:8500` and not `10.0.0.1`. However, - ports are set separately in the `ports` structure when + ports are set separately in the `ports` ((#ports)) structure when defining them in a configuration file. The following keys are valid: @@ -917,24 +801,15 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." - `https` - The HTTPS API. Defaults to `client_addr` - `grpc` - The gRPC API. Defaults to `client_addr` -* - `advertise_addr` Equivalent to the [`-advertise` - command-line flag](#_advertise). +- `advertise_addr` Equivalent to the [`-advertise` command-line flag](#_advertise). -* - `serf_wan` Equivalent to the [`-serf-wan-bind` command-line - flag](#_serf_wan_bind). +- `serf_wan` ((#serf_wan_bind)) Equivalent to the [`-serf-wan-bind` command-line flag](#_serf_wan_bind). -* - `serf_lan` Equivalent to the [`-serf-lan-bind` command-line - flag](#_serf_lan_bind). +- `serf_lan` ((#serf_lan_bind)) Equivalent to the [`-serf-lan-bind` command-line flag](#_serf_lan_bind). -* - `advertise_addr_wan` Equivalent to the [`-advertise-wan` - command-line flag](#_advertise-wan). +- `advertise_addr_wan` Equivalent to the [`-advertise-wan` command-line flag](#_advertise-wan). -* - `autopilot` Added in Consul 0.8, this object allows a +- `autopilot` Added in Consul 0.8, this object allows a number of sub-keys to be set which can configure operator-friendly settings for Consul servers. When these keys are provided as configuration, they will only be respected on bootstrapping. If they are not provided, the defaults will be used. @@ -944,58 +819,47 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." The following sub-keys are available: - - - `cleanup_dead_servers` - This controls the + - `cleanup_dead_servers` - This controls the automatic removal of dead server nodes periodically and whenever a new server is added to the cluster. Defaults to `true`. - - - `last_contact_threshold` - Controls the + - `last_contact_threshold` - Controls the maximum amount of time a server can go without contact from the leader before being considered unhealthy. Must be a duration value such as `10s`. Defaults to `200ms`. - - - `max_trailing_logs` - Controls the maximum number + - `max_trailing_logs` - Controls the maximum number of log entries that a server can trail the leader by before being considered unhealthy. Defaults to 250. - - - `min_quorum` - Sets the minimum number of servers necessary + - `min_quorum` - Sets the minimum number of servers necessary in a cluster before autopilot can prune dead servers. There is no default. - - - `server_stabilization_time` - Controls + - `server_stabilization_time` - Controls the minimum amount of time a server must be stable in the 'healthy' state before being added to the cluster. Only takes effect if all servers are running Raft protocol version 3 or higher. Must be a duration value such as `30s`. Defaults to `10s`. - - - `redundancy_zone_tag` - (Enterprise-only) + - `redundancy_zone_tag` - (Enterprise-only) This controls the [`-node-meta`](#_node_meta) key to use when Autopilot is separating servers into zones for redundancy. Only one server in each zone can be a voting member at one time. If left blank (the default), this feature will be disabled. - - - `disable_upgrade_migration` - (Enterprise-only) + - `disable_upgrade_migration` - (Enterprise-only) If set to `true`, this setting will disable Autopilot's upgrade migration strategy in Consul Enterprise of waiting until enough newer-versioned servers have been added to the cluster before promoting any of them to voters. Defaults to `false`. - - - `upgrade_version_tag` - (Enterprise-only) + - `upgrade_version_tag` - (Enterprise-only) The node_meta tag to use for version info when performing upgrade migrations. If this is not set, the Consul version will be used. -* - `auto_encrypt` - This object allows setting options for the `auto_encrypt` feature. +- `auto_encrypt` This object allows setting options for the `auto_encrypt` feature. The following sub-keys are available: - - - `allow_tls` (Defaults to `false`) This option enables + - `allow_tls` (Defaults to `false`) This option enables `auto_encrypt` on the servers and allows them to automatically distribute certificates from the Connect CA to the clients. If enabled, the server can accept incoming connections from both the built-in CA and the Connect CA, as well as their certificates. @@ -1003,8 +867,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." client can verify using the CA it received from `auto_encrypt` endpoint. If disabled, a client configured with `auto_encrypt.tls` will be unable to start. - - - `tls` (Defaults to `false`) Allows the client to request the + - `tls` (Defaults to `false`) Allows the client to request the Connect CA and certificates from the servers, for encrypting RPC communication. The client will make the request to any servers listed in the `-join` or `-retry-join` option. This requires that every server to have `auto_encrypt.allow_tls` enabled. @@ -1020,46 +883,34 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." only with a CA, or finally without a CA and without ACL enabled. In any case, the communication to the `auto_encrypt` endpoint is always TLS encrypted. - - - `dns_san` (Defaults to `[]`) When this option is being + - `dns_san` (Defaults to `[]`) When this option is being used, the certificates requested by `auto_encrypt` from the server have these `dns_san` set as DNS SAN. - - - `ip_san` (Defaults to `[]`) When this option is being used, + - `ip_san` (Defaults to `[]`) When this option is being used, the certificates requested by `auto_encrypt` from the server have these `ip_san` set as IP SAN. -* - `bootstrap` Equivalent to the [`-bootstrap` command-line - flag](#_bootstrap). +- `bootstrap` Equivalent to the [`-bootstrap` command-line flag](#_bootstrap). -* - `bootstrap_expect` Equivalent to the [`-bootstrap-expect` - command-line flag](#_bootstrap_expect). +- `bootstrap_expect` Equivalent to the [`-bootstrap-expect` command-line flag](#_bootstrap_expect). -* - `bind_addr` Equivalent to the [`-bind` command-line flag](#_bind). +- `bind_addr` Equivalent to the [`-bind` command-line flag](#_bind). -* - `ca_file` This provides a file path to a PEM-encoded certificate +- `ca_file` This provides a file path to a PEM-encoded certificate authority. The certificate authority is used to check the authenticity of client and server connections with the appropriate [`verify_incoming`](#verify_incoming) or [`verify_outgoing`](#verify_outgoing) flags. -* - `ca_path` This provides a path to a directory of PEM-encoded +- `ca_path` This provides a path to a directory of PEM-encoded certificate authority files. These certificate authorities are used to check the - authenticity of client and server connections with the appropriate [`verify_incoming`](#verify_incoming) - or [`verify_outgoing`](#verify_outgoing) flags. + authenticity of client and server connections with the appropriate [`verify_incoming`](#verify_incoming) or [`verify_outgoing`](#verify_outgoing) flags. -* - `cert_file` This provides a file path to a PEM-encoded +- `cert_file` This provides a file path to a PEM-encoded certificate. The certificate is provided to clients or servers to verify the agent's authenticity. It must be provided along with [`key_file`](#key_file). -* - `check_update_interval` +- `check_update_interval` ((#check_update_interval)) This interval controls how often check output from checks in a steady state is synchronized with the server. By default, this is set to 5 minutes ("5m"). Many checks which are in a steady state produce slightly different output per run (timestamps, @@ -1068,18 +919,13 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." changes state, the new state and associated output is synchronized immediately. To disable this behavior, set the value to "0s". -* - `client_addr` Equivalent to the [`-client` command-line - flag](#_client). +- `client_addr` Equivalent to the [`-client` command-line flag](#_client). -* - `config_entries` - This object allows setting options for centralized config entries. +- `config_entries` This object allows setting options for centralized config entries. The following sub-keys are available: - - - `bootstrap` + - `bootstrap` ((#config_entries_bootstrap)) This is a list of inlined config entries to insert into the state store when the Consul server gains leadership. This option is only applicable to server nodes. Each bootstrap entry will be created only if it does not exist. When reloading, @@ -1087,32 +933,23 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." See the [configuration entry docs](/docs/agent/config_entries.html) for more details about the contents of each entry. -- - `connect` - This object allows setting options for the Connect feature. +- `connect` This object allows setting options for the Connect feature. The following sub-keys are available: - - - `enabled` Controls whether Connect features are + - `enabled` ((#connect_enabled)) Controls whether Connect features are enabled on this agent. Should be enabled on all clients and servers in the cluster in order for Connect to function properly. Defaults to false. - - - - `enable_mesh_gateway_wan_federation` - - Controls whether cross-datacenter federation traffic between servers is funneled + - `enable_mesh_gateway_wan_federation` ((#connect_enable_mesh_gateway_wan_federation)) Controls whether cross-datacenter federation traffic between servers is funneled through mesh gateways. Defaults to false. This was added in Consul 1.8.x **TODO(wanfed)**. - - - `ca_provider` Controls which CA provider to + - `ca_provider` ((#connect_ca_provider)) Controls which CA provider to use for Connect's CA. Currently only the `consul` and `vault` providers are supported. This is only used when initially bootstrapping the cluster. For an existing cluster, use the [Update CA Configuration Endpoint](/api/connect/ca.html#update-ca-configuration). - - - `ca_config` An object which allows setting different + - `ca_config` ((#connect_ca_config)) An object which allows setting different config options based on the CA provider chosen. This is only used when initially bootstrapping the cluster. For an existing cluster, use the [Update CA Configuration Endpoint](/api/connect/ca.html#update-ca-configuration). @@ -1121,61 +958,48 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." #### Consul CA Provider (`ca_provider = "consul"`) - - - `private_key` The PEM contents of the + - `private_key` ((#consul_ca_private_key)) The PEM contents of the private key to use for the CA. - - - `root_cert` The PEM contents of the root + - `root_cert` ((#consul_ca_root_cert)) The PEM contents of the root certificate to use for the CA. #### Vault CA Provider (`ca_provider = "vault"`) - - - `address` The address of the Vault server to + - `address` ((#vault_ca_address)) The address of the Vault server to connect to. - - - `token` The Vault token to use. + - `token` ((#vault_ca_token)) The Vault token to use. - - - `root_pki_path` The path to use for the root + - `root_pki_path` ((#vault_ca_root_pki)) The path to use for the root CA pki backend in Vault. This can be an existing backend with a CA already configured, or a blank/unmounted backend in which case Connect will automatically mount/generate the CA. The Vault token given above must have `sudo` access to this backend, as well as permission to mount the backend at this path if it is not already mounted. - - - `intermediate_pki_path` - The path to use for the temporary intermediate CA pki backend in Vault. _Connect + - `intermediate_pki_path` ((#vault_ca_intermediate_pki)) + The path to use for the temporary intermediate CA pki backend in Vault. **Connect will overwrite any data at this path in order to generate a temporary intermediate - CA_. The Vault token given above must have `write` access to this backend, + CA**. The Vault token given above must have `write` access to this backend, as well as permission to mount the backend at this path if it is not already mounted. #### Common CA Config Options - {' '} + There are also a number of common configuration options supported by all providers: -

- There are also a number of common configuration options supported by all - providers: -

- - - - `csr_max_concurrent` Sets a limit on how + - `csr_max_concurrent` ((#ca_csr_max_concurrent)) Sets a limit on how many Certificate Signing Requests will be processed concurrently. Defaults to 0 (disabled). This is useful when you have more than one or two cores available to the server. For example on an 8 core server, setting this to 1 will ensure that even during a CA rotation no more than one server core on the leader will be consumed at a time with generating new certificates. Setting this is recommended - _instead_ of `csr_max_per_second` where you know there are multiple cores available + **instead** of `csr_max_per_second` where you know there are multiple cores available since it is simpler to reason about limiting CSR resources this way without artificially slowing down rotations. Added in 1.4.1. - - - `csr_max_per_second` Sets a rate limit + - `csr_max_per_second` ((#ca_csr_max_per_second)) Sets a rate limit on the maximum number of Certificate Signing Requests (CSRs) the servers will accept. This is used to prevent CA rotation from causing unbounded CPU usage on servers. It defaults to 50 which is conservative - a 2017 Macbook can process @@ -1186,8 +1010,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." if servers have more than one core. Setting this to zero disables rate limiting. Added in 1.4.1. - - - `leaf_cert_ttl` The upper bound on the lease + - `leaf_cert_ttl` ((#ca_leaf_cert_ttl)) The upper bound on the lease duration of a leaf certificate issued for a service. In most cases a new leaf certificate will be requested by a proxy before this limit is reached. This is also the effective limit on how long a server outage can last (with no leader) @@ -1200,8 +1023,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." for more than twice the _current_ `leaf_cert_ttl`, it will be removed from the trusted list. - - - `private_key_type` The type of key to generate + - `private_key_type` ((#ca_private_key_type)) The type of key to generate for this CA. This is only used when the provider is generating a new key. If `private_key` is set for the Consul provider, or existing root or intermediate PKI paths given for Vault then this will be ignored. Currently supported options @@ -1226,8 +1048,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." Leaf certificate keys are always EC 256 regardless of the CA configuration. - - - `private_key_bits` The length of key to + - `private_key_bits` ((#ca_private_key_bits)) The length of key to generate for this CA. This is only used when the provider is generating a new key. If `private_key` is set for the Consul provider, or existing root or intermediate PKI paths given for Vault then this will be ignored. @@ -1238,77 +1059,35 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." corresponding to the NIST P-\* curves of the same name. - `private_key_type = rsa`: `2048, 4096` -- - `datacenter` Equivalent to the [`-datacenter` command-line - flag](#_datacenter). +- `datacenter` Equivalent to the [`-datacenter` command-line flag](#_datacenter). -- - `data_dir` Equivalent to the [`-data-dir` command-line - flag](#_data_dir). +- `data_dir` Equivalent to the [`-data-dir` command-line flag](#_data_dir). -- - - `disable_anonymous_signature` - Disables providing an anonymous signature for de-duplication with the update - check. See [`disable_update_check`](#disable_update_check). +- `disable_anonymous_signature` Disables providing an anonymous + signature for de-duplication with the update check. See [`disable_update_check`](#disable_update_check). -- - `disable_host_node_id` - Equivalent to the [`-disable-host-node-id` command-line flag](#_disable_host_node_id). +- `disable_host_node_id` Equivalent to the [`-disable-host-node-id` command-line flag](#_disable_host_node_id). -- - - `disable_http_unprintable_char_filter` - - Defaults to false. Consul 1.0.3 fixed a potential security vulnerability where - malicious users could craft KV keys with unprintable chars that would confuse operators - using the CLI or UI into taking wrong actions. Users who had data written in older - versions of Consul that did not have this restriction will be unable to delete - those values by default in 1.0.3 or later. This setting enables those users to - _temporarily_ disable the filter such that delete operations can work on those - keys again to get back to a healthy state. It is strongly recommended that this - filter is not disabled permanently as it exposes the original security vulnerability. +- `disable_http_unprintable_char_filter` Defaults to false. Consul 1.0.3 fixed a potential security vulnerability where malicious users could craft KV keys with unprintable chars that would confuse operators using the CLI or UI into taking wrong actions. Users who had data written in older versions of Consul that did not have this restriction will be unable to deletethose values by default in 1.0.3 or later. This setting enables those users to **temporarily** disable the filter such that delete operations can work on those keys again to get back to a healthy state. It is strongly recommended that this filter is not disabled permanently as it exposes the original security vulnerability. -- - `disable_remote_exec` - Disables support for remote execution. When set to true, the agent will ignore +- `disable_remote_exec` Disables support for remote execution. When set to true, the agent will ignore any incoming remote exec requests. In versions of Consul prior to 0.8, this defaulted to false. In Consul 0.8 the default was changed to true, to make remote exec opt-in instead of opt-out. -- - `disable_update_check` - Disables automatic checking for security bulletins and new version releases. This - is disabled in Consul Enterprise. +- `disable_update_check` Disables automatic checking for security bulletins and new version releases. This is disabled in Consul Enterprise. -- - `discard_check_output` - Discards the output of health checks before storing them. This reduces the number - of writes to the Consul raft log in environments where health checks have volatile - output like timestamps, process ids, ... +- `discard_check_output` Discards the output of health checks before storing them. This reduces the number of writes to the Consul raft log in environments where health checks have volatile output like timestamps, process ids, ... -- - `discovery_max_stale` - Enables stale requests - for all service discovery HTTP endpoints. This is equivalent to the [`max_stale`](#max_stale) - configuration for DNS requests. If this value is zero (default), all service discovery - HTTP endpoints are forwarded to the leader. If this value is greater than zero, - any Consul server can handle the service discovery request. If a Consul server - is behind the leader by more than `discovery_max_stale`, the query will be re-evaluated - on the leader to get more up-to-date results. Consul agents also add a new `X-Consul-Effective-Consistency` - response header which indicates if the agent did a stale read. `discover-max-stale` - was introduced in Consul 1.0.7 as a way for Consul operators to force stale requests - from clients at the agent level, and defaults to zero which matches default consistency - behavior in earlier Consul versions. +- `discovery_max_stale` - Enables stale requests for all service discovery HTTP endpoints. This is + equivalent to the [`max_stale`](#max_stale) configuration for DNS requests. If this value is zero (default), all service discovery HTTP endpoints are forwarded to the leader. If this value is greater than zero, any Consul server can handle the service discovery request. If a Consul server is behind the leader by more than `discovery_max_stale`, the query will be re-evaluated on the leader to get more up-to-date results. Consul agents also add a new `X-Consul-Effective-Consistency` response header which indicates if the agent did a stale read. `discover-max-stale` was introduced in Consul 1.0.7 as a way for Consul operators to force stale requests from clients at the agent level, and defaults to zero which matches default consistency behavior in earlier Consul versions. -- - `dns_config` This object allows a number of sub-keys - to be set which can tune how DNS queries are serviced. See this guide on [DNS caching](https://learn.hashicorp.com/consul/security-networking/dns-caching) - for more detail. +- `dns_config` This object allows a number of sub-keys + to be set which can tune how DNS queries are serviced. See this guide on [DNS caching](https://learn.hashicorp.com/consul/security-networking/dns-caching) for more detail. The following sub-keys are available: - - - `allow_stale` - Enables a stale query for DNS information. + - `allow_stale` - Enables a stale query for DNS information. This allows any Consul server, rather than only the leader, to service the request. The advantage of this is you get linear read scalability with Consul servers. In versions of Consul prior to 0.7, this defaulted to false, meaning all requests @@ -1316,8 +1095,7 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." and higher latency. In Consul 0.7 and later, this defaults to true for better utilization of available servers. - - - `max_stale` - When [`allow_stale`](#allow_stale) is + - `max_stale` - When [`allow_stale`](#allow_stale) is specified, this is used to limit how stale results are allowed to be. If a Consul server is behind the leader by more than `max_stale`, the query will be re-evaluated on the leader to get more up-to-date results. Prior to Consul 0.7.1 this defaulted @@ -1327,27 +1105,23 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." so this lets Consul continue serving requests in long outage scenarios where no leader can be elected. - - - `node_ttl` - By default, this is "0s", so all node lookups + - `node_ttl` - By default, this is "0s", so all node lookups are served with a 0 TTL value. DNS caching for node lookups can be enabled by setting this value. This should be specified with the "s" suffix for second or "m" for minute. - - - `service_ttl` - This is a sub-object which allows + - `service_ttl` - This is a sub-object which allows for setting a TTL on service lookups with a per-service policy. The "\*" wildcard service can be used when there is no specific policy available for a service. By default, all services are served with a 0 TTL value. DNS caching for service lookups can be enabled by setting this value. - - - `enable_truncate` - If set to true, a UDP DNS + - `enable_truncate` - If set to true, a UDP DNS query that would return more than 3 records, or more than would fit into a valid UDP response, will set the truncated flag, indicating to clients that they should re-query using TCP to get the full set of records. - - - `only_passing` - If set to true, any nodes whose + - `only_passing` - If set to true, any nodes whose health checks are warning or critical will be excluded from DNS results. If false, the default, only nodes whose healthchecks are failing as critical will be excluded. For service lookups, the health checks of the node itself, as well as the service-specific @@ -1355,29 +1129,19 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." then all services on that node will be excluded because they are also considered critical. - - - `recursor_timeout` - Timeout used by Consul when - recursively querying an upstream DNS server. See - `recursors` - - for more details. Default is 2s. This is available in Consul 0.7 and later. + - `recursor_timeout` - Timeout used by Consul when + recursively querying an upstream DNS server. See [`recursors`](#recursors) for more details. Default is 2s. This is available in Consul 0.7 and later. - - - `disable_compression` - If set to true, DNS + - `disable_compression` - If set to true, DNS responses will not be compressed. Compression was added and enabled by default in Consul 0.7. - - - `udp_answer_limit` - Limit the number of resource + - `udp_answer_limit` - Limit the number of resource records contained in the answer section of a UDP-based DNS response. This parameter applies only to UDP DNS queries that are less than 512 bytes. This setting is - deprecated and replaced in Consul 1.0.7 by - `a_record_limit` - - . + deprecated and replaced in Consul 1.0.7 by [`a_record_limit`](#a_record_limit). - - - `a_record_limit` - Limit the number of resource + - `a_record_limit` - Limit the number of resource records contained in the answer section of a A, AAAA or ANY DNS response (both TCP and UDP). When answering a question, Consul will use the complete list of matching hosts, shuffle the list randomly, and then limit the number of answers @@ -1392,81 +1156,61 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." be increasingly uncommon to need to change this value with modern resolvers). - - - - `enable_additional_node_meta_txt` - - When set to true, Consul will add TXT records for Node metadata into the - Additional section of the DNS responses for several query types such as SRV queries. - When set to false those records are not emitted. This does not impact the behavior - of those same TXT records when they would be added to the Answer section of the - response like when querying with type TXT or ANY. This defaults to true. + - `enable_additional_node_meta_txt` - When set to true, Consul + will add TXT records for Node metadata into the Additional section of the DNS responses for several query types such as SRV queries. When set to false those records are not emitted. This does not impact the behavior of those same TXT records when they would be added to the Answer section of the response like when querying with type TXT or ANY. This defaults to true. - - - `soa` Allow to tune the setting set up in SOA. Non specified + - `soa` Allow to tune the setting set up in SOA. Non specified values fallback to their default values, all values are integers and expressed as seconds. -
-
+ The following settings are available: - - - `expire` - Configure SOA Expire duration in seconds, + - `expire` ((#soa_expire)) - Configure SOA Expire duration in seconds, default value is 86400, ie: 24 hours. - - - `min_ttl` - Configure SOA DNS minimum TTL. As explained + - `min_ttl` ((#soa_min_ttl)) - Configure SOA DNS minimum TTL. As explained in [RFC-2308](https://tools.ietf.org/html/rfc2308) this also controls negative cache TTL in most implementations. Default value is 0, ie: no minimum delay or negative TTL. - - - `refresh` - Configure SOA Refresh duration in seconds, + - `refresh` ((#soa_refresh)) - Configure SOA Refresh duration in seconds, default value is `3600`, ie: 1 hour. - - - `retry` - Configures the Retry duration expressed + - `retry` ((#soa_retry)) - Configures the Retry duration expressed in seconds, default value is 600, ie: 10 minutes. - - - `use_cache` - When set to true, DNS resolution will + - `use_cache` ((#dns_use_cache)) - When set to true, DNS resolution will use the agent cache described in [agent caching](/api/features/caching.html). This setting affects all service and prepared queries DNS requests. Implies [`allow_stale`](#allow_stale) - - - `cache_max_age` - When [use_cache](#dns_use_cache) + - `cache_max_age` ((#dns_cache_max_age)) - When [use_cache](#dns_use_cache) is enabled, the agent will attempt to re-fetch the result from the servers if the cached value is older than this duration. See: [agent caching](/api/features/caching.html). - - - `prefer_namespace` - **(Enterprise Only)** + - `prefer_namespace` ((#dns_prefer_namespace)) - **(Enterprise Only)** When set to true, in a DNS query for a service, the label between the domain and the `service` label will be treated as a namespace name instead of a datacenter. When set to false, the default, the behavior will be the same as non-Enterprise versions and will assume the label is the datacenter. See: [this section](/docs/agent/dns.html#namespaced-services-enterprise) for more details. -* `domain` Equivalent to the [`-domain` command-line flag](#_domain). +- `domain` Equivalent to the [`-domain` command-line flag](#_domain). -* `enable_acl_replication` When set on a Consul server, enables ACL replication without having to set +- `enable_acl_replication` When set on a Consul server, enables ACL replication without having to set the replication token via [`acl_replication_token`](#acl_replication_token). Instead, enable ACL replication and then introduce the token using the [agent token API](/api/agent.html#update-acl-tokens) on each server. See [`acl_replication_token`](#acl_replication_token) for more details. -* `enable_agent_tls_for_checks` When set, uses a subset of the agent's TLS configuration (`key_file`, `cert_file`, - `ca_file`, `ca_path`, and `server_name`) to set up the client for HTTP or gRPC health checks. This allows - services requiring 2-way TLS to be checked using the agent's credentials. This was added in Consul 1.0.1 and - defaults to false. +- `enable_agent_tls_for_checks` When set, uses a subset of the agent's TLS configuration (`key_file`, + `cert_file`, `ca_file`, `ca_path`, and `server_name`) to set up the client for HTTP or gRPC health checks. This allows services requiring 2-way TLS to be checked using the agent's credentials. This was added in Consul 1.0.1 and defaults to false. -* `enable_central_service_config` When set, the Consul agent will look for any centralized service configurations - that match a registering service instance. If it finds any, the agent will merge the centralized defaults with - the service instance configuration. This allows for things like service protocol or proxy configuration to be - defined centrally and inherited by any affected service registrations. +- `enable_central_service_config` When set, the Consul agent will look for any centralized service + configurations that match a registering service instance. If it finds any, the agent will merge the centralized defaults with the service instance configuration. This allows for things like service protocol or proxy configuration to be defined centrally and inherited by any affected service registrations. -* `enable_debug` When set, enables some additional debugging features. Currently, this is only used to acces - runtime profiling HTTP endpoints, which are available with an `operator:read` ACL regardless of the value o - `enable_debug`. +- `enable_debug` When set, enables some additional debugging features. Currently, this is only used to + access runtime profiling HTTP endpoints, which are available with an `operator:read` ACL regardless of the value of `enable_debug`. -* `enable_script_checks` Equivalent to the [`-enable-script-checks` command-line flag](#_enable_script_checks). +- `enable_script_checks` Equivalent to the [`-enable-script-checks` command-line flag](#_enable_script_checks). ~> **Security Warning:** Enabling script checks in some configurations may introduce a remote execution vulnerability which is known to be targeted by @@ -1474,72 +1218,62 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." blog post](https://www.hashicorp.com/blog/protecting-consul-from-rce-risk-in-specific-configurations) for more details. -* `enable_local_script_checks` Equivalent to the [`-enable-local-script-checks` command-line flag](#_enable_local_script_checks). +- `enable_local_script_checks` Equivalent to the [`-enable-local-script-checks` command-line flag](#_enable_local_script_checks). -* `enable_syslog` Equivalent to the [`-syslog` command-line flag](#_syslog). +- `enable_syslog` Equivalent to the [`-syslog` command-line flag](#_syslog). -* `encrypt` Equivalent to the [`-encrypt` command-line flag](#_encrypt). +- `encrypt` Equivalent to the [`-encrypt` command-line flag](#_encrypt). -* - `encrypt_verify_incoming` - This is an optional +- `encrypt_verify_incoming` - This is an optional parameter that can be used to disable enforcing encryption for incoming gossip in order to upshift from unencrypted to encrypted gossip on a running cluster. See [this section](/docs/agent/encryption.html#configuring-gossip-encryption-on-an-existing-cluster) for more information. Defaults to true. -* - `encrypt_verify_outgoing` - This is an optional +- `encrypt_verify_outgoing` - This is an optional parameter that can be used to disable enforcing encryption for outgoing gossip in order to upshift from unencrypted to encrypted gossip on a running cluster. See [this section](/docs/agent/encryption.html#configuring-gossip-encryption-on-an-existing-cluster) for more information. Defaults to true. -* - `disable_keyring_file` - Equivalent to the +- `disable_keyring_file` - Equivalent to the [`-disable-keyring-file` command-line flag](#_disable_keyring_file). -* - `gossip_lan` - **(Advanced)** This object contains a +- `gossip_lan` - **(Advanced)** This object contains a number of sub-keys which can be set to tune the LAN gossip communications. These are only provided for users running especially large clusters that need fine tuning and are prepared to spend significant effort correctly tuning them for their environment and workload. **Tuning these improperly can cause Consul to fail in unexpected ways**. The default values are appropriate in almost all deployments. - - - `gossip_nodes` - The number of random nodes to send + - `gossip_nodes` - The number of random nodes to send gossip messages to per gossip_interval. Increasing this number causes the gossip messages to propagate across the cluster more quickly at the expense of increased bandwidth. The default is 3. - - - `gossip_interval` - The interval between sending + - `gossip_interval` - The interval between sending messages that need to be gossiped that haven't been able to piggyback on probing messages. If this is set to zero, non-piggyback gossip is disabled. By lowering this value (more frequent) gossip messages are propagated across the cluster more quickly at the expense of increased bandwidth. The default is 200ms. - - - `probe_interval` - The interval between random + - `probe_interval` - The interval between random node probes. Setting this lower (more frequent) will cause the cluster to detect failed nodes more quickly at the expense of increased bandwidth usage. The default is 1s. - - - `probe_timeout` - The timeout to wait for an ack + - `probe_timeout` - The timeout to wait for an ack from a probed node before assuming it is unhealthy. This should be at least the 99-percentile of RTT (round-trip time) on your network. The default is 500ms and is a conservative value suitable for almost all realistic deployments. - - - `retransmit_mult` - The multiplier for the number + - `retransmit_mult` - The multiplier for the number of retransmissions that are attempted for messages broadcasted over gossip. The number of retransmits is scaled using this multiplier and the cluster size. The higher the multiplier, the more likely a failed broadcast is to converge at the expense of increased bandwidth. The default is 4. - - - `suspicion_mult` - The multiplier for determining + - `suspicion_mult` - The multiplier for determining the time an inaccessible node is considered suspect before declaring it dead. The timeout is scaled with the cluster size and the probe_interval. This allows the timeout to scale properly with expected propagation delay with a larger cluster @@ -1547,48 +1281,41 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." part of the cluster before declaring it dead, giving that suspect node more time to refute if it is indeed still alive. The default is 4. -* - `gossip_wan` - **(Advanced)** This object contains a +- `gossip_wan` - **(Advanced)** This object contains a number of sub-keys which can be set to tune the WAN gossip communications. These are only provided for users running especially large clusters that need fine tuning and are prepared to spend significant effort correctly tuning them for their environment and workload. **Tuning these improperly can cause Consul to fail in unexpected ways**. The default values are appropriate in almost all deployments. - - - `gossip_nodes` - The number of random nodes to send + - `gossip_nodes` - The number of random nodes to send gossip messages to per gossip_interval. Increasing this number causes the gossip messages to propagate across the cluster more quickly at the expense of increased bandwidth. The default is 3. - - - `gossip_interval` - The interval between sending + - `gossip_interval` - The interval between sending messages that need to be gossiped that haven't been able to piggyback on probing messages. If this is set to zero, non-piggyback gossip is disabled. By lowering this value (more frequent) gossip messages are propagated across the cluster more quickly at the expense of increased bandwidth. The default is 200ms. - - - `probe_interval` - The interval between random + - `probe_interval` - The interval between random node probes. Setting this lower (more frequent) will cause the cluster to detect failed nodes more quickly at the expense of increased bandwidth usage. The default is 1s. - - - `probe_timeout` - The timeout to wait for an ack + - `probe_timeout` - The timeout to wait for an ack from a probed node before assuming it is unhealthy. This should be at least the 99-percentile of RTT (round-trip time) on your network. The default is 500ms and is a conservative value suitable for almost all realistic deployments. - - - `retransmit_mult` - The multiplier for the number + - `retransmit_mult` - The multiplier for the number of retransmissions that are attempted for messages broadcasted over gossip. The number of retransmits is scaled using this multiplier and the cluster size. The higher the multiplier, the more likely a failed broadcast is to converge at the expense of increased bandwidth. The default is 4. - - - `suspicion_mult` - The multiplier for determining + - `suspicion_mult` - The multiplier for determining the time an inaccessible node is considered suspect before declaring it dead. The timeout is scaled with the cluster size and the probe_interval. This allows the timeout to scale properly with expected propagation delay with a larger cluster @@ -1596,19 +1323,15 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." part of the cluster before declaring it dead, giving that suspect node more time to refute if it is indeed still alive. The default is 4. -* - `key_file` This provides a the file path to a PEM-encoded +- `key_file` This provides a the file path to a PEM-encoded private key. The key is used with the certificate to verify the agent's authenticity. This must be provided along with [`cert_file`](#cert_file). -* - `http_config` - This object allows setting options for the HTTP API and UI. +- `http_config` This object allows setting options for the HTTP API and UI. The following sub-keys are available: - - - `block_endpoints` + - `block_endpoints` This object is a list of HTTP API endpoint prefixes to block on the agent, and defaults to an empty list, meaning all endpoints are enabled. Any endpoint that has a common prefix with one of the entries on this list will be blocked and @@ -1622,187 +1345,71 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." should be used, but this option is useful for removing access to HTTP API endpoints completely, or on specific agents. This is available in Consul 0.9.0 and later. - - - `response_headers` - This object allows adding headers to the HTTP API and UI responses. For example, - the following config can be used to enable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) - on the HTTP API endpoints: + - `response_headers` This object allows adding headers to the HTTP API and UI responses. For example, the following config can be used to enable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) on the HTTP API endpoints: - ```javascript - { - "http_config": { - "response_headers": { - "Access-Control-Allow-Origin": "*" - } - } - } - ``` + ```json + { + "http_config": { + "response_headers": { + "Access-Control-Allow-Origin": "*" + } + } + } + ``` - - - `allow_write_http_from` - This object is a list of networks in CIDR notation (eg "127.0.0.0/8") that are - allowed to call the agent write endpoints. It defaults to an empty list, which - means all networks are allowed. This is used to make the agent read-only, except - for select ip ranges. - To block write calls from anywhere, use `[ "255.255.255.255/32" - ]`. - To only allow write calls from localhost, use `[ "127.0.0.0/8" ]` - To - only allow specific IPs, use `[ "10.0.0.1/32", "10.0.0.2/32" ]` + - `allow_write_http_from` This object is a list of networks in CIDR notation (eg "127.0.0.0/8") that are allowed to call the agent write endpoints. It defaults to an empty list, which means all networks are allowed. This is used to make the agent read-only, except for select ip ranges. - To block write calls from anywhere, use `[ "255.255.255.255/32" ]`. - To only allow write calls from localhost, use `[ "127.0.0.0/8" ]` - To only allow specific IPs, use `[ "10.0.0.1/32", "10.0.0.2/32" ]` -* - `leave_on_terminate` If enabled, when the agent - receives a TERM signal, it will send a `Leave` message to the rest of the cluster - and gracefully leave. The default behavior for this feature varies based on whether - or not the agent is running as a client or a server (prior to Consul 0.7 the default - value was unconditionally set to `false`). On agents in client-mode, this defaults - to `true` and for agents in server-mode, this defaults to `false`. +- `leave_on_terminate` If enabled, when the agent receives a TERM signal, it will send a `Leave` message to the rest of the cluster and gracefully leave. The default behavior for this feature varies based on whether or not the agent is running as a client or a server (prior to Consul 0.7 the default value was unconditionally set to `false`). On agents in client-mode, this defaults to `true` and for agents in server-mode, this defaults to `false`. -* - `limits` Available in Consul 0.9.3 and later, this is a nested +- `limits` Available in Consul 0.9.3 and later, this is a nested object that configures limits that are enforced by the agent. Prior to Consul 1.5.2, this only applied to agents in client mode, not Consul servers. The following parameters are available: - - - `http_max_conns_per_client` - Configures - a limit of how many concurrent TCP connections a single client IP address is - allowed to open to the agent's HTTP(S) server. This affects the HTTP(S) servers - in both client and server agents. Default value is `200`. - - - `https_handshake_timeout` - Configures - the limit for how long the HTTPS server in both client and server agents will - wait for a client to complete a TLS handshake. This should be kept conservative - as it limits how many connections an unauthenticated attacker can open if `verify_incoming` - is being using to authenticate clients (strongly recommended in production). - Default value is `5s`. - - - `rpc_handshake_timeout` - Configures the - limit for how long servers will wait after a client TCP connection is established - before they complete the connection handshake. When TLS is used, the same timeout - applies to the TLS handshake separately from the initial protocol negotiation. - All Consul clients should perform this immediately on establishing a new connection. - This should be kept conservative as it limits how many connections an unauthenticated - attacker can open if `verify_incoming` is being using to authenticate clients - (strongly recommended in production). When `verify_incoming` is true on servers, - this limits how long the connection socket and associated goroutines will be - held open before the client successfully authenticates. Default value is `5s`. - - - `rpc_max_conns_per_client` - Configures - a limit of how many concurrent TCP connections a single source IP address is - allowed to open to a single server. It affects both clients connections and other - server connections. In general Consul clients multiplex many RPC calls over a - single TCP connection so this can typically be kept low. It needs to be more - than one though since servers open at least one additional connection for raft - RPC, possibly more for WAN federation when using network areas, and snapshot - requests from clients run over a separate TCP conn. A reasonably low limit significantly - reduces the ability of an unauthenticated attacker to consume unbounded resources - by holding open many connections. You may need to increase this if WAN federated - servers connect via proxies or NAT gateways or similar causing many legitimate - connections from a single source IP. Default value is `100` which is designed - to be extremely conservative to limit issues with certain deployment patterns. - Most deployments can probably reduce this safely. 100 connections on modern server - hardware should not cause a significant impact on resource usage from an unauthenticated - attacker though. - - - `rpc_rate` - Configures the RPC rate limiter on Consul - _clients_ by setting the maximum request rate that this agent is allowed to make - for RPC requests to Consul servers, in requests per second. Defaults to infinite, - which disables rate limiting. - - - `rpc_max_burst` - The size of the token bucket used - to recharge the RPC rate limiter on Consul _clients_ . Defaults to 1000 tokens, - and each token is good for a single RPC call to a Consul server. See https://en.wikipedia.org/wiki/Token_bucket - for more details about how token bucket rate limiters operate. - - - `kv_max_value_size` - **(Advanced)** Configures - the maximum number of bytes for a kv request body to the [`/v1/kv`](/api/kv.html) - endpoint. This limit defaults to [raft's](https://github.com/hashicorp/raft) - suggested max size(512KB). **Note that tuning these improperly can cause Consul - to fail in unexpected ways**, it may potentially affect leadership stability - and prevent timely heartbeat signals by increasing RPC IO duration. This option - affects the txn endpoint too, but Consul 1.7.2 introduced `txn_max_req_len` which - is the preferred way to set the limit for the txn endpoint. If both limits are - set, the higher one takes precedence. - - - `txn_max_req_len` - **(Advanced)** Configures - the maximum number of bytes for a transaction request body to the [`/v1/txn`](/api/txn.html) - endpoint. This limit defaults to [raft's](https://github.com/hashicorp/raft) - suggested max size(512KB). **Note that tuning these improperly can cause Consul - to fail in unexpected ways**, it may potentially affect leadership stability - and prevent timely heartbeat signals by increasing RPC IO duration. + - `http_max_conns_per_client` - Configures a limit of how many concurrent TCP connections a single client IP address is allowed to open to the agent's HTTP(S) server. This affects the HTTP(S) servers in both client and server agents. Default value is `200`. + - `https_handshake_timeout` - Configures the limit for how long the HTTPS server in both client and server agents will wait for a client to complete a TLS handshake. This should be kept conservative as it limits how many connections an unauthenticated attacker can open if `verify_incoming` is being using to authenticate clients (strongly recommended in production). Default value is `5s`. + - `rpc_handshake_timeout` - Configures the limit for how long servers will wait after a client TCP connection is established before they complete the connection handshake. When TLS is used, the same timeout applies to the TLS handshake separately from the initial protocol negotiation. All Consul clients should perform this immediately on establishing a new connection. This should be kept conservative as it limits how many connections an unauthenticated attacker can open if `verify_incoming` is being using to authenticate clients (strongly recommended in production). When `verify_incoming` is true on servers, this limits how long the connection socket and associated goroutines will be held open before the client successfully authenticates. Default value is `5s`. + - `rpc_max_conns_per_client` - Configures a limit of how many concurrent TCP connections a single source IP address is allowed to open to a single server. It affects both clients connections and other server connections. In general Consul clients multiplex many RPC calls over a single TCP connection so this can typically be kept low. It needs to be more than one though since servers open at least one additional connection for raft RPC, possibly more for WAN federation when using network areas, and snapshot requests from clients run over a separate TCP conn. A reasonably low limit significantly reduces the ability of an unauthenticated attacker to consume unbounded resources by holding open many connections. You may need to increase this if WAN federated servers connect via proxies or NAT gateways or similar causing many legitimate connections from a single source IP. Default value is `100` which is designed to be extremely conservative to limit issues with certain deployment patterns. Most deployments can probably reduce this safely. 100 connections on modern server hardware should not cause a significant impact on resource usage from an unauthenticated attacker though. + - `rpc_rate` - Configures the RPC rate limiter on Consul _clients_ by setting the maximum request rate that this agent is allowed to make for RPC requests to Consul servers, in requests per second. Defaults to infinite, which disables rate limiting. + - `rpc_max_burst` - The size of the token bucket used to recharge the RPC rate limiter on Consul _clients_. Defaults to 1000 tokens, and each token is good for a single RPC call to a Consul server. See https://en.wikipedia.org/wiki/Token_bucket for more details about how token bucket rate limiters operate. + - `kv_max_value_size` - **(Advanced)** Configures the maximum number of bytes for a kv request body to the [`/v1/kv`](/api/kv.html) endpoint. This limit defaults to [raft's](https://github.com/hashicorp/raft) suggested max size (512KB). **Note that tuning these improperly can cause Consul to fail in unexpected ways**, it may potentially affect leadership stability and prevent timely heartbeat signals by increasing RPC IO duration. This option affects the txn endpoint too, but Consul 1.7.2 introduced `txn_max_req_len` which is the preferred way to set the limit for the txn endpoint. If both limits are set, the higher one takes precedence. + - `txn_max_req_len` - **(Advanced)** Configures the maximum number of bytes for a transaction request body to the [`/v1/txn`](/api/txn.html) endpoint. This limit defaults to [raft's](https://github.com/hashicorp/raft) suggested max size (512KB). **Note that tuning these improperly can cause Consul to fail in unexpected ways**, it may potentially affect leadership stability and prevent timely heartbeat signals by increasing RPC IO duration. -* - `log_file` Equivalent to the [`-log-file` command-line - flag](#_log_file). +- `log_file` Equivalent to the [`-log-file` command-line flag](#_log_file). -* - `log_rotate_duration` Equivalent to the [`-log-rotate-duration` - command-line flag](#_log_rotate_duration). +- `log_rotate_duration` Equivalent to the [`-log-rotate-duration` command-line flag](#_log_rotate_duration). -* - `log_rotate_bytes` Equivalent to the [`-log-rotate-bytes` - command-line flag](#_log_rotate_bytes). +- `log_rotate_bytes` Equivalent to the [`-log-rotate-bytes` command-line flag](#_log_rotate_bytes). -* - `log_rotate_max_files` Equivalent to the [`-log-rotate-max-files` - command-line flag](#_log_rotate_max_files). +- `log_rotate_max_files` Equivalent to the [`-log-rotate-max-files` command-line flag](#_log_rotate_max_files). -* - `log_level` Equivalent to the [`-log-level` command-line - flag](#_log_level). +- `log_level` Equivalent to the [`-log-level` command-line flag](#_log_level). -* - `log_json` Equivalent to the [`-log-json` command-line - flag](#_log_json). +- `log_json` Equivalent to the [`-log-json` command-line flag](#_log_json). -* - `default_query_time` - Equivalent to the [`-default-query-time` command-line flag](#_default_query_time). +- `default_query_time` Equivalent to the [`-default-query-time` command-line flag](#_default_query_time). -* - `max_query_time` - Equivalent to the [`-max-query-time` command-line flag](#_max_query_time). +- `max_query_time` Equivalent to the [`-max-query-time` command-line flag](#_max_query_time). -* - `node_id` Equivalent to the [`-node-id` command-line flag](#_node_id). +- `node_id` Equivalent to the [`-node-id` command-line flag](#_node_id). -* - `node_name` Equivalent to the [`-node` command-line flag](#_node). +- `node_name` Equivalent to the [`-node` command-line flag](#_node). -* - `node_meta` Available in Consul 0.7.3 and later, This - object allows associating arbitrary metadata key/value pairs with the local node, - which can then be used for filtering results from certain catalog endpoints. See - the [`-node-meta` command-line flag](#_node_meta) for more information. +- `node_meta` Available in Consul 0.7.3 and later, This object allows associating arbitrary metadata key/value pairs with the local node, which can then be used for filtering results from certain catalog endpoints. See the [`-node-meta` command-line flag](#_node_meta) for more information. - ```javascript - { - "node_meta": { - "instance_type": "t2.medium" - } + ```json + { + "node_meta": { + "instance_type": "t2.medium" } + } ``` -* - `performance` Available in Consul 0.7 and later, this - is a nested object that allows tuning the performance of different subsystems in - Consul. See the [Server Performance](/docs/install/performance.html) documentation - for more details. The following parameters are available: +- `performance` Available in Consul 0.7 and later, this is a nested object that allows tuning the performance of different subsystems in Consul. See the [Server Performance](/docs/install/performance.html) documentation for more details. The following parameters are available: - - - `leave_drain_time` - A duration that a server - will dwell during a graceful leave in order to allow requests to be retried against - other Consul servers. Under normal circumstances, this can prevent clients from - experiencing "no leader" errors when performing a rolling update of the Consul - servers. This was added in Consul 1.0. Must be a duration value such as 10s. - Defaults to 5s. + - `leave_drain_time` - A duration that a server will dwell during a graceful leave in order to allow requests to be retried against other Consul servers. Under normal circumstances, this can prevent clients from experiencing "no leader" errors when performing a rolling update of the Consul servers. This was added in Consul 1.0. Must be a duration value such as 10s. Defaults to 5s. - - - `raft_multiplier` - An integer multiplier used - by Consul servers to scale key Raft timing parameters. Omitting this value or - setting it to 0 uses default timing described below. Lower values are used to - tighten timing and increase sensitivity while higher values relax timings and - reduce sensitivity. Tuning this affects the time it takes Consul to detect leader - failures and to perform leader elections, at the expense of requiring more network - and CPU resources for better performance. + - `raft_multiplier` - An integer multiplier used by Consul servers to scale key Raft timing parameters. Omitting this value or setting it to 0 uses default timing described below. Lower values are used to tighten timing and increase sensitivity while higher values relax timings and reduce sensitivity. Tuning this affects the time it takes Consul to detect leader failures and to perform leader elections, at the expense of requiring more network and CPU resources for better performance. By default, Consul will use a lower-performance timing that's suitable for [minimal Consul servers](/docs/install/performance.html#minimum), currently equivalent @@ -1810,66 +1417,52 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." depending if the target minimum server profile changes). Setting this to a value of 1 will configure Raft to its highest-performance mode, equivalent to the default timing of Consul prior to 0.7, and is recommended for [production Consul servers](/docs/install/performance.html#production). + See the note on [last contact](/docs/install/performance.html#last-contact) timing for more details on tuning this parameter. The maximum allowed value is 10. - - - `rpc_hold_timeout` - A duration that a client + - `rpc_hold_timeout` - A duration that a client or server will retry internal RPC requests during leader elections. Under normal circumstances, this can prevent clients from experiencing "no leader" errors. This was added in Consul 1.0. Must be a duration value such as 10s. Defaults to 7s. -* - `ports` This is a nested object that allows setting the bind - ports for the following keys: +- `ports` This is a nested object that allows setting the bind ports for the following keys: - - - `dns` - The DNS server, -1 to disable. Default 8600. + - `dns` ((#dns_port)) - The DNS server, -1 to disable. Default 8600. TCP and UDP. - - - `http` - The HTTP API, -1 to disable. Default 8500. + - `http` ((#http_port)) - The HTTP API, -1 to disable. Default 8500. TCP only. - - - `https` - The HTTPS API, -1 to disable. Default -1 + - `https` ((#https_port)) - The HTTPS API, -1 to disable. Default -1 (disabled). **We recommend using `8501`** for `https` by convention as some tooling will work automatically with this. - - - `grpc` - The gRPC API, -1 to disable. Default -1 (disabled). + - `grpc` ((#grpc_port)) - The gRPC API, -1 to disable. Default -1 (disabled). **We recommend using `8502`** for `grpc` by convention as some tooling will work automatically with this. This is set to `8502` by default when the agent runs in `-dev` mode. Currently gRPC is only used to expose Envoy xDS API to Envoy proxies. - - - `serf_lan` - The Serf LAN port. Default 8301. TCP + - `serf_lan` ((#serf_lan_port)) - The Serf LAN port. Default 8301. TCP and UDP. - - - `serf_wan` - The Serf WAN port. Default 8302. Set + - `serf_wan` ((#serf_wan_port)) - The Serf WAN port. Default 8302. Set to -1 to disable. **Note**: this will disable WAN federation which is not recommended. Various catalog and WAN related endpoints will return errors or empty results. TCP and UDP. - - - `server` - Server RPC address. Default 8300. TCP + - `server` ((#server_rpc_port)) - Server RPC address. Default 8300. TCP only. - - - `sidecar_min_port` - Inclusive minimum port number + - `sidecar_min_port` ((#sidecar_min_port)) - Inclusive minimum port number to use for automatically assigned [sidecar service registrations](/docs/connect/registration/sidecar-service.html). Default 21000. Set to `0` to disable automatic port assignment. - - - `sidecar_max_port` - Inclusive maximum port number + - `sidecar_max_port` ((#sidecar_max_port)) - Inclusive maximum port number to use for automatically assigned [sidecar service registrations](/docs/connect/registration/sidecar-service.html). Default 21255. Set to `0` to disable automatic port assignment. - - - `expose_min_port` - Inclusive minimum port number + - `expose_min_port` ((#expose_min_port)) - Inclusive minimum port number to use for automatically assigned [exposed check listeners](/docs/connect/registration/service-registration.html#expose-paths-configuration-reference). Default 21500. Set to `0` to disable automatic port assignment. - - - `expose_max_port` - Inclusive maximum port number + - `expose_max_port` ((#expose_max_port)) - Inclusive maximum port number to use for automatically assigned [exposed check listeners](/docs/connect/registration/service-registration.html#expose-paths-configuration-reference). Default 21755. Set to `0` to disable automatic port assignment. -* - `primary_datacenter` - This designates the datacenter +- `primary_datacenter` ((#primary_datacenter)) - This designates the datacenter which is authoritative for ACL information, intentions and is the root Certificate Authority for Connect. It must be provided to enable ACLs. All servers and datacenters must agree on the primary datacenter. Setting it on the servers is all you need @@ -1877,35 +1470,24 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'." it must be set on them too. In Consul 0.8 and later, this also enables agent-level enforcement of ACLs. -* - `primary_gateways` Equivalent to the [`-primary-gateway` +- `primary_gateways` ((#primary_gateways)) Equivalent to the [`-primary-gateway` command-line flag](#_primary_gateway). Takes a list of addresses to use as the mesh gateways for the primary datacenter when authoritative replicated catalog data is not present. Discovery happens every [`primary_gateways_interval`](#_primary_gateways_interval) until at least one primary mesh gateway is discovered. This was added in Consul 1.8.x **TODO(wanfed)**. -* - `primary_gateways_interval` Time to wait +- `primary_gateways_interval` ((#primary_gateways_interval)) Time to wait between [`primary_gateways`](#primary_gateways) discovery attempts. Defaults to 30s. This was added in Consul 1.8.x **TODO(wanfed)**. -* - `protocol` Equivalent to the [`-protocol` command-line +- `protocol` ((#protocol)) Equivalent to the [`-protocol` command-line flag](#_protocol). -* - `raft_protocol` Equivalent to the [`-raft-protocol` +- `raft_protocol` ((#raft_protocol)) Equivalent to the [`-raft-protocol` command-line flag](#_raft_protocol). - - -- - - `raft_snapshot_threshold` This controls +- `raft_snapshot_threshold` This controls the minimum number of raft commit entries between snapshots that are saved to disk. This is a low-level parameter that should rarely need to be changed. Very busy clusters experiencing excessive disk IO may increase this value to reduce disk @@ -1916,21 +1498,11 @@ to the old fragment --> significantly as more logs will need to be replayed. In Consul 1.1.0 and later this defaults to 16384, and in prior versions it was set to 8192. -- - - `raft_snapshot_interval` - This controls how often servers check if they need to save a snapshot to disk. - his is a low-level parameter that should rarely need to be changed. Very busy clusters - experiencing excessive disk IO may increase this value to reduce disk IO, and minimize - the chances of all servers taking snapshots at the same time. Increasing this trades - off disk IO for disk space since the log will grow much larger and the space in - th e raft.db file can't be reclaimed till the next snapshot. Servers may take longer - to recover from crashes or failover if this is increased significantly as more - logs will need to be replayed. In Consul 1.1.0 and later this defaults to `30s`, - and in prior versions it was set to `5s`. +- `raft_snapshot_interval` This controls how often servers check if they + need to save a snapshot to disk. This is a low-level parameter that should rarely need to be changed. Very busy clusters experiencing excessive disk IO may increase this value to reduce disk IO, and minimize the chances of all servers taking snapshots at the same time. Increasing this trades + off disk IO for disk space since the log will grow much larger and the space in the raft.db file can't be reclaimed till the next snapshot. Servers may take longer to recover from crashes or failover if this is increased significantly as more logs will need to be replayed. In Consul 1.1.0 and later this defaults to `30s`, and in prior versions it was set to `5s`. -- - `raft_trailing_logs` - This controls how many +- `raft_trailing_logs` - This controls how many log entries are left in the log store on disk after a snapshot is made. This should only be adjusted when followers cannot catch up to the leader due to a very large snapshot size that and high write throughput causing log truncation before an snapshot @@ -1939,8 +1511,7 @@ to the old fragment --> under a load it is not designed to handle. The default value is 10000 which is suitable for all normal workloads. Added in Consul 1.5.3. -- - `reap` This controls Consul's automatic reaping of child processes, +- `reap` This controls Consul's automatic reaping of child processes, which is useful if Consul is running as PID 1 in a Docker container. If this isn't specified, then Consul will automatically reap child processes if it detects it is running as PID 1. If this is set to true or false, then it controls reaping @@ -1951,8 +1522,7 @@ to the old fragment --> option of the `docker run` command and docker will enable an init process with PID 1 that reaps child processes for the container. More info on [Docker docs](https://docs.docker.com/engine/reference/commandline/run/#options). -- - `reconnect_timeout` This controls how long it +- `reconnect_timeout` This controls how long it takes for a failed node to be completely removed from the cluster. This defaults to 72 hours and it is recommended that this is set to at least double the maximum expected recoverable outage time for a node or network partition. WARNING: Setting @@ -1961,14 +1531,12 @@ to the old fragment --> The value is a time with a unit suffix, which can be "s", "m", "h" for seconds, minutes, or hours. The value must be >= 8 hours. -- - `reconnect_timeout_wan` This is the WAN equivalent - of the `reconnect_timeout` parameter, which controls +- `reconnect_timeout_wan` This is the WAN equivalent + of the [`reconnect_timeout`](#reconnect_timeout) parameter, which controls how long it takes for a failed server to be completely removed from the WAN pool. This also defaults to 72 hours, and must be >= 8 hours. -- - `recursors` This flag provides addresses of upstream DNS +- `recursors` This flag provides addresses of upstream DNS servers that are used to recursively resolve queries if they are not inside the service domain for Consul. For example, a node can use Consul directly as a DNS server, and if the record is outside of the "consul." domain, the query will be @@ -1976,75 +1544,50 @@ to the old fragment --> or as go-sockaddr templates. IP addresses are resolved in order, and duplicates are ignored. -- - `rejoin_after_leave` Equivalent to the [`-rejoin` - command-line flag](#_rejoin). +- `rejoin_after_leave` Equivalent to the [`-rejoin` command-line flag](#_rejoin). - `retry_join` - Equivalent to the [`-retry-join`](#retry-join) command-line flag. -- - `retry_interval` Equivalent to the [`-retry-interval` - command-line flag](#_retry_interval). +- `retry_interval` Equivalent to the [`-retry-interval` command-line flag](#_retry_interval). -- - `retry_join_wan` Equivalent to the [`-retry-join-wan` - command-line flag](#_retry_join_wan). Takes a list of addresses to attempt joining - to WAN every [`retry_interval_wan`](#_retry_interval_wan) until at least one join - works. +- `retry_join_wan` Equivalent to the [`-retry-join-wan` command-line flag](#_retry_join_wan). Takes a list of addresses to attempt joining to WAN every [`retry_interval_wan`](#_retry_interval_wan) until at least one join works. -- - `retry_interval_wan` Equivalent to the [`-retry-interval-wan` - command-line flag](#_retry_interval_wan). +- `retry_interval_wan` Equivalent to the [`-retry-interval-wan` command-line flag](#_retry_interval_wan). -- - `segment` (Enterprise-only) Equivalent to the [`-segment` - command-line flag](#_segment). +- `segment` (Enterprise-only) Equivalent to the [`-segment` command-line flag](#_segment). -- - `segments` (Enterprise-only) This is a list of nested objects +- `segments` (Enterprise-only) This is a list of nested objects that allows setting the bind/advertise information for network segments. This can only be set on servers. See the [Network Segments Guide](https://learn.hashicorp.com/consul/day-2-operations/network-segments) for more details. - - - `name` - The name of the segment. Must be a string + - `name` ((#segment_name)) - The name of the segment. Must be a string between 1 and 64 characters in length. - - - `bind` - The bind address to use for the segment's + - `bind` ((#segment_bind)) - The bind address to use for the segment's gossip layer. Defaults to the [`-bind`](#_bind) value if not provided. - - - `port` - The port to use for the segment's gossip + - `port` ((#segment_port)) - The port to use for the segment's gossip layer (required). - - - `advertise` - The advertise address to use for + - `advertise` ((#segment_advertise)) - The advertise address to use for the segment's gossip layer. Defaults to the [`-advertise`](#_advertise) value if not provided. - - - `rpc_listener` - If true, a separate RPC + - `rpc_listener` ((#segment_rpc_listener)) - If true, a separate RPC listener will be started on this segment's [`-bind`](#_bind) address on the rpc port. Only valid if the segment's bind address differs from the [`-bind`](#_bind) address. Defaults to false. -- - `server` Equivalent to the [`-server` command-line flag](#_server). +- `server` Equivalent to the [`-server` command-line flag](#_server). -- - `non_voting_server` - Equivalent to the [`-non-voting-server` - command-line flag](#_non_voting_server). +- `non_voting_server` - Equivalent to the [`-non-voting-server` command-line flag](#_non_voting_server). -- - `server_name` When provided, this overrides the [`node_name`](#_node) +- `server_name` When provided, this overrides the [`node_name`](#_node) for the TLS certificate. It can be used to ensure that the certificate name matches the hostname we declare. -- - `session_ttl_min` - The minimum allowed session TTL. This ensures sessions are not created with TTL's +- `session_ttl_min` The minimum allowed session TTL. This ensures sessions are not created with TTL's shorter than the specified limit. It is recommended to keep this limit at or above the default to encourage clients to send infrequent heartbeats. Defaults to 10s. -- - `skip_leave_on_interrupt` This is similar +- `skip_leave_on_interrupt` This is similar to [`leave_on_terminate`](#leave_on_terminate) but only affects interrupt handling. When Consul receives an interrupt signal (such as hitting Control-C in a terminal), Consul will gracefully leave the cluster. Setting this to `true` disables that @@ -2055,92 +1598,61 @@ to the old fragment --> a server will keep the server in the cluster and therefore quorum, and Ctrl-C on a client will gracefully leave). -- - `start_join` An array of strings specifying addresses +- `start_join` An array of strings specifying addresses of nodes to [`-join`](#_join) upon startup. Note that using - `retry_join` could be more appropriate to help mitigate + `retry_join` could be more appropriate to help mitigate node startup race conditions when automating a Consul cluster deployment. -- - `start_join_wan` An array of strings specifying addresses +- `start_join_wan` An array of strings specifying addresses of WAN nodes to [`-join-wan`](#_join_wan) upon startup. -- - `telemetry` This is a nested object that configures where +- `telemetry` This is a nested object that configures where Consul sends its runtime telemetry, and contains the following keys: - - - `circonus_api_token`A valid API + - `circonus_api_token` ((#telemetry-circonus_api_token)) A valid API Token used to create/manage check. If provided, metric management is enabled. - - - `circonus_api_app`A valid app name + - `circonus_api_app` ((#telemetry-circonus_api_app)) A valid app name associated with the API token. By default, this is set to "consul". - - - `circonus_api_url` + - `circonus_api_url` ((#telemetry-circonus_api_url)) The base URL to use for contacting the Circonus API. By default, this is set to "https://api.circonus.com/v2". - - - - `circonus_submission_interval` - - The interval at which metrics are submitted to Circonus. By default, this is - set to "10s" (ten seconds). + - `circonus_submission_interval` ((#telemetry-circonus_submission_interval)) The interval at which metrics are submitted to Circonus. By default, this is set to "10s" (ten seconds). - - - `circonus_submission_url` + - `circonus_submission_url` ((#telemetry-circonus_submission_url)) The `check.config.submission_url` field, of a Check API object, from a previously created HTTPTRAP check. - - - `circonus_check_id` + - `circonus_check_id` ((#telemetry-circonus_check_id)) The Check ID (not **check bundle**) from a previously created HTTPTRAP check. The numeric portion of the `check._cid` field in the Check API object. - - - - `circonus_check_force_metric_activation` - - Force activation of metrics which already exist and are not currently active. + - `circonus_check_force_metric_activation` ((#telemetry-circonus_check_force_metric_activation) Force activation of metrics which already exist and are not currently active. If check management is enabled, the default behavior is to add new metrics as they are encountered. If the metric already exists in the check, it will **not** be activated. This setting overrides that behavior. By default, this is set to false. - - - - `circonus_check_instance_id` - - Uniquely identifies the metrics coming from this _instance_. It can be used to + - `circonus_check_instance_id` ((#telemetry-circonus_check_instance_id)) Uniquely identifies the metrics coming from this **instance**. It can be used to maintain metric continuity with transient or ephemeral instances as they move around within an infrastructure. By default, this is set to hostname:application name (e.g. "host123:consul"). - - - - `circonus_check_search_tag` - - A special tag which, when coupled with the instance id, helps to narrow down + - `circonus_check_search_tag` ((#telemetry-circonus_check_search_tag)) A special tag which, when coupled with the instance id, helps to narrow down the search results when neither a Submission URL or Check ID is provided. By default, this is set to service:application name (e.g. "service:consul"). - - - - `circonus_check_display_name` - - Specifies a name to give a check when it is created. This name is displayed in + - `circonus_check_display_name` ((#telemetry-circonus_check_display_name)) Specifies a name to give a check when it is created. This name is displayed in the Circonus UI Checks list. Available in Consul 0.7.2 and later. - - - `circonus_check_tags` + - `circonus_check_tags` ((#telemetry-circonus_check_tags)) Comma separated list of additional tags to add to a check when it is created. Available in Consul 0.7.2 and later. - - - `circonus_broker_id` + - `circonus_broker_id` ((#telemetry-circonus_broker_id)) The ID of a specific Circonus Broker to use when creating a new check. The numeric portion of `broker._cid` field in a Broker API object. If metric management is enabled and neither a Submission URL nor Check ID is provided, an attempt will @@ -2149,62 +1661,48 @@ to the old fragment --> used and a random Enterprise Broker is selected, or the default Circonus Public Broker. - - - - `circonus_broker_select_tag` - - A special tag which will be used to select a Circonus Broker when a Broker ID + - `circonus_broker_select_tag` ((#telemetry-circonus_broker_select_tag)) A special tag which will be used to select a Circonus Broker when a Broker ID is not provided. The best use of this is to as a hint for which broker should - be used based on _where_ this particular instance is running (e.g. a specific + be used based on **where** this particular instance is running (e.g. a specific geo location or datacenter, dc:sfo). By default, this is left blank and not used. - - - `disable_hostname` + - `disable_hostname` ((#telemetry-disable_hostname)) This controls whether or not to prepend runtime telemetry with the machine's hostname, defaults to false. - - - `dogstatsd_addr` This provides the address + - `dogstatsd_addr` ((#telemetry-dogstatsd_addr)) This provides the address of a DogStatsD instance in the format `host:port`. DogStatsD is a protocol-compatible flavor of statsd, with the added ability to decorate metrics with tags and event information. If provided, Consul will send various telemetry information to that instance for aggregation. This can be used to capture runtime information. - - - `dogstatsd_tags` This provides a list + - `dogstatsd_tags` ((#telemetry-dogstatsd_tags)) This provides a list of global tags that will be added to all telemetry packets sent to DogStatsD. It is a list of strings, where each string looks like "my_tag_name:my_tag_value". - - - `filter_default` + - `filter_default` ((#telemetry-filter_default)) This controls whether to allow metrics that have not been specified by the filter. Defaults to `true`, which will allow all metrics when no filters are provided. When set to `false` with no filters, no metrics will be sent. - - - `metrics_prefix` + - `metrics_prefix` ((#telemetry-metrics_prefix)) The prefix used while writing all telemetry data. By default, this is set to "consul". This was added in Consul 1.0. For previous versions of Consul, use the config option `statsite_prefix` in this same structure. This was renamed in Consul 1.0 since this prefix applied to all telemetry providers, not just statsite. - - - `prefix_filter` + - `prefix_filter` ((#telemetry-prefix_filter)) This is a list of filter rules to apply for allowing/blocking metrics by prefix in the following format: - ```javascript - ;['+consul.raft.apply', '-consul.http', '+consul.http.GET'] + ```json + ["+consul.raft.apply", "-consul.http", "+consul.http.GET"] ``` - A leading "+" will enable any metrics with the given prefix, and a leading "-" will block them. If there - is overlap between two rules, the more specific rule will take precedence. Blocking will take priority if the same - prefix is listed multiple times. + A leading "**+**" will enable any metrics with the given prefix, and a leading "**-**" will block them. If there is overlap between two rules, the more specific rule will take precedence. Blocking will take priority if the same prefix is listed multiple times. - - - prometheus_retention_time - If the value is greater than `0s` (the default), this enables [Prometheus](https://prometheus.io/) + - prometheus_retention_time ((#telemetry-prometheus_retention_time)) If the value is greater than `0s` (the default), this enables [Prometheus](https://prometheus.io/) export of metrics. The duration can be expressed using the duration semantics and will aggregates all counters for the duration specified (it might have an impact on Consul's memory usage). A good value for this parameter is at least @@ -2213,11 +1711,11 @@ to the old fragment --> days). Fetching the metrics using prometheus can then be performed using the [`/v1/agent/metrics?format=prometheus`](/api/agent.html#view-metrics) endpoint. The format is compatible natively with prometheus. When running in this mode, - it is recommended to also enable the option - `disable_hostname` to avoid having - prefixed metrics with hostname. Consul does not use the default Prometheus path, - so Prometheus must be configured as follows. Note that using ?format=prometheus - in the path won't work as ? will be escaped, so it must be specified as a parameter. + it is recommended to also enable the option `disable_hostname` ((#telemetry-disable_hostname)) + to avoid having prefixed metrics with hostname. Consul does not use the default + Prometheus path, so Prometheus must be configured as follows. Note that using + ?format=prometheus in the path won't work as ? will be escaped, so it must be + specified as a parameter. ```yaml metrics_path: '/v1/agent/metrics' @@ -2225,52 +1723,43 @@ to the old fragment --> format: ['prometheus'] ``` - - - `statsd_address` This provides the address + - `statsd_address` ((#telemetry-statsd_address)) This provides the address of a statsd instance in the format `host:port`. If provided, Consul will send various telemetry information to that instance for aggregation. This can be used to capture runtime information. This sends UDP packets only and can be used with statsd or statsite. - - - `statsite_address` This provides the + - `statsite_address` ((#telemetry-statsite_address)) This provides the address of a statsite instance in the format `host:port`. If provided, Consul will stream various telemetry information to that instance for aggregation. This can be used to capture runtime information. This streams via TCP and can only be used with statsite. -- - `syslog_facility` When [`enable_syslog`](#enable_syslog) +- `syslog_facility` When [`enable_syslog`](#enable_syslog) is provided, this controls to which facility messages are sent. By default, `LOCAL0` will be used. -- - `tls_min_version` Added in Consul 0.7.4, this specifies +- `tls_min_version` Added in Consul 0.7.4, this specifies the minimum supported version of TLS. Accepted values are "tls10", "tls11", "tls12", or "tls13". This defaults to "tls12". WARNING: TLS 1.1 and lower are generally considered less secure; avoid using these if possible. -- - `tls_cipher_suites` Added in Consul 0.8.2, this +- `tls_cipher_suites` Added in Consul 0.8.2, this specifies the list of supported ciphersuites as a comma-separated-list. The list of all supported ciphersuites is available in the [source code](https://github.com/hashicorp/consul/blob/master/tlsutil/config.go#L363). -- - - `tls_prefer_server_cipher_suites` - Added in Consul 0.8.2, this will cause Consul to prefer the server's ciphersuite - over the client ciphersuites. +- `tls_prefer_server_cipher_suites` Added in Consul 0.8.2, this + will cause Consul to prefer the server's ciphersuite over the client ciphersuites. -- - `translate_wan_addrs` If set to true, Consul - will prefer a node's configured WAN address +- `translate_wan_addrs` If set to true, Consul + will prefer a node's configured [WAN address](#_advertise-wan) when servicing DNS and HTTP requests for a node in a remote datacenter. This allows the node to be reached within its own datacenter using its local address, and reached from other datacenters using its WAN address, which is useful in hybrid setups with mixed networks. This is disabled by default. Starting in Consul 0.7 and later, node addresses in responses to HTTP requests will also prefer a - node's configured WAN address when querying for a node in a remote + node's configured [WAN address](#_advertise-wan) when querying for a node in a remote datacenter. An [`X-Consul-Translate-Addresses`](/api/index.html#translated-addresses) header will be present on all responses when translation is enabled to help clients know that the addresses may be translated. The `TaggedAddresses` field in responses also have a `lan` address for clients that @@ -2284,17 +1773,14 @@ to the old fragment --> - [`/v1/health/service/`](/api/health.html#health_service) - [`/v1/query//execute`](/api/query.html#execute) -- - `ui` - Equivalent to the [`-ui`](#_ui) command-line flag. +- `ui` - Equivalent to the [`-ui`](#_ui) command-line flag. -- - `ui_dir` - Equivalent to the [`-ui-dir`](#_ui_dir) command-line +- `ui_dir` - Equivalent to the [`-ui-dir`](#_ui_dir) command-line flag. This configuration key is not required as of Consul version 0.7.0 and later. Specifying this configuration key will enable the web UI. There is no need to specify both ui-dir and ui. Specifying both will result in an error. -- - `unix_sockets` - This allows tuning the ownership and +- `unix_sockets` - This allows tuning the ownership and permissions of the Unix domain socket files created by Consul. Domain sockets are only used if the HTTP address is configured with the `unix://` prefix. @@ -2312,8 +1798,7 @@ to the old fragment --> currently only supports numeric IDs. - `mode` - The permission bits to set on the file. -- - `verify_incoming`- If set to true, Consul +- `verify_incoming` - If set to true, Consul requires that all incoming connections make use of TLS and that the client provides a certificate signed by a Certificate Authority from the [`ca_file`](#ca_file) or [`ca_path`](#ca_path). This applies to both server @@ -2324,15 +1809,13 @@ to the old fragment --> endpoint was created by the CA that the consul client was setup with. If the UI is served, the same checks are performed. -* - `verify_incoming_rpc` - If set to true, Consul +- `verify_incoming_rpc` - If set to true, Consul requires that all incoming RPC connections make use of TLS and that the client provides a certificate signed by a Certificate Authority from the [`ca_file`](#ca_file) or [`ca_path`](#ca_path). By default, this is false, and Consul will not enforce the use of TLS or verify a client's authenticity. -* - `verify_incoming_https` - If set to true, +- `verify_incoming_https` - If set to true, Consul requires that all incoming HTTPS connections make use of TLS and that the client provides a certificate signed by a Certificate Authority from the [`ca_file`](#ca_file) or [`ca_path`](#ca_path). By default, this is false, and Consul will not enforce @@ -2340,8 +1823,7 @@ to the old fragment --> must define an HTTPS port via the [`ports`](#ports) configuration. By default, HTTPS is disabled. -* - `verify_outgoing` - If set to true, Consul requires +- `verify_outgoing` - If set to true, Consul requires that all outgoing connections from this agent make use of TLS and that the server provides a certificate that is signed by a Certificate Authority from the [`ca_file`](#ca_file) or [`ca_path`](#ca_path). By default, this is false, and Consul will not make use @@ -2354,7 +1836,7 @@ to the old fragment --> server unencrypted is to also enable `verify_incoming` which requires client certificates too. -* `verify_server_hostname` - If set to true, +- `verify_server_hostname` - If set to true, Consul verifies for all outgoing TLS connections that the TLS certificate presented by the servers matches `server..` hostname. By default, this is false, and Consul does not verify the hostname @@ -2369,7 +1851,7 @@ to the old fragment --> [CVE-2018-19653](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19653) for more details. For those versions you **must also set `verify_outgoing = true`** to ensure encrypted RPC connections. -* `watches` - Watches is a list of watch specifications which +- `watches` - Watches is a list of watch specifications which allow an external process to be automatically invoked when a particular data view is updated. See the [watch documentation](/docs/agent/watches.html) for more detail. Watches can be modified when the configuration is reloaded. diff --git a/website/pages/docs/agent/watches.mdx b/website/pages/docs/agent/watches.mdx index 02ee2e9901..0a10435d8b 100644 --- a/website/pages/docs/agent/watches.mdx +++ b/website/pages/docs/agent/watches.mdx @@ -54,7 +54,7 @@ Anything written to stdout is logged. Here is an example configuration, where `handler_type` is optionally set to `script`: -```javascript +```json { "type": "key", "key": "foo/bar/baz", @@ -82,15 +82,15 @@ always sent as a JSON payload. Here is an example configuration: -```javascript +```json { "type": "key", "key": "foo/bar/baz", "handler_type": "http", "http_handler_config": { - "path":"https://localhost:8000/watch", + "path": "https://localhost:8000/watch", "method": "POST", - "header": {"x-foo":["bar", "baz"]}, + "header": { "x-foo": ["bar", "baz"] }, "timeout": "10s", "tls_skip_verify": false } @@ -119,7 +119,7 @@ The following types are supported. Detailed documentation on each is below: - [`checks`](#checks) - Watch the value of health checks - [`event`](#event) - Watch for custom user events -### Type: key +### Type: key ((#key)) The "key" watch type is used to watch a specific key in the KV store. It requires that the "key" parameter be specified. @@ -138,11 +138,13 @@ Here is an example configuration: Or, using the watch command: - $ consul watch -type=key -key=foo/bar/baz /usr/bin/my-key-handler.sh +```shell +$ consul watch -type=key -key=foo/bar/baz /usr/bin/my-key-handler.sh +``` An example of the output of this command: -```javascript +```json { "Key": "foo/bar/baz", "CreateIndex": 1793, @@ -154,7 +156,7 @@ An example of the output of this command: } ``` -### Type: keyprefix +### Type: keyprefix ((#keyprefix)) The "keyprefix" watch type is used to watch a prefix of keys in the KV store. It requires that the "prefix" parameter be specified. This watch @@ -165,7 +167,7 @@ This maps to the `/v1/kv/` API internally. Here is an example configuration: -```javascript +```json { "type": "keyprefix", "prefix": "foo/", @@ -175,12 +177,14 @@ Here is an example configuration: Or, using the watch command: - $ consul watch -type=keyprefix -prefix=foo/ /usr/bin/my-prefix-handler.sh +```shell +$ consul watch -type=keyprefix -prefix=foo/ /usr/bin/my-prefix-handler.sh +``` An example of the output of this command: -```javascript -;[ +```text +[ { Key: 'foo/bar', CreateIndex: 1796, @@ -211,7 +215,7 @@ An example of the output of this command: ] ``` -### Type: services +### Type: services ((#services)) The "services" watch type is used to watch the list of available services. It has no parameters. @@ -220,7 +224,7 @@ This maps to the `/v1/catalog/services` API internally. An example of the output of this command: -```javascript +```json { "consul": [], "redis": [], @@ -228,7 +232,7 @@ An example of the output of this command: } ``` -### Type: nodes +### Type: nodes ((#nodes)) The "nodes" watch type is used to watch the list of available nodes. It has no parameters. @@ -237,8 +241,8 @@ This maps to the `/v1/catalog/nodes` API internally. An example of the output of this command: -```javascript -;[ +```text +[ { Node: 'nyc1-consul-1', Address: '192.241.159.115', @@ -262,11 +266,11 @@ An example of the output of this command: { Node: 'nyc1-worker-3', Address: '162.243.162.229', - }, + } ] ``` -### Type: service +### Type: service ((#service)) The "service" watch type is used to monitor the providers of a single service. It requires the "service" parameter @@ -280,7 +284,7 @@ This maps to the `/v1/health/service` API internally. Here is an example configuration with a single tag: -```javascript +```json { "type": "service", "service": "redis", @@ -291,7 +295,7 @@ Here is an example configuration with a single tag: Here is an example configuration with multiple tags: -```javascript +```json { "type": "service", "service": "redis", @@ -304,16 +308,20 @@ Or, using the watch command: Single tag: - $ consul watch -type=service -service=redis -tag=bar /usr/bin/my-service-handler.sh +```shell +$ consul watch -type=service -service=redis -tag=bar /usr/bin/my-service-handler.sh +``` Multiple tag: - $ consul watch -type=service -service=redis -tag=bar -tag=foo /usr/bin/my-service-handler.sh +```shell +$ consul watch -type=service -service=redis -tag=bar -tag=foo /usr/bin/my-service-handler.sh +``` An example of the output of this command: -```javascript -;[ +```text +[ { Node: { Node: 'foobar', @@ -347,11 +355,11 @@ An example of the output of this command: ServiceName: '', }, ], - }, + } ] ``` -### Type: checks +### Type: checks ((#checks)) The "checks" watch type is used to monitor the checks of a given service or those in a specific state. It optionally takes the "service" @@ -385,11 +393,15 @@ Or, using the watch command: State: - $ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing +```shell +$ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing +``` Service: - $ consul watch -type=checks -service=redis /usr/bin/my-check-handler.sh -redis +```shell +$ consul watch -type=checks -service=redis /usr/bin/my-check-handler.sh -redis +``` An example of the output of this command: @@ -408,7 +420,7 @@ An example of the output of this command: ] ``` -### Type: event +### Type: event ((#event)) The "event" watch type is used to monitor for custom user events. These are fired using the [consul event](/docs/commands/event.html) command. @@ -419,7 +431,7 @@ This maps to the `/v1/event/list` API internally. Here is an example configuration: -```javascript +```json { "type": "event", "name": "web-deploy", @@ -429,11 +441,13 @@ Here is an example configuration: Or, using the watch command: - $ consul watch -type=event -name=web-deploy /usr/bin/my-event-handler.sh -web-deploy +```shell +$ consul watch -type=event -name=web-deploy /usr/bin/my-event-handler.sh -web-deploy +``` An example of the output of this command: -```javascript +```json [ { "ID": "f07f3fcc-4b7d-3a7c-6d1e-cf414039fcee", @@ -451,4 +465,6 @@ An example of the output of this command: To fire a new `web-deploy` event the following could be used: - $ consul event -name=web-deploy 1609030 +```shell +$ consul event -name=web-deploy 1609030 +``` diff --git a/website/pages/docs/common-errors.mdx b/website/pages/docs/common-errors.mdx index 8dd95ba8c3..d2b974fb79 100644 --- a/website/pages/docs/common-errors.mdx +++ b/website/pages/docs/common-errors.mdx @@ -15,7 +15,7 @@ If you are getting an error message you don't see listed on this page, please co ### Multiple network interfaces -``` +```text Multiple private IPv4 addresses found. Please configure one with 'bind' and/or 'advertise'. ``` @@ -25,21 +25,21 @@ Your server has multiple active network interfaces. Consul needs to know which i ### Configuration syntax errors -``` +```text Error parsing config.hcl: At 1:12: illegal char ``` -``` +```text Error parsing config.hcl: At 1:32: key 'foo' expected start of object ('{') or assignment ('=') ``` -``` +```text Error parsing server.json: invalid character '`' looking for beginning of value ``` There is a syntax error in your configuration file. If the error message doesn't identify the exact location in the file where the problem is, try using [jq] to find it, for example: -``` +```shell $ consul agent -server -config-file server.json ==> Error parsing server.json: invalid character '`' looking for beginning of value $ cat server.json | jq . @@ -48,7 +48,7 @@ parse error: Invalid numeric literal at line 3, column 29 ## Invalid host name -``` +```text Node name "consul_client.internal" will not be discoverable via DNS due to invalid characters. ``` @@ -56,11 +56,11 @@ Add the [`node name`][node_name] option to your agent configuration and provide ## I/O timeouts -``` +```text Failed to join 10.0.0.99: dial tcp 10.0.0.99:8301: i/o timeout ``` -``` +```text Failed to sync remote state: No cluster leader ``` @@ -70,7 +70,7 @@ If they are not on the same LAN, check the [`retry_join`][retry_join] settings i ## Deadline exceeded -``` +```text Error getting server health from "XXX": context deadline exceeded ``` @@ -78,11 +78,11 @@ These error messages indicate a general performance problem on the Consul server ## Too many open files -``` +```text Error accepting TCP connection: accept tcp [::]:8301: too many open files in system ``` -``` +```text Get http://localhost:8500/: dial tcp 127.0.0.1:31643: socket: too many open files ``` @@ -100,7 +100,7 @@ This has been a [known issue](https://github.com/docker/libnetwork/issues/1204) ## ACL Not Found -``` +```text RPC error making call: rpc error making call: ACL not found ``` @@ -110,11 +110,11 @@ This indicates that you have ACL enabled in your cluster, but you aren't passing ### Incorrect certificate or certificate name -``` +```text Remote error: tls: bad certificate ``` -``` +```text X509: certificate signed by unknown authority ``` @@ -124,11 +124,11 @@ If you generate your own certificates, make sure the server certificates include ### HTTP instead of HTTPS -``` +```text Error querying agent: malformed HTTP response ``` -``` +```text Net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02" ``` @@ -140,7 +140,7 @@ If you are interacting with the API, change the URI scheme to "https". ## License warnings -``` +```text License: expiration time: YYYY-MM-DD HH:MM:SS -0500 EST, time left: 29m0s ``` diff --git a/website/pages/docs/connect/intentions.mdx b/website/pages/docs/connect/intentions.mdx index a633b9fd66..5a928c0c29 100644 --- a/website/pages/docs/connect/intentions.mdx +++ b/website/pages/docs/connect/intentions.mdx @@ -29,9 +29,7 @@ is "deny all", then all Connect connections are denied by default. ## Intention Basics -Intentions can be managed via the -[API](#), -[CLI](#), +Intentions can be managed via the [API](#), [CLI](#), or UI. Please see the respective documentation for each for full details on options, flags, etc. Below is an example of a basic intention to show the basic attributes @@ -70,7 +68,7 @@ Arbitrary string key/value data may be associated with intentions. This is unused by Consul but can be used by external systems or for visibility in the UI. -``` +```shell $ consul intention create \ -deny \ -meta description='Hello there' \ diff --git a/website/pages/docs/connect/mesh_gateway.mdx b/website/pages/docs/connect/mesh_gateway.mdx index c52f54d1bd..e4ed177464 100644 --- a/website/pages/docs/connect/mesh_gateway.mdx +++ b/website/pages/docs/connect/mesh_gateway.mdx @@ -9,10 +9,10 @@ description: >- you can plug in a gateway of your choice. --- --> **1.6.0+:** This feature is available in Consul versions 1.6.0 and newer. - # Mesh Gateways +-> **1.6.0+:** This feature is available in Consul versions 1.6.0 and newer. + Mesh gateways enable routing of Connect traffic between different Consul datacenters. Those datacenters can reside in different clouds or runtime environments where general interconnectivity between all services in all datacenters isn't feasible. These gateways operate by sniffing the SNI header out of the Connect session diff --git a/website/pages/docs/connect/native/index.mdx b/website/pages/docs/connect/native/index.mdx index 54fb11e923..bd15f17551 100644 --- a/website/pages/docs/connect/native/index.mdx +++ b/website/pages/docs/connect/native/index.mdx @@ -43,9 +43,7 @@ An overview of the sequence is shown below. The diagram and the following details may seem complex, but this is a _regular mutual TLS connection_ with an API call to verify the incoming client certificate. -
- ![Native Integration Overview](connect-native-overview.png) -
+![Native Integration Overview](/img/connect-native-overview.png) Details on the steps are below: diff --git a/website/pages/docs/connect/proxies/envoy.mdx b/website/pages/docs/connect/proxies/envoy.mdx index c3a904a3e1..876d6430d4 100644 --- a/website/pages/docs/connect/proxies/envoy.mdx +++ b/website/pages/docs/connect/proxies/envoy.mdx @@ -42,8 +42,7 @@ compatible Envoy versions. | 1.5.0, 1.5.1 | 1.9.1, 1.8.0† | | 1.3.x, 1.4.x | 1.9.1, 1.8.0†, 1.7.0† | -~> Note: - † Envoy versions lower than 1.9.1 are vulnerable to +~> **Note:** † Envoy versions lower than 1.9.1 are vulnerable to [CVE-2019-9900](https://github.com/envoyproxy/envoy/issues/6434) and [CVE-2019-9901](https://github.com/envoyproxy/envoy/issues/6435). Both are related to HTTP request parsing and so only affect Consul Connect users if they @@ -115,16 +114,15 @@ definition](/docs/connect/registration/service-registration.html) or users can configure this property once in the [global `proxy-defaults` configuration entry](/docs/agent/config-entries/proxy-defaults.html) for convenience. Currently, TCP is not supported. - ~> **Note:** currently the url **must use an ip address** not a dns name due - to the way Envoy is setup for StatsD. - - Users can also specify the whole parameter in the form `$ENV_VAR_NAME`, which - will cause the `consul connect envoy` command to resolve the actual URL from - the named environment variable when it runs. This, for example, allows each - pod in a Kubernetes cluster to learn of a pod-specific IP address for StatsD - when the Envoy instance is bootstrapped while still allowing global - configuration of all proxies to use StatsD in the [global `proxy-defaults` + ~> **Note:** currently the url **must use an ip address** not a dns name due + to the way Envoy is setup for StatsD. + Users can also specify the whole parameter in the form `$ENV_VAR_NAME`, which + will cause the `consul connect envoy` command to resolve the actual URL from + the named environment variable when it runs. This, for example, allows each + pod in a Kubernetes cluster to learn of a pod-specific IP address for StatsD + when the Envoy instance is bootstrapped while still allowing global + configuration of all proxies to use StatsD in the [global `proxy-defaults` configuration entry](/docs/agent/config-entries/proxy-defaults.html). The env variable must contain a full valid URL value as specified above and nothing else. It is not currently possible to use environment variables as only part of the URL. diff --git a/website/pages/docs/guides/monitoring-telegraf.mdx b/website/pages/docs/guides/monitoring-telegraf.mdx index d90cdc373b..402a6d059c 100644 --- a/website/pages/docs/guides/monitoring-telegraf.mdx +++ b/website/pages/docs/guides/monitoring-telegraf.mdx @@ -198,10 +198,7 @@ Telegraf. Here is an example Grafana dashboard: -
- [![Grafana Consul - Cluster](/img/grafana-screenshot.png)](/img/grafana-screenshot.png) -
+[![Grafana Consul Cluster](/img/grafana-screenshot.png)](/img/grafana-screenshot.png) ## Metric Aggregates and Alerting from Telegraf diff --git a/website/pages/docs/k8s/ambassador.mdx b/website/pages/docs/k8s/ambassador.mdx index 8c28cac6ce..1c482d8561 100644 --- a/website/pages/docs/k8s/ambassador.mdx +++ b/website/pages/docs/k8s/ambassador.mdx @@ -4,7 +4,7 @@ page_title: Ambassador Integration - Kubernetes sidebar_title: 'Ambassador Integration' sidebar_current: docs-platform-k8s-ambassador description: |- - Ambassador is a Kubernetes-native API gateway and ingress controller that + Ambassador is a Kubernetes-native API gateway and ingress controller that integrates well with Consul Connect. --- @@ -94,7 +94,6 @@ should display the output from the static service. ```bash kubectl describe service ambassador - ``` ## Enabling end-to-end TLS @@ -157,7 +156,9 @@ You should now be able to test the SSL connection from your browser. When Ambassador is unable to establish an authenticated connection to the Connect proxy servers, browser connections will display this message: - upstream connect error or disconnect/reset before headers +```text +upstream connect error or disconnect/reset before headers +``` This error can have a number of different causes. Here are some things to check and troubleshooting steps you can take. @@ -167,88 +168,112 @@ If you followed the above installation guide, Consul should have registered a se To check whether Ambassador is allowed to connect, use the [`intention check`][intention-check] subcommand. - $ consul intention check ambassador http-echo - Allowed +```shell +$ consul intention check ambassador http-echo +Allowed +``` ### Confirm upstream proxy sidecar is running First, find the name of the pod that contains your service. - $ kubectl get pods -l app=http-echo,role=server - NAME READY STATUS RESTARTS AGE - http-echo-7fb79566d6-jmccp 2/2 Running 0 1d +```shell +$ kubectl get pods -l app=http-echo,role=server +NAME READY STATUS RESTARTS AGE +http-echo-7fb79566d6-jmccp 2/2 Running 0 1d +``` Then describe the pod to make sure that the sidecar is present and running. - $ kubectl describe pod http-echo-7fb79566d6-jmccp - [...] - Containers: - consul-connect-envoy-sidecar: - [...] - State: Running - Ready: True +```shell +$ kubectl describe pod http-echo-7fb79566d6-jmccp +[...] +Containers: + consul-connect-envoy-sidecar: + [...] + State: Running + Ready: True +``` ### Start up a downstream proxy and try connecting to it Log into one of your Consul server pods (or any pod that has a Consul binary in it). - $ kubectl exec -ti consul-server-0 -- /bin/sh +```shell +$ kubectl exec -ti consul-server-0 -- /bin/sh +``` Once inside the pod, try starting a test proxy. Use the name of your service in place of `http-echo`. - # consul connect proxy -service=ambassador -upstream http-echo:1234 - ==> Consul Connect proxy starting... - Configuration mode: Flags - Service: http-echo-client - Upstream: http-echo => :1234 - Public listener: Disabled +```shell +# consul connect proxy -service=ambassador -upstream http-echo:1234 +==> Consul Connect proxy starting... +Configuration mode: Flags + Service: http-echo-client + Upstream: http-echo => :1234 + Public listener: Disabled +``` If the proxy starts successfully, try connecting to it. Verify the output is as you expect. - # curl localhost:1234 - "hello world" +```shell +# curl localhost:1234 +"hello world" +``` Don't forget to kill the test proxy when you're done. - # kill %1 - ==> Consul Connect proxy shutdown +```shell +# kill %1 +==> Consul Connect proxy shutdown - # exit +# exit +``` ### Check Ambassador Connect sidecar logs Find the name of the Connect Integration pod and make sure it is running. - $ kubectl get pods -l app=ambassador-pro,component=consul-connect - NAME READY STATUS RESTARTS AGE - ambassador-pro-consul-connect-integration-f88fcb99f-hxk75 1/1 Running 0 1d +```shell +$ kubectl get pods -l app=ambassador-pro,component=consul-connect +NAME READY STATUS RESTARTS AGE +ambassador-pro-consul-connect-integration-f88fcb99f-hxk75 1/1 Running 0 1d +``` Dump the logs from the integration pod. If the service is running correctly, there won't be much in there. - $ kubectl logs ambassador-pro-consul-connect-integration-f88fcb99f-hxk75 +```shell +$ kubectl logs ambassador-pro-consul-connect-integration-f88fcb99f-hxk75 - time="2019-03-13T19:42:12Z" level=info msg="Starting Consul Connect Integration" consul_host=10.142.0.21 consul_port=8500 version=0.2.3 - 2019/03/13 19:42:12 Watching CA leaf for ambassador - time="2019-03-13T19:42:12Z" level=debug msg="Computed kubectl command and arguments" args="[kubectl apply -f -]" - time="2019-03-13T19:42:14Z" level=info msg="Updating TLS certificate secret" namespace= secret=ambassador-consul-connect +time="2019-03-13T19:42:12Z" level=info msg="Starting Consul Connect Integration" consul_host=10.142.0.21 consul_port=8500 version=0.2.3 +2019/03/13 19:42:12 Watching CA leaf for ambassador +time="2019-03-13T19:42:12Z" level=debug msg="Computed kubectl command and arguments" args="[kubectl apply -f -]" +time="2019-03-13T19:42:14Z" level=info msg="Updating TLS certificate secret" namespace= secret=ambassador-consul-connect +``` ### Check Ambassador logs Make sure the Ambassador pod itself is running. - $ kubectl get pods -l service=ambassador - NAME READY STATUS RESTARTS AGE - ambassador-655875b5d9-vpc2v 2/2 Running 0 1d +```shell +$ kubectl get pods -l service=ambassador +NAME READY STATUS RESTARTS AGE +ambassador-655875b5d9-vpc2v 2/2 Running 0 1d +``` Finally, check the logs for the main Ambassador pod. - $ kubectl logs ambassador-655875b5d9-vpc2v +```shell +$ kubectl logs ambassador-655875b5d9-vpc2v +``` ### Check Ambassador admin interface Forward the admin port from the Ambassador pod to your local machine. - $ kubectl port-forward pods/ambassador-655875b5d9-vpc2v 8877:8877 +```shell +$ kubectl port-forward pods/ambassador-655875b5d9-vpc2v 8877:8877 +``` You should then be able to open http://localhost:8877/ambassador/v0/diag/ in your browser and view Ambassador's routing table. The table lists each URL mapping that has been set up. Service names will appear in green if Ambassador believes they are healthy, and red otherwise. diff --git a/website/pages/docs/k8s/connect.mdx b/website/pages/docs/k8s/connect.mdx index 12007aad50..9d48b8e58a 100644 --- a/website/pages/docs/k8s/connect.mdx +++ b/website/pages/docs/k8s/connect.mdx @@ -1,7 +1,7 @@ --- layout: docs page_title: Connect Sidecar - Kubernetes -sidebar_title: 'Kubernetes' +sidebar_title: 'Connect Sidecar' sidebar_current: docs-platform-k8s-connect description: >- Connect is a feature built into to Consul that enables automatic @@ -441,19 +441,19 @@ There are three options available: 1. **Single Destination Namespace** – Register all Kubernetes pods, regardless of namespace, into the same Consul namespace. - This can be configured with: + This can be configured with: - ```yaml - global: - enableConsulNamespaces: true + ```yaml + global: + enableConsulNamespaces: true - connectInject: - enabled: true - consulNamespaces: - consulDestinationNamespace: "my-consul-ns" - ``` + connectInject: + enabled: true + consulNamespaces: + consulDestinationNamespace: 'my-consul-ns' + ``` - -> **NOTE:** If the destination namespace does not exist we will create it. + -> **NOTE:** If the destination namespace does not exist we will create it. 1. **Mirror Namespaces** - Register each Kubernetes pod into a Consul namespace with the same name as its Kubernetes namespace. For example, pod `foo` in Kubernetes namespace `ns-1` will be synced to the Consul namespace `ns-1`. @@ -461,34 +461,32 @@ There are three options available: This can be configured with: - ````yaml + ```yaml global: - enableConsulNamespaces: true + enableConsulNamespaces: true - connectInject: - enabled: true - consulNamespaces: - mirroringK8S: true - ``` - - ```` + connectInject: + enabled: true + consulNamespaces: + mirroringK8S: true + ``` 1. **Mirror Namespaces With Prefix** - Register each Kubernetes pod into a Consul namespace with the same name as its Kubernetes namespace **with a prefix**. For example, given a prefix `k8s-`, pod `foo` in Kubernetes namespace `ns-1` will be synced to the Consul namespace `k8s-ns-1`. - This can be configured with: + This can be configured with: - ```yaml - global: - enableConsulNamespaces: true + ```yaml + global: + enableConsulNamespaces: true - connectInject: - enabled: true - consulNamespaces: - mirroringK8S: true - mirroringK8SPrefix: "k8s-" - ``` + connectInject: + enabled: true + consulNamespaces: + mirroringK8S: true + mirroringK8SPrefix: 'k8s-' + ``` ### Consul Enterprise Namespace Upstreams diff --git a/website/pages/docs/k8s/helm.mdx b/website/pages/docs/k8s/helm.mdx index 5a85c305b0..b13e9cd669 100644 --- a/website/pages/docs/k8s/helm.mdx +++ b/website/pages/docs/k8s/helm.mdx @@ -26,8 +26,7 @@ and consider if they're appropriate for your deployment. - `name` ((#v-global-name)) (`string: null`) - Set the prefix used for all resources in the Helm chart. If not set, the prefix will be `-consul`. - - `domain` ((#v-global-domain)) (`string: "consul"`) - The domain Consul will answer DNS queries for (see - [-domain](/docs/agent/options.html#_domain)) and the domain services synced from + - `domain` ((#v-global-domain)) (`string: "consul"`) - The domain Consul will answer DNS queries for (see [-domain](/docs/agent/options.html#_domain)) and the domain services synced from Consul into Kubernetes will have, e.g. `service-name.service.consul`. - `image` ((#v-global-image)) (`string: "consul:"`) - The name (and tag) of the Consul Docker image for clients and servers. This can be overridden per component. This should be pinned to a specific version tag, otherwise you may inadvertently upgrade your Consul version. @@ -59,7 +58,7 @@ and consider if they're appropriate for your deployment. The secret can be created by running: - ```bash + ```shell $ kubectl create secret generic consul-gossip-encryption-key --from-literal=key=$(consul keygen) # To reference, use: # gossipEncryption: @@ -130,98 +129,57 @@ and consider if they're appropriate for your deployment. --from-file='tls.key=./consul-agent-ca-key.pem' ``` - - - `secretName` - (`string: null`) - The name of the Kubernetes secret. + - `secretName` ((#v-global-cakey-secretname)) (`string: null`) - The name of the Kubernetes secret. - - - `secretKey` - (`string: null`) - The key of the Kubernetes secret. + - `secretKey` ((#v-global-cakey-secretkey)) (`string: null`) - The key of the Kubernetes secret. -- - `server` - - Values that configure running a Consul server within Kubernetes. +- `server` ((#v-server)) - Values that configure running a Consul server within Kubernetes. - - - `enabled` - (`boolean: global.enabled`) - If true, the chart will install all the resources - necessary for a Consul server cluster. If you're running Consul externally and + - `enabled` ((#v-server-enabled)) (`boolean: global.enabled`) - If true, the chart will install all + the resources necessary for a Consul server cluster. If you're running Consul externally and want agents within Kubernetes to join that cluster, this should probably be false. - - - `image` - (`string: global.image`) - The name of the Docker image (including any tag) - for the containers running Consul server agents. + - `image` ((#v-server-image)) (`string: global.image`) - The name of the Docker image (including any + tag) for the containers running Consul server agents. - - - `replicas` - (`integer: 3`) -The number of server agents to run. This determines the - fault tolerance of the cluster. Please see the [deployment table](/docs/internals/consensus.html#deployment-table) + - `replicas` ((#v-server-replicas)) (`integer: 3`) -The number of server agents to run. This + determines the fault tolerance of the cluster. Please see the [deployment table](/docs/internals/consensus.html#deployment-table) for more information. - - - `bootstrapExpect` - (`integer: 3`) - For new clusters, this is the number of servers to wait - for before performing the initial leader election and bootstrap of the cluster. - This must be less than or equal to `server.replicas`. This value is only used + - `bootstrapExpect` ((#v-server-bootstrapexpect)) (`integer: 3`) - For new clusters, this is the + number of servers to wait for before performing the initial leader election and bootstrap of the cluster. This must be less than or equal to `server.replicas`. This value is only used when bootstrapping new clusters, it has no effect during ongoing cluster maintenance. - - - `enterpriseLicense` - [Enterprise Only] - This value refers to a Kubernetes secret that you have - created that contains your enterprise license. It is required if you are using - an enterprise binary. Defining it here applies it to your cluster once a leader + - `enterpriseLicense` ((#v-server-enterpriselicense)) [Enterprise Only] - This value refers to a + Kubernetes secret that you have created that contains your enterprise license. It is required if you are using an enterprise binary. Defining it here applies it to your cluster once a leader has been elected. If you are not using an enterprise image or if you plan to introduce the license key via another route, then set these fields to null. - - - `secretName` - (`string: null`) - The name of the Kubernetes secret that holds the enterprise - license. The secret must be in the same namespace that Consul is installed - into. + - `secretName` ((#v-global-enterpriselicense-secretname)) (`string: null`) - The name of the + Kubernetes secret that holds the enterprise license. The secret must be in the same namespace that Consul is installed into. - - - `secretKey` - (`string: null`) - The key within the Kubernetes secret that holds the - enterprise license. + - `secretKey` ((#v-global-enterpriselicense-secretkey)) (`string: null`) - The key within the + Kubernetes secret that holds the enterprise license. - - - `storage` - (`string: 10Gi`) - This defines the disk size for configuring the servers' - StatefulSet storage. For dynamically provisioned storage classes, this is the + - `storage` ((#v-server-storage)) (`string: 10Gi`) - This defines the disk size for configuring the + servers' StatefulSet storage. For dynamically provisioned storage classes, this is the desired size. For manually defined persistent volumes, this should be set to the disk size of the attached volume. - - - `storageClass` - (`string: null`) - The StorageClass to use for the servers' StatefulSet - storage. It must be able to be dynamically provisioned if you want the storage + - `storageClass` ((#v-server-storageclass)) (`string: null`) - The StorageClass to use for the + servers' StatefulSet storage. It must be able to be dynamically provisioned if you want the storage to be automatically created. For example, to use [Local](https://kubernetes.io/docs/concepts/storage/storage-classes/#local) storage classes, the PersistentVolumeClaims would need to be manually created. A `null` value will use the Kubernetes cluster's default StorageClass. If a default StorageClass does not exist, you will need to create one. - - - `connect` - (`boolean: true`) - This will enable/disable [Connect](/docs/connect/index.html). - Setting this to true _will not_ automatically secure pod communication, this + - `connect` ((#v-server-connect)) (`boolean: true`) - This will enable/disable [Connect](/docs/connect/index.html). Setting this to true _will not_ automatically secure pod communication, this setting will only enable usage of the feature. Consul will automatically initialize a new CA and set of certificates. Additional Connect settings can be configured by setting the `server.extraConfig` value. - - - `resources` - (`string: null`) - The resource requests (CPU, memory, etc.) for each of - the server agents. This should be a multi-line string mapping directly to a Kubernetes + - `resources` ((#v-server-resources)) (`string: null`) - The resource requests (CPU, memory, etc.) + for each of the server agents. This should be a multi-line string mapping directly to a Kubernetes [ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#resourcerequirements-v1-core) object. If this isn't specified, then the pods won't request any specific amount of resources. **Setting this is highly recommended.** @@ -235,44 +193,22 @@ and consider if they're appropriate for your deployment. memory: "10Gi" ``` - - - `updatePartition` - (`integer: 0`) - This value is used to carefully control a rolling update - of Consul server agents. This value specifies the [partition](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions) + - `updatePartition` ((#v-server-updatepartition)) (`integer: 0`) - This value is used to carefully + control a rolling update of Consul server agents. This value specifies the [partition](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions) for performing a rolling update. Please read the linked Kubernetes documentation for more information. - - - `disruptionBudget` - - This configures the [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) - for the server cluster. + - `disruptionBudget` ((#v-server-disruptionbudget)) - This configures the [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the server cluster. - - - `enabled` - (`boolean: true`) - This will enable/disable registering a PodDisruptionBudget - for the server cluster. If this is enabled, it will only register the budget - so long as the server cluster is enabled. + - `enabled` ((#v-server-disruptionbudget-enabled)) (`boolean: true`) - This will enable/disable + registering a PodDisruptionBudget for the server cluster. If this is enabled, it will only register the budget so long as the server cluster is enabled. - - - `maxUnavailable` - (`integer: null`) - The maximum number of unavailable pods. By default, - this will be automatically computed based on the `server.replicas` value to - be `(n/2)-1`. If you need to set this to `0`, you will need to add a `--set - 'server.disruptionBudget.maxUnavailable=0'` flag to the helm chart installation + - `maxUnavailable` ((#v-server-disruptionbudget-maxunavailable)) (`integer: null`) - The maximum + number of unavailable pods. By default, this will be automatically computed based on the `server.replicas` value to be `(n/2)-1`. If you need to set this to `0`, you will need to add a `--set 'server.disruptionBudget.maxUnavailable=0'` flag to the helm chart installation command because of a limitation in the Helm templating language. - - - `extraConfig` - (`string: "{}"`) - A raw string of extra JSON [configuration](/docs/agent/options.html) - for Consul servers. This will be saved as-is into a ConfigMap that is read by - the Consul server agents. This can be used to add additional configuration that - isn't directly exposed by the chart. + - `extraConfig` ((#v-server-extraconfig)) (`string: "{}"`) - A raw string of extra JSON + [configuration](/docs/agent/options.html) for Consul servers. This will be saved as-is into a ConfigMap that is read by the Consul server agents. This can be used to add additional configuration that isn't directly exposed by the chart. ```yaml # ExtraConfig values are formatted as a multi-line string: @@ -288,31 +224,20 @@ and consider if they're appropriate for your deployment. --set 'server.extraConfig="{"log_level": "DEBUG"}"' ``` - - - `extraVolumes` - (`array: []`) - A list of extra volumes to mount for server agents. This + - `extraVolumes` ((#v-server-extravolumes)) (`array: []`) - A list of extra volumes to mount for server agents. This is useful for bringing in extra data that can be referenced by other configurations at a well known path, such as TLS certificates or Gossip encryption keys. The value of this should be a list of objects. Each object supports the following keys: - - - `type` - (`string: required`) - Type of the volume, must be one of "configMap" - or "secret". Case sensitive. + - `type` ((#v-server-extravolumes-type)) (`string: required`) - Type of the volume, must be one of + "configMap" or "secret". Case sensitive. - - - `name` - (`string: required`) - + - `name` ((#v-server-extravolumes-name)) (`string: required`) - Name of the configMap or secret to + be mounted. This also controls the path that it is mounted to. The volume will be mounted to `/consul/userconfig/`. - Name of the configMap or secret to be mounted. This also controls the path - that it is mounted to. The volume will be mounted to `/consul/userconfig/`. - - - - `load` - (`boolean: false`) - If true, then the agent will be configured to automatically - load HCL/JSON configuration files from this volume with `-config-dir`. This - defaults to false. + - `load` ((#v-server-extravolumes-load)) (`boolean: false`) - If true, then the agent will be + configured to automatically load HCL/JSON configuration files from this volume with `-config-dir`. This defaults to false. ```yaml extraVolumes: @@ -321,9 +246,7 @@ and consider if they're appropriate for your deployment. load: false ``` - - - `affinity` - (`string`) - This value defines the [affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) + - `affinity` ((#v-server-affinity)) (`string`) - This value defines the [affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) for server pods. It defaults to allowing only a single pod on each node, which minimizes risk of the cluster becoming unusable if a node is lost. If you need to run more pods per node (for example, testing on Minikube), set this value @@ -342,15 +265,10 @@ and consider if they're appropriate for your deployment. topologyKey: kubernetes.io/hostname ``` - - - `tolerations` - (`string: ""`) - Toleration settings for server pods. This should be a multi-line - string matching the [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) - array in a Pod spec. + - `tolerations` ((#v-server-tolerations)) (`string: ""`) - Toleration settings for server pods. This + should be a multi-line string matching the [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. - - - `nodeSelector` - (`string: null`) - This value defines [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) + - `nodeSelector` ((#v-server-nodeselector)) (`string: null`) - This value defines [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) labels for server pod assignment, formatted as a multi-line string. ```yaml @@ -358,15 +276,11 @@ and consider if they're appropriate for your deployment. beta.kubernetes.io/arch: amd64 ``` - - - `priorityClassName` - (`string`) - This value references an existing Kubernetes [priorityClassName](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#pod-priority) - that can be assigned to server pods. + - `priorityClassName` ((#v-server-priorityclassname)) (`string`) - This value references an existing + Kubernetes [priorityClassName](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#pod-priority) that can be assigned to server pods. - - - `annotations` - (`string`) - This value defines additional annotations for server pods. - This should be a formatted as a multi-line string. + - `annotations` ((#v-server-annotations)) (`string`) - This value defines additional annotations for + server pods. This should be a formatted as a multi-line string. ```yaml annotations: | @@ -374,66 +288,42 @@ and consider if they're appropriate for your deployment. "sample/annotation2": "bar" ``` - - - `service` - - Server service properties + - `service` ((#v-server-service)) - Server service properties - - - `annotations` - Annotations to apply to the server service. + - `annotations` ((#v-server-service-annotations)) Annotations to apply to the server service. ```yaml annotations: | "annotation-key": "annotation-value" ``` -- - `client` - - Values that configure running a Consul client on Kubernetes nodes. +- `client` ((#v-client)) - Values that configure running a Consul client on Kubernetes nodes. - - - `enabled` - (`boolean: global.enabled`) - If true, the chart will install all the resources - necessary for a Consul client on every Kubernetes node. This _does not_ require + - `enabled` ((#v-client-enabled)) (`boolean: global.enabled`) - If true, the chart will install all + the resources necessary for a Consul client on every Kubernetes node. This _does not_ require `server.enabled`, since the agents can be configured to join an external cluster. - - - `image` - (`string: global.image`) - The name of the Docker image (including any tag) - for the containers running Consul client agents. + - `image` ((#v-client-image)) (`string: global.image`) - The name of the Docker image (including any + tag) for the containers running Consul client agents. - `join` ((#v-client-join)) (`array: null`) - A list of valid [`-retry-join` values](/docs/agent/options.html#retry-join). If this is `null` (default), then the clients will attempt to automatically join the server cluster running within Kubernetes. This means that with `server.enabled` set to true, clients will automatically join that cluster. If `server.enabled` is not true, then a value must be specified so the clients can join a valid cluster. - - - `dataDirectoryPath` - (`string: null`) - An absolute path to a directory on the host machine to - use as the Consul client data directory. If set to the empty string or null, - the Consul agent will store its data in the Pod's local filesystem (which will + - `dataDirectoryPath` ((#v-client-datadirectorypath)) (`string: null`) - An absolute path to a + directory on the host machine to use as the Consul client data directory. If set to the empty string or null, the Consul agent will store its data in the Pod's local filesystem (which will be lost if the Pod is deleted). Security Warning: If setting this, Pod Security - Policies _must_ be enabled on your cluster and in this Helm chart (via the global.enablePodSecurityPolicies - setting) to prevent other Pods from mounting the same host path and gaining access - to all of Consul's data. Consul's data is not encrypted at rest. + Policies _must_ be enabled on your cluster and in this Helm chart (via the global.enablePodSecurityPolicies setting) to prevent other Pods from mounting the same host path and gaining access to all of Consul's data. Consul's data is not encrypted at rest. - - - `grpc` - (`boolean: true`) - If true, agents will enable their GRPC listener on port - 8502 and expose it to the host. This will use slightly more resources, but is + - `grpc` ((#v-client-grpc)) (`boolean: true`) - If true, agents will enable their GRPC listener on + port 8502 and expose it to the host. This will use slightly more resources, but is required for [Connect](/docs/platform/k8s/connect.html). - - - `exposeGossipPorts` - (`boolean: false`) - If true, the Helm chart will expose the clients' gossip - ports as hostPorts. This is only necessary if pod IPs in the k8s cluster are - not directly routable and the Consul servers are outside of the k8s cluster. + - `exposeGossipPorts` ((#v-client-exposegossipports)) (`boolean: false`) - If true, the Helm chart + will expose the clients' gossip ports as hostPorts. This is only necessary if pod IPs in the k8s cluster are not directly routable and the Consul servers are outside of the k8s cluster. This also changes the clients' advertised IP to the `hostIP` rather than `podIP`. - - - `resources` - (`string: null`) - The resource requests (CPU, memory, etc.) for each of - the client agents. This should be a multi-line string mapping directly to a Kubernetes - [ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#resourcerequirements-v1-core) - object. If this isn't specified, then the pods won't request any specific amount - of resources. + - `resources` ((#v-client-resources)) (`string: null`) - The resource requests (CPU, memory, etc.) + for each of the client agents. This should be a multi-line string mapping directly to a Kubernetes + [ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#resourcerequirements-v1-core) object. If this isn't specified, then the pods won't request any specific amount of resources. ```yaml # Resources are defined as a formatted multi-line string: @@ -444,12 +334,8 @@ and consider if they're appropriate for your deployment. memory: "10Gi" ``` - - - `extraConfig` - (`string: "{}"`) - A raw string of extra JSON [configuration](/docs/agent/options.html) - for Consul clients. This will be saved as-is into a ConfigMap that is read by - the Consul agents. This can be used to add additional configuration that isn't - directly exposed by the chart. + - `extraConfig` ((#v-client-extraconfig)) (`string: "{}"`) - A raw string of extra JSON + [configuration](/docs/agent/options.html) for Consul clients. This will be saved as-is into a ConfigMap that is read by the Consul agents. This can be used to add additional configuration that isn't directly exposed by the chart. ```yaml # ExtraConfig values are formatted as a multi-line string: @@ -465,31 +351,19 @@ and consider if they're appropriate for your deployment. --set 'client.extraConfig="{"log_level": "DEBUG"}"' ``` - - - `extraVolumes` - (`array: []`) - A list of extra volumes to mount for client agents. This - is useful for bringing in extra data that can be referenced by other configurations - at a well known path, such as TLS certificates or Gossip encryption keys. The + - `extraVolumes` ((#v-client-extravolumes)) (`array: []`) - A list of extra volumes to mount for + client agents. This is useful for bringing in extra data that can be referenced by other configurations at a well known path, such as TLS certificates or Gossip encryption keys. The value of this should be a list of objects. Each object supports the following keys: - - - `type` - (`string: required`) - Type of the volume, must be one of "configMap" - or "secret". Case sensitive. + - `type` ((#v-client-extravolumes-type)) (`string: required`) - Type of the volume, must be one of + "configMap" or "secret". Case sensitive. - - - `name` - (`string: required`) - + - `name` ((#v-client-extravolumes-name)) (`string: required`) - Name of the configMap or secret to + be mounted. This also controls the path that it is mounted to. The volume will be mounted to `/consul/userconfig/`. - Name of the configMap or secret to be mounted. This also controls the path - that it is mounted to. The volume will be mounted to `/consul/userconfig/`. - - - - `load` - (`boolean: false`) - If true, then the agent will be configured to automatically - load HCL/JSON configuration files from this volume with `-config-dir`. This - defaults to false. + - `load` ((#v-client-extravolumes-load)) (`boolean: false`) - If true, then the agent will be + configured to automatically load HCL/JSON configuration files from this volume with `-config-dir`. This defaults to false. ```yaml extraVolumes: @@ -498,37 +372,27 @@ and consider if they're appropriate for your deployment. load: false ``` - - - `tolerations` - (`string: ""`) - Toleration Settings for client pods. This should be a multi-line - string matching the Toleration array in a Pod spec. The example below will allow - client pods to run on every node regardless of taints. + - `tolerations` ((#v-client-tolerations)) (`string: ""`) - Toleration Settings for client pods. This + should be a multi-line string matching the Toleration array in a Pod spec. The example below will allow client pods to run on every node regardless of taints. ```yaml tolerations: | - operator: "Exists" ``` - - - `nodeSelector` - (`string: null`) - Labels for client pod assignment, formatted as a multi-line - string. Please see [Kubernetes docs](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) - for more details. + - `nodeSelector` ((#v-client-nodeselector)) (`string: null`) - Labels for client pod assignment, + formatted as a multi-line string. Please see [Kubernetes docs](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) for more details. ```yaml nodeSelector: | beta.kubernetes.io/arch: amd64 ``` - - - `priorityClassName` - (`string: ""`) - This value references an existing Kubernetes [priorityClassName](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#pod-priority) - that can be assigned to client pods. + - `priorityClassName` ((#v-client-priorityclassname)) (`string: ""`) - This value references an + existing Kubernetes [priorityClassName](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#pod-priority) that can be assigned to client pods. - - - `annotations` - (`string: null`) - This value defines additional annotations for client - pods. This should be a formatted as a multi-line string. + - `annotations` ((#v-client-annotations)) (`string: null`) - This value defines additional + annotations for client pods. This should be a formatted as a multi-line string. ```yaml annotations: | @@ -536,14 +400,10 @@ and consider if they're appropriate for your deployment. "sample/annotation2": "bar" ``` - - - `dnsPolicy` - (`string: null`) - This value defines the [Pod DNS policy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) + - `dnsPolicy` ((#v-client-dnspolicy)) (`string: null`) - This value defines the [Pod DNS policy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) for client pods to use. - - - `updateStrategy` - (`string: null`) - The [update strategy](https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy) + - `updateStrategy` ((#v-client-updatestrategy)) (`string: null`) - The [update strategy](https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy) for the client `DaemonSet`. ```yaml @@ -553,365 +413,172 @@ and consider if they're appropriate for your deployment. type: RollingUpdate ``` - - - `snapshotAgent` - [Enterprise Only] - Values for setting up and running [snapshot agents](https://www.consul.io/docs/commands/snapshot/agent.html) + - `snapshotAgent` ((#v-client-snapshotagent)) [Enterprise Only] - Values for setting up and running [snapshot agents](https://www.consul.io/docs/commands/snapshot/agent.html) within the Consul clusters. They are required to be co-located with Consul clients, so will inherit the clients' nodeSelector, tolerations and affinity. - - - `enabled` - (`boolean: false`) - If true, the chart will install resources necessary - to run the snapshot agent. + - `enabled` ((#v-client-snapshotagent-enabled)) (`boolean: false`) - If true, the chart will + install resources necessary to run the snapshot agent. - - - `replicas` - (`integer: 2`) - The number of snapshot agents to run. + - `replicas` ((#v-client-snapshotagent-replicas)) (`integer: 2`) - The number of snapshot agents + to run. - - - `configSecret` - - A Kubernetes secret that should be manually created to contain the entire - config to be used on the snapshot agent. This is the preferred method of configuration - since there are usually storage credentials present. Please see [Snapshot agent - config](https://www.consul.io/docs/commands/snapshot/agent.html#config-file-options-) - for details. + - `configSecret` ((#v-client-snapshotagent-configsecret)) - A Kubernetes secret that should be + manually created to contain the entire config to be used on the snapshot agent. This is the preferred method of configuration since there are usually storage credentials present. Please see [Snapshot agent config](https://www.consul.io/docs/commands/snapshot/agent.html#config-file-options-) for details. - - - secretName{' '} - - `(string: null)` - The name of the Kubernetes secret. + - secretName ((#v-client-snapshotagent-configsecret-secretname)) `(string: null)` - The name of the Kubernetes secret. - - - secretKey{' '} - - `(string: null)` - The key for the Kubernetes secret. + - secretKey ((#v-client-snapshotagent-configsecret-secretkey)) `(string: null)` - The key for the Kubernetes secret. -- - `dns` - - Values that configure Consul DNS service. +- `dns` ((#v-dns)) - Values that configure Consul DNS service. - - - `enabled` - (`boolean: global.enabled`) - If true, a `consul-dns` service will be created - that exposes port 53 for TCP and UDP to the running Consul agents (servers and + - `enabled` ((#v-dns-enabled)) (`boolean: global.enabled`) - If true, a `consul-dns` service will be + created that exposes port 53 for TCP and UDP to the running Consul agents (servers and clients). This can then be used to [configure kube-dns](/docs/platform/k8s/dns.html). The Helm chart _does not_ automatically configure kube-dns. - - - `clusterIP` - (`string: null`) - If defined, this value configures the cluster IP of the - DNS service. + - `clusterIP` ((#v-dns-clusterip)) (`string: null`) - If defined, this value configures the cluster + IP of the DNS service. - - - `annotations` - (`string: null`) - Extra annotations to attach to the DNS service. This - should be a multi-line string of annotations to apply to the DNS service. + - `annotations` ((#v-dns-annotations)) (`string: null`) - Extra annotations to attach to the DNS + service. This should be a multi-line string of annotations to apply to the DNS service. -- - `syncCatalog` - - Values that configure the [service sync](/docs/platform/k8s/service-sync.html) - process. +- `syncCatalog` ((#v-synccatalog)) - Values that configure the [service sync](/docs/platform/k8s/service-sync.html) process. - - - `enabled` - (`boolean: false`) - If true, the chart will install all the resources necessary - for the catalog sync process to run. + - `enabled` ((#v-synccatalog-enabled)) (`boolean: false`) - If true, the chart will install all the + resources necessary for the catalog sync process to run. - - - `image` - (`string: global.imageK8S`) - The name of the Docker image (including any - tag) for [consul-k8s](/docs/platform/k8s/index.html#quot-consul-k8s-quot-project) + - `image` ((#v-synccatalog-image)) (`string: global.imageK8S`) - The name of the Docker image + (including any tag) for [consul-k8s](/docs/platform/k8s/index.html#quot-consul-k8s-quot-project) to run the sync program. - - - `default` - (`boolean: true`) - If true, all valid services in K8S are synced by default. - If false, the service must be [annotated](/docs/platform/k8s/service-sync.html#sync-enable-disable) - properly to sync. In either case an annotation can override the default. + - `default` ((#v-synccatalog-default)) (`boolean: true`) - If true, all valid services in K8S are + synced by default. If false, the service must be [annotated](/docs/platform/k8s/service-sync.html#sync-enable-disable) properly to sync. In either case an annotation can override the default. - - - `toConsul` - (`boolean: true`) - If true, will sync Kubernetes services to Consul. This - can be disabled to have a one-way sync. + - `toConsul` ((#v-synccatalog-toconsul)) (`boolean: true`) - If true, will sync Kubernetes services + to Consul. This can be disabled to have a one-way sync. - - - `toK8S` - (`boolean: true`) - If true, will sync Consul services to Kubernetes. This - can be disabled to have a one-way sync. + - `toK8S` ((#v-synccatalog-tok8s)) (`boolean: true`) - If true, will sync Consul services to + Kubernetes. This can be disabled to have a one-way sync. - - - `k8sPrefix` - (`string: ""`) - A prefix to prepend to all services registered in Kubernetes - from Consul. This defaults to `""` where no prefix is prepended; Consul services - are synced with the same name to Kubernetes. (Consul -> Kubernetes sync only) + - `k8sPrefix` ((#v-synccatalog-k8sprefix)) (`string: ""`) - A prefix to prepend to all services + registered in Kubernetes from Consul. This defaults to `""` where no prefix is prepended; Consul services are synced with the same name to Kubernetes. (Consul -> Kubernetes sync only) - - - `k8sAllowNamespaces` - (`[]string: ["*"]`) - list of k8s namespaces to sync the k8s services from. - If a k8s namespace is not included in this list or is listed in `k8sDenyNamespaces`, - services in that k8s namespace will not be synced even if they are explicitly - annotated. Use `["*"]` to automatically allow all k8s namespaces. For example, + - `k8sAllowNamespaces` ((#v-synccatalog-k8sallownamespaces)) (`[]string: ["*"]`) - list of k8s + namespaces to sync the k8s services from. If a k8s namespace is not included in this list or is listed in `k8sDenyNamespaces`, services in that k8s namespace will not be synced even if they are explicitly annotated. Use `["*"]` to automatically allow all k8s namespaces. For example, `["namespace1", "namespace2"]` will only allow services in the k8s namespaces `namespace1` and `namespace2` to be synced and registered with Consul. All other k8s namespaces will be ignored. Note: `k8sDenyNamespaces` takes precedence over values defined here. Requires consul-k8s v0.12+ - - - `k8sDenyNamespaces` - (`[]string: ["kube-system", "kube-public"]` - list of k8s namespaces that - should not have their services synced. This list takes precedence over `k8sAllowNamespaces`. - `*` is not supported because then nothing would be allowed to sync. Requires - consul-k8s v0.12+. + - `k8sDenyNamespaces` ((#v-synccatalog-k8sdenynamespaces)) (`[]string: ["kube-system", "kube-public"]` - list of k8s namespaces that should not have their services synced. This list takes precedence over `k8sAllowNamespaces`. `*` is not supported because then nothing would be allowed to sync. Requires consul-k8s v0.12+. For example, if `k8sAllowNamespaces` is `["*"]` and `k8sDenyNamespaces` is `["namespace1", "namespace2"]`, then all k8s namespaces besides `namespace1` and `namespace2` will be synced. - - - `k8sSourceNamespace` - (`string: ""`) - **[DEPRECATED] Use `k8sAllowNamespaces` and `k8sDenyNamespaces` - instead.** `k8sSourceNamespace` is the Kubernetes namespace to watch for service - changes and sync to Consul. If this is not set then it will default to all namespaces. + - `k8sSourceNamespace` ((#v-synccatalog-k8ssourcenamespace)) (`string: ""`) - **[DEPRECATED] Use + `k8sAllowNamespaces` and `k8sDenyNamespaces` instead.** `k8sSourceNamespace` is the Kubernetes namespace to watch for service changes and sync to Consul. If this is not set then it will default to all namespaces. - - - `consulNamespaces` - - [Enterprise Only] These settings manage the catalog sync's interaction - with Consul namespaces (requires consul-ent v1.7+ and consul-k8s v0.12+). Also, - `global.enableConsulNamespaces` must be true. + - `consulNamespaces` ((#v-synccatalog-consulnamespaces)) - [Enterprise Only] These settings manage + the catalog sync's interaction with Consul namespaces (requires consul-ent v1.7+ and consul-k8s v0.12+). Also, `global.enableConsulNamespaces` must be true. - - - `consulDestinationNamespace` - (`string: "default"`) - Name of the Consul namespace to register all k8s + - `consulDestinationNamespace` ((#v-synccatalog-consulnamespaces-consuldestinationnamespace)) (`string: "default"`) - Name of the Consul namespace to register all k8s services into. If the Consul namespace does not already exist, it will be created. This will be ignored if `mirroringK8S` is true. - - - `mirroringK8S` - (`bool: false`) - causes k8s services to be registered into a Consul namespace - of the same name as their k8s namespace, optionally prefixed if `mirroringK8SPrefix` - is set below. If the Consul namespace does not already exist, it will be created. - Turning this on overrides the `consulDestinationNamespace` setting. `addK8SNamespaceSuffix` - may no longer be needed if enabling this option. + - `mirroringK8S` ((#v-synccatalog-consulnamespaces-mirroringk8s)) (`bool: false`) - causes k8s + services to be registered into a Consul namespace of the same name as their k8s namespace, optionally prefixed if `mirroringK8SPrefix` is set below. If the Consul namespace does not already exist, it will be created. Turning this on overrides the `consulDestinationNamespace` setting. `addK8SNamespaceSuffix` may no longer be needed if enabling this option. - - - `mirroringK8SPrefix` - (`string: ""`) - If `mirroringK8S` is set to true, `mirroringK8SPrefix` - allows each Consul namespace to be given a prefix. For example, if `mirroringK8SPrefix` - is set to `"k8s-"`, a service in the k8s `staging` namespace will be registered - into the `k8s-staging` Consul namespace. + - `mirroringK8SPrefix` ((#v-synccatalog-consulnamespaces-mirroringk8sprefix)) (`string: ""`) - If + `mirroringK8S` is set to true, `mirroringK8SPrefix` allows each Consul namespace to be given a prefix. For example, if `mirroringK8SPrefix` is set to `"k8s-"`, a service in the k8s `staging` namespace will be registered into the `k8s-staging` Consul namespace. - - - `addK8SNamespaceSuffix` - (`boolean: true`) - If true, sync catalog will append Kubernetes namespace - suffix to each service name synced to Consul, separated by a dash. For example, - for a service `foo` in the `default` namespace, the sync process will create - a Consul service named `foo-default`. Set this flag to true to avoid registering - services with the same name but in different namespaces as instances for the - same Consul service. Namespace suffix is not added if `annotationServiceName` - is provided. + - `addK8SNamespaceSuffix` ((#v-synccatalog-addk8snamespacesuffix)) (`boolean: true`) - If true, sync catalog will append Kubernetes namespace suffix to each service name synced to Consul, separated by a dash. For example, for a service `foo` in the `default` namespace, the sync process will create a Consul service named `foo-default`. Set this flag to true to avoid registering services with the same name but in different namespaces as instances for the same Consul service. Namespace suffix is not added if `annotationServiceName` is provided. - - - `consulPrefix` - (`string: ""`) - A prefix to prepend to all services registered in Consul - from Kubernetes. This defaults to `""` where no prefix is prepended. Service - names within Kubernetes remain unchanged. (Kubernetes -> Consul sync only) The - prefix is ignored if `annotationServiceName` is provided. + - `consulPrefix` ((#v-synccatalog-consulPrefix)) (`string: ""`) - A prefix to prepend to all services registered in Consul from Kubernetes. This defaults to `""` where no prefix is prepended. Service names within Kubernetes remain unchanged. (Kubernetes -> Consul sync only) The prefix is ignored if `annotationServiceName` is provided. - - - `k8sTag` - (`string: null`) - An optional tag that is applied to all of the Kubernetes - services that are synced into Consul. If nothing is set, this defaults to "k8s". - (Kubernetes -> Consul sync only) + - `k8sTag` ((#v-synccatalog-k8stag)) (`string: null`) - An optional tag that is applied to all of the Kubernetes services that are synced into Consul. If nothing is set, this defaults to "k8s". (Kubernetes -> Consul sync only) - - - `syncClusterIPServices` - (`boolean: true`) - If true, will sync Kubernetes ClusterIP services to - Consul. This can be disabled to have the sync ignore ClusterIP-type services. + - `syncClusterIPServices` ((#v-synccatalog-syncclusteripservices)) (`boolean: true`) - If true, will + sync Kubernetes ClusterIP services to Consul. This can be disabled to have the sync ignore ClusterIP-type services. - - - `nodePortSyncType` - (`string: ExternalFirst`) - Configures the type of syncing that happens - for NodePort services. The only valid options are: `ExternalOnly`, `InternalOnly`, - and `ExternalFirst`. `ExternalOnly` will only use a node's ExternalIP address + - `nodePortSyncType` ((#v-synccatalog-nodeportsynctype)) (`string: ExternalFirst`) - Configures the + type of syncing that happens for NodePort services. The only valid options are: `ExternalOnly`, `InternalOnly`, and `ExternalFirst`. `ExternalOnly` will only use a node's ExternalIP address for the sync, otherwise the service will not be synced. `InternalOnly` uses the node's InternalIP address. `ExternalFirst` will preferentially use the node's ExternalIP address, but if it doesn't exist, it will use the node's InternalIP address instead. - - - `aclSyncToken` - - references a Kubernetes [secret](https://kubernetes.io/docs/concepts/configuration/secret/#creating-your-own-secrets) + - `aclSyncToken` ((#v-synccatalog-acl-sync-token)) - references a Kubernetes [secret](https://kubernetes.io/docs/concepts/configuration/secret/#creating-your-own-secrets) that contains an existing Consul ACL token. This will provide the sync process the correct permissions. This is only needed if ACLs are enabled on the Consul cluster. - - - secretName{' '} - - `(string: null)` - The name of the Kubernetes secret. This defaults to null. + - `secretName` ((#v-synccatalog-acl-sync-token-secret-name)) `(string: null)` - The name of the Kubernetes secret. This defaults to null. - - - secretKey{' '} - - `(string: null)` - The key for the Kubernetes secret. This defaults to null. + - `secretKey` ((#v-synccatalog-acl-sync-token-secret-key)) `(string: null)` - The key for the Kubernetes secret. This defaults to null. - - - `nodeSelector` - (`string: null`) - This value defines [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) - labels for `syncCatalog` pod assignment, formatted as a multi-line string. + - `nodeSelector` ((#v-synccatalog-nodeselector)) (`string: null`) - This value defines + [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) labels for `syncCatalog` pod assignment, formatted as a multi-line string. ```yaml nodeSelector: | beta.kubernetes.io/arch: amd64 ``` - - - `logLevel` - (`string: info`) - Log verbosity level. One of "trace", "debug", "info", - "warn", or "error". + - `logLevel` ((#v-synccatalog-loglevel)) (`string: info`) - Log verbosity level. One of "trace", + "debug", "info", "warn", or "error". - - - `consulWriteInterval` - (`string: null`) - Override the default interval to perform syncing operations - creating Consul services. + - `consulWriteInterval` ((#v-synccatalog-consulwriteinterval)) (`string: null`) - Override the default interval to perform syncing operations creating Consul services. -- - `ui` - - Values that configure the Consul UI. +- `ui` ((#v-ui)) - Values that configure the Consul UI. - - - `enabled` - (`boolean: global.enabled`) - If true, the UI will be enabled. This will + - `enabled` ((#v-ui-enabled)) (`boolean: global.enabled`) - If true, the UI will be enabled. This will only _enable_ the UI, it doesn't automatically register any service for external access. The UI will only be enabled on server agents. If `server.enabled` is false, then this setting has no effect. To expose the UI in some way, you must configure `ui.service`. - - - `service` - - This configures the `Service` resource registered for the Consul UI. + - `service` ((#v-ui-service)) - This configures the `Service` resource registered for the Consul UI. - - - `enabled` - (`boolean: true`) - This will enable/disable registering a Kubernetes - Service for the Consul UI. This value only takes effect if `ui.enabled` is + - `enabled` ((#v-ui-service-enabled)) (`boolean: true`) - This will enable/disable registering a + Kubernetes Service for the Consul UI. This value only takes effect if `ui.enabled` is true and taking effect. - - - `type` - (`string: null`) - The service type to register. This defaults to `null` - which doesn't set an explicit service type, which typically is defaulted to + - `type` ((#v-ui-service-type)) (`string: null`) - The service type to register. This defaults to + `null` which doesn't set an explicit service type, which typically is defaulted to "ClusterIP" by Kubernetes. The available service types are documented on [the Kubernetes website](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types). - - - `annotations` - (`string: null`) - Annotations to apply to the UI service. + - `annotations` ((#v-ui-service-annotations)) (`string: null`) - Annotations to apply to the UI + service. ```yaml annotations: | "annotation-key": "annotation-value" ``` - - - `additionalSpec` - (`string: null`) - Additional Service spec values. This should be a multi-line - string mapping directly to a Kubernetes `Service` object. + - `additionalSpec` ((#v-ui-service-additionalspec)) (`string: null`) - Additional Service spec + values. This should be a multi-line string mapping directly to a Kubernetes `Service` object. -- - `connectInject` - - Values that configure running the [Connect injector](/docs/platform/k8s/connect.html). +- `connectInject` ((#v-connectinject)) - Values that configure running the [Connect injector](/docs/platform/k8s/connect.html). - - - `enabled` - (`boolean: false`) - If true, the chart will install all the resources necessary - for the Connect injector process to run. This will enable the injector but will + - `enabled` ((#v-connectinject-enabled)) (`boolean: false`) - If true, the chart will install all the + resources necessary for the Connect injector process to run. This will enable the injector but will require pods to opt-in with an annotation by default. - - - `image` - (`string: global.imageK8S`) - The name of the Docker image (including any - tag) for the [consul-k8s](https://github.com/hashicorp/consul-k8s) binary. + - `image` ((#v-connectinject-image)) (`string: global.imageK8S`) - The name of the Docker image + (including any tag) for the [consul-k8s](https://github.com/hashicorp/consul-k8s) binary. - - - `default` - (`boolean: false`) - If true, the injector will inject the Connect sidecar - into all pods by default. Otherwise, pods must specify the. [injection annotation](/docs/platform/k8s/connect.html#consul-hashicorp-com-connect-inject) + - `default` ((#v-connectinject-default)) (`boolean: false`) - If true, the injector will inject the + Connect sidecar into all pods by default. Otherwise, pods must specify the. [injection annotation](/docs/platform/k8s/connect.html#consul-hashicorp-com-connect-inject) to opt-in to Connect injection. If this is true, pods can use the same annotation to explicitly opt-out of injection. - - - `imageConsul` - (`string: global.image`) - The name of the Docker image (including any tag) - for Consul. This is used for proxy service registration, Envoy configuration, - etc. + - `imageConsul` ((#v-connectinject-imageConsul)) (`string: global.image`) - The name of the Docker + image (including any tag) for Consul. This is used for proxy service registration, Envoy configuration, etc. - - - `imageEnvoy` - (`string: ""`) - The name of the Docker image (including any tag) for the - Envoy sidecar. `envoy` must be on the executable path within this image. This - Envoy version must be compatible with the Consul version used by the injector. - If not specified this defaults to letting the injector choose the Envoy image. - Check [supported Envoy versions](/docs/connect/proxies/envoy.html#supported-versions) - to ensure the version you are using is compatible with Consul. + - `imageEnvoy` ((#v-connectinject-imageEnvoy)) (`string: ""`) - The name of the Docker image (including any tag) for the Envoy sidecar. `envoy` must be on the executable path within this image. This Envoy version must be compatible with the Consul version used by the injector. If not specified this defaults to letting the injector choose the Envoy image. Check [supported Envoy versions](/docs/connect/proxies/envoy.html#supported-versions) to ensure the version you are using is compatible with Consul. - - - `namespaceSelector` - (`string: ""`) - A [selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) + - `namespaceSelector` ((#v-connectinject-namespaceselector)) (`string: ""`) - A [selector](https:// + kubernetes.io/docs/concepts/overview/working-with-objects/labels/) for restricting injection to only matching namespaces. By default all namespaces except `kube-system` and `kube-public` will have injection enabled. @@ -921,116 +588,57 @@ and consider if they're appropriate for your deployment. namespace-label: label-value ``` - - - `k8sAllowNamespaces` - - list of k8s namespaces to allow Connect sidecar injection in. If a k8s - namespace is not included or is listed in `k8sDenyNamespaces`, pods in that k8s - namespace will not be injected even if they are explicitly annotated. Use `["*"]` - to automatically allow all k8s namespaces. + - `k8sAllowNamespaces` ((#v-connectinject-k8sallownamespaces)) - list of k8s namespaces to allow + Connect sidecar injection in. If a k8s namespace is not included or is listed in `k8sDenyNamespaces`, pods in that k8s namespace will not be injected even if they are explicitly annotated. Use `["*"]` to automatically allow all k8s namespaces. For example, `["namespace1", "namespace2"]` will only allow pods in the k8s namespaces `namespace1` and `namespace2` to have Connect sidecars injected and registered with Consul. All other k8s namespaces will be ignored. Note: `k8sDenyNamespaces` takes precedence over values defined here and `namespaceSelector` takes precedence over both since it is applied first. `kube-system` and `kube-public` are never injected, even if included here. Requires consul-k8s v0.12+ - - - `k8sDenyNamespaces` - - list of k8s namespaces that should not allow Connect sidecar injection. - This list takes precedence over `k8sAllowNamespaces`. `*` is not supported because - then nothing would be allowed to be injected. + - `k8sDenyNamespaces` ((#v-connectinject-k8sdenynamespaces)) - list of k8s namespaces that should not + allow Connect sidecar injection. This list takes precedence over `k8sAllowNamespaces`. `*` is not supported because then nothing would be allowed to be injected. For example, if `k8sAllowNamespaces` is `["*"]` and `k8sDenyNamespaces` is `["namespace1", "namespace2"]`, then all k8s namespaces besides `namespace1` and `namespace2` will be injected. Note: `namespaceSelector` takes precedence over this since it is applied first. `kube-system` and `kube-public` are never injected. Requires consul-k8s v0.12+. - - - `consulNamespaces` - - [Enterprise Only] These settings manage the connect injector's interaction - with Consul namespaces (requires consul-ent v1.7+ and consul-k8s v0.12+). Also, - `global.enableConsulNamespaces` must be true. + - `consulNamespaces` ((#v-connectinject-consulnamespaces)) - [Enterprise Only] These settings manage + the connect injector's interaction with Consul namespaces (requires consul-ent v1.7+ and consul-k8s v0.12+). Also, `global.enableConsulNamespaces` must be true. - - - `consulDestinationNamespace` - (`string: "default"`) - Name of the Consul namespace to register all k8s - services into. If the Consul namespace does not already exist, it will be created. + - `consulDestinationNamespace` ((#v-connectinject-consulnamespaces-consuldestinationnamespace)) + (`string: "default"`) - Name of the Consul namespace to register all k8s services into. If the Consul namespace does not already exist, it will be created. This will be ignored if `mirroringK8S` is true. - - - `mirroringK8S` - (`bool: false`) - causes k8s services to be registered into a Consul namespace - of the same name as their k8s namespace, optionally prefixed if `mirroringK8SPrefix` - is set below. If the Consul namespace does not already exist, it will be created. - Turning this on overrides the `consulDestinationNamespace` setting. + - `mirroringK8S` ((#v-connectinject-consulnamespaces-mirroringk8s)) (`bool: false`) - causes k8s + services to be registered into a Consul namespace of the same name as their k8s namespace, optionally prefixed if `mirroringK8SPrefix` is set below. If the Consul namespace does not already exist, it will be created. Turning this on overrides the `consulDestinationNamespace` setting. - - - `mirroringK8SPrefix` - (`string: ""`) - If `mirroringK8S` is set to true, `mirroringK8SPrefix` - allows each Consul namespace to be given a prefix. For example, if `mirroringK8SPrefix` - is set to `"k8s-"`, a service in the k8s `staging` namespace will be registered - into the `k8s-staging` Consul namespace. + - `mirroringK8SPrefix` ((#v-connectinject-consulnamespaces-mirroringk8sprefix)) (`string: ""`) - If + `mirroringK8S` is set to true, `mirroringK8SPrefix` allows each Consul namespace to be given a prefix. For example, if `mirroringK8SPrefix` is set to `"k8s-"`, a service in the k8s `staging` namespace will be registered into the `k8s-staging` Consul namespace. - - - `certs` - - The certs section configures how the webhook TLS certs are configured. - These are the TLS certs for the Kube apiserver communicating to the webhook. + - `certs` ((#v-connectinject-certs)) - The certs section configures how the webhook TLS certs are + configured. These are the TLS certs for the Kube apiserver communicating to the webhook. By default, the injector will generate and manage its own certs, but this requires the ability for the injector to update its own `MutatingWebhookConfiguration`. In a production environment, custom certs should probably be used. Configure the values below to enable this. - - - `secretName` - (`string: null`) - secretName is the name of the Kubernetes secret that - has the TLS certificate and private key to serve the injector webhook. If this - is null, then the injector will default to its automatic management mode. + - `secretName` ((#v-connectinject-certs-secretname)) (`string: null`) - secretName is the name of + the Kubernetes secret that has the TLS certificate and private key to serve the injector webhook. If this is null, then the injector will default to its automatic management mode. - - - `caBundle` - (`string: ""`) - The PEM-encoded CA public certificate bundle for the - TLS certificate served by the injector. This must be specified as a string + - `caBundle` ((#v-connectinject-cabundle)) (`string: ""`) - The PEM-encoded CA public certificate + bundle for the TLS certificate served by the injector. This must be specified as a string and can't come from a secret because it must be statically configured on the Kubernetes `MutatingAdmissionWebhook` resource. This only needs to be specified if `secretName` is not null. - - - `certName` - (`string: "tls.crt"`) - The name of the certificate file within the `secretName` - secret. + - `certName` ((#v-connectinject-certs-certname)) (`string: "tls.crt"`) - The name of the + certificate file within the `secretName` secret. - - - `keyName` - (`string: "tls.key"`) - The name of the private key for the certificate - file within the `secretName` secret. + - `keyName` ((#v-connectinject-certs-keyname)) (`string: "tls.key"`) - The name of the private key + for the certificate file within the `secretName` secret. - - - `nodeSelector` - (`string: null`) - This value defines [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) + - `nodeSelector` ((#v-connectinject-nodeselector)) (`string: null`) - This value defines + [`nodeSelector`](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) labels for `connectInject` pod assignment, formatted as a multi-line string. ```yaml @@ -1038,89 +646,33 @@ and consider if they're appropriate for your deployment. beta.kubernetes.io/arch: amd64 ``` - - - `aclBindingRuleSelector` - (`string: "serviceaccount.name!=default"`) - A [selector](/docs/acl/acl-auth-methods.html#binding-rules) + - `aclBindingRuleSelector` ((#v-connectinject-acl-bindingrule-selector)) (`string: "serviceaccount.name!=default"`) - A [selector](/docs/acl/acl-auth-methods.html#binding-rules) for restricting automatic injection to only matching services based on their associated service account. By default, services using the `default` Kubernetes service account will be prevented from logging in. This only has effect if ACLs are enabled. Requires Consul 1.5+ and consul-k8s 0.8.0+. - - - `overrideAuthMethodName` - (`string: ""`) - If not using `global.acls.manageSystemACLs` and instead + - `overrideAuthMethodName` ((#v-connectinject-overrideauthmethodname)) (`string: ""`) - If not using `global.acls.manageSystemACLs` and instead manually setting up an auth method for Connect inject, set this to the name of your Auth method. - - - `aclInjectToken` - - Refers to a Kubernetes secret that you have created that contains an ACL - token for your Consul cluster which allows the Connect injector the correct permissions. - This is only needed if Consul namespaces and ACLs are enabled on the Consul cluster - and you are not setting `global.acls.manageSystemACLs` to `true`. This token - needs to have `operator = "write"` privileges so that it can create namespaces. + - `aclInjectToken` ((#v-connectinject-aclinjecttoken)) - Refers to a Kubernetes secret that you have created that contains an ACL token for your Consul cluster which allows the Connect injector the correct permissions. This is only needed if Consul namespaces and ACLs are enabled on the Consul cluster and you are not setting `global.acls.manageSystemACLs` to `true`. This token needs to have `operator = "write"` privileges so that it can create namespaces. - - - secretName{' '} - - `(string: null)` - The name of the Kubernetes secret. + - `secretName` ((#v-connectinject-aclinjecttoken-secretname)) `(string: null)` - The name of the Kubernetes secret. - - - secretKey{' '} - - `(string: null)` - The key within the Kubernetes secret that holds the acl - token. + - `secretKey` ((#v-connectinject-aclinjecttoken-secretkey)) `(string: null)` - The key within the Kubernetes secret that holds the acl token. - - - `centralConfig` - - Values that configure Consul's [central configuration](/docs/agent/config_entries.html) + - `centralConfig` ((#v-connectinject-centralconfig)) - Values that configure Consul's [central configuration](/docs/agent/config_entries.html) feature (requires Consul v1.5+ and consul-k8s v0.8.1+). - - - `enabled` - (`boolean: true`) - Turns on the central configuration feature. Pods that - have a Connect proxy injected will have their service automatically registered - in this central configuration. + - `enabled` ((#v-connectinject-centralconfig-enabled)) (`boolean: true`) - Turns on the central + configuration feature. Pods that have a Connect proxy injected will have their service automatically registered in this central configuration. - - - `defaultProtocol` - (`string: null`) - If defined, this value will be used as the default - protocol type for all services registered with the central configuration. This - can be overridden by using the [protocol annotation](/docs/platform/k8s/connect.html#consul-hashicorp-com-connect-service-protocol) - directly on any pod spec. + - `defaultProtocol` ((#v-connectinject-centralconfig-defaultprotocol)) (`string: null`) - If + defined, this value will be used as the default protocol type for all services registered with the central configuration. This can be overridden by using the [protocol annotation](/docs/platform/k8s/connect.html#consul-hashicorp-com-connect-service-protocol) directly on any pod spec. - - - `proxyDefaults` - (`string: "{}"`) - This value is a raw json string that will be applied - to all Connect proxy sidecar pods. It can include any valid configuration for - the configured proxy. + - `proxyDefaults` ((#v-connectinject-centralconfig-proxydefaults)) (`string: "{}"`) - This value is + a raw json string that will be applied to all Connect proxy sidecar pods. It can include any valid configuration for the configured proxy. ```yaml # proxyDefaults values are formatted as a multi-line string: @@ -1130,14 +682,10 @@ and consider if they're appropriate for your deployment. } ``` -- - `tests` - - Control whether to enable a test for this Helm chart. +- `tests` ((#v-tests)) - Control whether to enable a test for this Helm chart. - - - `enabled` - (`boolean: true`) If true, the test Pod manifest will be generated to be - used as a Helm test. The pod will be created when a `helm test` command is executed. + - `enabled` ((#v-tests-enabled)) (`boolean: true`) If true, the test Pod manifest will be generated + to be used as a Helm test. The pod will be created when a `helm test` command is executed. ## Helm Chart Examples diff --git a/website/pages/docs/k8s/index.mdx b/website/pages/docs/k8s/index.mdx index 4946889156..37df260552 100644 --- a/website/pages/docs/k8s/index.mdx +++ b/website/pages/docs/k8s/index.mdx @@ -51,18 +51,16 @@ Kubernetes can choose to leverage Consul. There are several ways to try Consul with Kubernetes in different environments. -Guides +**Guides** - The [Getting Started with Consul Service Mesh track](https://learn.hashicorp.com/consul/gs-consul-service-mesh/understand-consul-service-mesh?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) walks you through installing Consul as service mesh for Kubernetes using the Helm chart, deploying services in the service mesh, and using intentions to secure service communications. -- The [Consul and minikube guide](https://learn.hashicorp.com/consul/ - getting-started-k8s/minikube?utm_source=consul.io&utm_medium=docs) is a quick walk through of how to deploy Consul with the official Helm chart on a local instance of Minikube. +- The [Consul and minikube guide](https://learn.hashicorp.com/consul/getting-started-k8s/minikube?utm_source=consul.io&utm_medium=docs) is a quick walk through of how to deploy Consul with the official Helm chart on a local instance of Minikube. -- The [Deploying Consul with Kubernetes guide](https://learn.hashicorp.com/ - consul/getting-started-k8s/minikube?utm_source=consul.io&utm_medium=docs) +- The [Deploying Consul with Kubernetes guide](https://learn.hashicorp.com/consul/getting-started-k8s/minikube?utm_source=consul.io&utm_medium=docs) walks you through deploying Consul on Kubernetes with the official Helm chart and can be applied to any Kubernetes installation type. - Review production best practices and cloud-specific configurations for deploying Consul on managed Kubernetes runtimes. @@ -76,7 +74,7 @@ Guides - The [Consul and Kubernetes Deployment](https://learn.hashicorp.com/consul/day-1-operations/kubernetes-deployment-guide?utm_source=consul.io&utm_medium=docs) guide covers the necessary steps to install and configure a new Consul cluster on Kubernetes in production. -Documentation +**Documentation** - [Installing Consul](/docs/platform/k8s/run.html) covers how to install Consul using the Helm chart. - [Helm Chart Reference](/docs/platform/k8s/helm.html) describes the different options for configuring the Helm chart. diff --git a/website/pages/docs/k8s/installation/predefined-pvcs.mdx b/website/pages/docs/k8s/installation/predefined-pvcs.mdx index 269c5dd567..75fe02d866 100644 --- a/website/pages/docs/k8s/installation/predefined-pvcs.mdx +++ b/website/pages/docs/k8s/installation/predefined-pvcs.mdx @@ -10,7 +10,7 @@ description: Using predefined Persistent Volume Claims The only way to use a pre-created PVC is to name them in the format Kubernetes expects: -``` +```text data---consul-server- ``` @@ -20,7 +20,7 @@ need as many PVCs as you have Consul servers. For example, given a Kubernetes namespace of "vault," a release name of "consul," and 5 servers, you would need to create PVCs with the following names: -``` +```text data-vault-consul-consul-server-0 data-vault-consul-consul-server-1 data-vault-consul-consul-server-2 diff --git a/website/pages/docs/k8s/operations/tls-on-existing-cluster.mdx b/website/pages/docs/k8s/operations/tls-on-existing-cluster.mdx index e79f6a48d0..148bd32cfe 100644 --- a/website/pages/docs/k8s/operations/tls-on-existing-cluster.mdx +++ b/website/pages/docs/k8s/operations/tls-on-existing-cluster.mdx @@ -20,21 +20,20 @@ If you're **not using Consul Connect**, follow this process. 1. Run a Helm upgrade with the following config: + ```yaml + global: + tls: + enabled: true + # This configuration sets `verify_outgoing`, `verify_server_hostname`, + # and `verify_incoming` to `false` on servers and clients, + # which allows TLS-disabled nodes to join the cluster. + verify: false + server: + updatePartition: + ``` - ```yaml - global: - tls: - enabled: true - # This configuration sets `verify_outgoing`, `verify_server_hostname`, - # and `verify_incoming` to `false` on servers and clients, - # which allows TLS-disabled nodes to join the cluster. - verify: false - server: - updatePartition: - ``` - - This upgrade will trigger a rolling update of the clients, as well as any - other `consul-k8s` components, such as sync catalog or client snapshot deployments. +This upgrade will trigger a rolling update of the clients, as well as any +other `consul-k8s` components, such as sync catalog or client snapshot deployments. 1. Perform a rolling upgrade of the servers, as described in [Upgrade Consul Servers](/docs/platform/k8s/upgrading.html#upgrading-consul-servers). @@ -58,25 +57,24 @@ applications to it. 1. Create the following Helm config file for the upgrade: + ```yaml + global: + tls: + enabled: true + # This configuration sets `verify_outgoing`, `verify_server_hostname`, + # and `verify_incoming` to `false` on servers and clients, + # which allows TLS-disabled nodes to join the cluster. + verify: false + server: + updatePartition: + client: + updateStrategy: | + type: OnDelete + ``` - ```yaml - global: - tls: - enabled: true - # This configuration sets `verify_outgoing`, `verify_server_hostname`, - # and `verify_incoming` to `false` on servers and clients, - # which allows TLS-disabled nodes to join the cluster. - verify: false - server: - updatePartition: - client: - updateStrategy: | - type: OnDelete - ``` - - In this configuration, we're setting `server.updatePartition` to the number of - server replicas as described in [Upgrade Consul Servers](/docs/platform/k8s/upgrading.html#upgrading-consul-servers) - and `client.updateStrategy` to `OnDelete` to manually trigger an upgrade of the clients. + In this configuration, we're setting `server.updatePartition` to the number of + server replicas as described in [Upgrade Consul Servers](/docs/platform/k8s/upgrading.html#upgrading-consul-servers) + and `client.updateStrategy` to `OnDelete` to manually trigger an upgrade of the clients. 1. Run `helm upgrade` with the above config file. The upgrade will trigger an update of all components except clients and servers, such as the Consul Connect webhook deployment diff --git a/website/pages/docs/k8s/service-sync.mdx b/website/pages/docs/k8s/service-sync.mdx index 04c43144bd..7e993a8859 100644 --- a/website/pages/docs/k8s/service-sync.mdx +++ b/website/pages/docs/k8s/service-sync.mdx @@ -313,56 +313,57 @@ There are three options available: 1. **Single Destination Namespace** – Sync all Kubernetes services, regardless of namespace, into the same Consul namespace. - This can be configured with: + This can be configured with: - ```yaml - global: - enableConsulNamespaces: true + ```yaml + global: + enableConsulNamespaces: true - syncCatalog: - enabled: true - consulNamespaces: - consulDestinationNamespace: "my-consul-ns" - ``` + syncCatalog: + enabled: true + consulNamespaces: + consulDestinationNamespace: 'my-consul-ns' + ``` + +1. **Mirror Namespaces** - Each Kubernetes service will be synced to a Consul namespace with the same + name as its Kubernetes namespace. -1. **Mirror Namespaces** - Each Kubernetes service will be synced to a Consul namespace with the same name as its Kubernetes namespace. For example, service `foo` in Kubernetes namespace `ns-1` will be synced to the Consul namespace `ns-1`. If a mirrored namespace does not exist in Consul, it will be created. This can be configured with: - ````yaml + ```yaml global: - enableConsulNamespaces: true + enableConsulNamespaces: true - syncCatalog: - enabled: true - consulNamespaces: - mirroringK8S: true + syncCatalog: + enabled: true + consulNamespaces: + mirroringK8S: true - addK8SNamespaceSuffix: false - ``` + addK8SNamespaceSuffix: false + ``` - ```` +1. **Mirror Namespaces With Prefix** - Each Kubernetes service will be synced to a Consul namespace + with the same name as its Kubernetes namespace **with a prefix**. For example, given a prefix + `k8s-`, service `foo` in Kubernetes namespace `ns-1` will be synced to the Consul namespace + `k8s-ns-1`. -1. **Mirror Namespaces With Prefix** - Each Kubernetes service will be synced to a Consul namespace with the same name as its Kubernetes - namespace **with a prefix**. - For example, given a prefix `k8s-`, service `foo` in Kubernetes namespace `ns-1` will be synced to the Consul namespace `k8s-ns-1`. + This can be configured with: - This can be configured with: + ```yaml + global: + enableConsulNamespaces: true - ```yaml - global: - enableConsulNamespaces: true + syncCatalog: + enabled: true + consulNamespaces: + mirroringK8S: true + mirroringK8SPrefix: 'k8s-' - syncCatalog: - enabled: true - consulNamespaces: - mirroringK8S: true - mirroringK8SPrefix: "k8s-" - - addK8SNamespaceSuffix: false - ``` + addK8SNamespaceSuffix: false + ``` -> Note that in both mirroring examples we're setting `addK8SNamespaceSuffix: false`. If set to `true` (the default), the Kubernetes namespace will be added as a suffix to each diff --git a/website/pages/docs/partnerships.mdx b/website/pages/docs/partnerships.mdx index 8904731c8c..30c2ea6529 100644 --- a/website/pages/docs/partnerships.mdx +++ b/website/pages/docs/partnerships.mdx @@ -14,10 +14,7 @@ The HashiCorp Consul Integration Program enables vendors to build integrations w By leveraging Consul’s RESTful HTTP API system, vendors are able to build extensible integrations at the data plane, platform, and the infrastructure layer to extend Consul’s functionalities. These integrations can be performed with the OSS (open source) version of Consul. Integrations with advanced network segmentation, advanced federation, and advanced read scalability need to be tested against Consul Enterprise, since these features are only supported by Consul Enterprise. -
- [![Consul - Architecture](/img/consul_ecosystem_diagram.png)](/img/consul_ecosystem_diagram.png) -
+[![Consul Architecture](/img/consul_ecosystem_diagram.png)](/img/consul_ecosystem_diagram.png) **Data Plane**: These integrations automate IP updates of load balancers by leveraging Consul service discovery, automate firewall security policy updates by leveraging Consul intentions within a centralized management tool, extend sidecar proxies to support Consul connect, and extend API gateways to allow Consul to route incoming traffic to the proxies for Connect-enabled services.