github.com/projectcontour/contour@v1.28.2/site/content/docs/v1.9.0/configuration.md (about)

     1  # Contour Configuration Reference
     2  
     3  - [Configuration File](#configuration-file)
     4  - [Environment Variables](#environment-variables)
     5  
     6  ## Configuration File
     7  
     8  A configuration file can be passed to the `--config-path` argument of the `contour serve` command to specify additional configuration to Contour.
     9  In most deployments, this file is passed to Contour via a ConfigMap which is mounted as a volume to the Contour pod.
    10  
    11  The Contour configuration file is optional.
    12  In its absence, Contour will operate with reasonable defaults.
    13  Where Contour settings can also be specified with command-line flags, the command-line value takes precedence over the configuration file.
    14  
    15  | Field Name | Type | Default | Description |
    16  |------------|------|---------|-------------|
    17  | accesslog-format | string | `envoy` | This key sets the global [access log format][2] for Envoy. Valid options are `envoy` or `json`. |
    18  | debug | boolean | `false` | Enables debug logging. |
    19  | default-http-versions | string array | <code style="white-space:nowrap">HTTP/1.1</code> <br> <code style="white-space:nowrap">HTTP/2</code> | This array specifies the HTTP versions that Contour should program Envoy to serve. HTTP versions are specified as strings of the form "HTTP/x", where "x" represents the version number. |
    20  | disablePermitInsecure | boolean | `false` | If this field is true, Contour will ignore `PermitInsecure` field in HTTPProxy documents. |
    21  | envoy-service-name | string | `envoy` | This sets the service name that will be inspected for address details to be applied to Ingress objects. |
    22  | envoy-service-namespace | string | `projectcontour` | This sets the namespace of the service that will be inspected for address details to be applied to Ingress objects. If the `CONTOUR_NAMESPACE` environment variable is present, Contour will populate this field with its value. |
    23  | ingress-status-address | string | None | If present, this specifies the address that will be copied into the Ingress status for each Ingress that Contour manages. It is exclusive with `envoy-service-name` and `envoy-service-namespace`.|
    24  | incluster | boolean | `false` | This field specifies that Contour is running in a Kubernetes cluster and should use the in-cluster client access configuration.  |
    25  | json-fields | string array | [fields][5]| This is the list the field names to include in the JSON [access log format][2]. |
    26  | kubeconfig | string | `$HOME/.kube/config` | Path to a Kubernetes [kubeconfig file][3] for when Contour is executed outside a cluster. |
    27  | leaderelection | leaderelection | | The [leader election configuration](#leader-election-configuration). |
    28  | request-timeout | [duration][4] | `0s` | **Deprecated and will be removed in a future release. Use [timeouts.request-timeout](#timeout-configuration) instead.**<br /><br /> This field specifies the default request timeout as a Go duration string. Zero means there is no timeout. |
    29  | tls | TLS | | The default [TLS configuration](#tls-configuration). |
    30  | timeouts | TimeoutConfig | | The [timeout configuration](#timeout-configuration). |
    31  | cluster | ClusterConfig | | The [cluster configuration](#cluster-configuration). |
    32  | server | ServerConfig |  | The [server configuration](#server-configuration) for `contour serve` command. |
    33  
    34  
    35  ### TLS Configuration
    36  
    37  The TLS configuration block can be used to configure default values for how
    38  Contour should provision TLS hosts.
    39  
    40  | Field Name | Type| Default  | Description |
    41  |------------|-----|----------|-------------|
    42  | minimum-protocol-version| string | `""` | This field specifies the minimum TLS protocol version that is allowed. Valid options are `1.2` and `1.3`. Any other value defaults to TLS 1.1. |
    43  | fallback-certificate | | | [Fallback certificate configuration](#fallback-certificate). |
    44  | envoy-client-certificate | | | [Client certificate configuration for Envoy](#envoy-client-certificate). |
    45  
    46  
    47  ### Fallback Certificate
    48  
    49  | Field Name | Type| Default  | Description |
    50  |------------|-----|----------|-------------|
    51  | name       | string | `""` | This field specifies the name of the Kubernetes secret to use as the fallback certificate.      |
    52  | namespace  | string | `""` | This field specifies the namespace of the Kubernetes secret to use as the fallback certificate. |
    53  
    54  
    55  ### Envoy Client Certificate
    56  
    57  | Field Name | Type| Default  | Description |
    58  |------------|-----|----------|-------------|
    59  | name       | string | `""` | This field specifies the name of the Kubernetes secret to use as the client certificate and private key when establishing TLS connections to the backend service. |
    60  | namespace  | string | `""` | This field specifies the namespace of the Kubernetes secret to use as the client certificate and private key when establishing TLS connections to the backend service. |
    61  
    62  
    63  ### Leader Election Configuration
    64  
    65  The leader election configuration block configures how a deployment with more than one Contour pod elects a leader.
    66  The Contour leader is responsible for updating the status field on Ingress and HTTPProxy documents.
    67  In the vast majority of deployments, only the `configmap-name` and `configmap-namespace` fields should require any configuration.
    68  
    69  | Field Name | Type | Default | Description |
    70  |------------|------|---------|-------------|
    71  | configmap-name | string | `leader-elect` | The name of the ConfigMap that Contour leader election will lease. |
    72  | configmap-namespace | string | `projectcontour` | The namespace of the ConfigMap that Contour leader election will lease. If the `CONTOUR_NAMESPACE` environment variable is present, Contour will populate this field with its value. |
    73  | lease-duration | [duration][4] | `15s` | The duration of the leadership lease. |
    74  | renew-deadline | [duration][4] | `10s` | The length of time that the leader will retry refreshing leadership before giving up. |
    75  | retry-period | [duration][4] | `2s` | The interval at which Contour will attempt to the acquire leadership lease. |
    76  
    77  
    78  ### Timeout Configuration
    79  
    80  The timeout configuration block can be used to configure various timeouts for the proxies. All fields are optional; Contour/Envoy defaults apply if a field is not specified.
    81  
    82  | Field Name | Type| Default  | Description |
    83  |------------|-----|----------|-------------|
    84  | request-timeout | string | none* | This field specifies the default request timeout. Note that this is a timeout for the entire request, not an idle timeout. Must be a [valid Go duration string][4], or omitted or set to `infinity` to disable the timeout entirely. See [the Envoy documentation][12] for more information.<br /><br />_Note: A value of `0s` previously disabled this timeout entirely. This is no longer the case. Use `infinity` or omit this field to disable the timeout._  |
    85  | connection-idle-timeout| string | `60s` | This field defines how long the proxy should wait while there are no active requests (for HTTP/1.1) or streams (for HTTP/2) before terminating an HTTP connection. Must be a [valid Go duration string][4], or `infinity` to disable the timeout entirely. See [the Envoy documentation][8] for more information. |
    86  | stream-idle-timeout| string | `5m`* |This field defines how long the proxy should wait while there is no request activity (for HTTP/1.1) or stream activity (for HTTP/2) before terminating the HTTP request or stream. Must be a [valid Go duration string][4], or `infinity` to disable the timeout entirely. See [the Envoy documentation][9] for more information. |
    87  | max-connection-duration | string | none* | This field defines the maximum period of time after an HTTP connection has been established from the client to the proxy before it is closed by the proxy, regardless of whether there has been activity or not. Must be a [valid Go duration string][4], or omitted or set to `infinity` for no max duration. See [the Envoy documentation][10] for more information. |
    88  | connection-shutdown-grace-period | string | `5s`* | This field defines how long the proxy will wait between sending an initial GOAWAY frame and a second, final GOAWAY frame when terminating an HTTP/2 connection. During this grace period, the proxy will continue to respond to new streams. After the final GOAWAY frame has been sent, the proxy will refuse new streams. Must be a [valid Go duration string][4]. See [the Envoy documentation][11] for more information. |
    89  
    90  _* This is Envoy's default setting value and is not explicitly configured by Contour._
    91  
    92  ### Cluster Configuration
    93  
    94  The cluster configuration block can be used to configure various parameters for Envoy clusters.
    95  
    96  | Field Name | Type| Default  | Description |
    97  |------------|-----|----------|-------------|
    98  | dns-lookup-family | string | auto | This field specifies the dns-lookup-family to use for upstream requests to externalName type Kubernetes services from an HTTPProxy route. Values are: `auto`, `v4, `v6` |
    99  
   100  
   101  ### Server Configuration
   102  
   103  The server configuration block can be used to configure various settings for the `contour serve` command.
   104  
   105  | Field Name | Type| Default  | Description |
   106  |------------|-----|----------|-------------|
   107  | xds-server-type | string | contour | This field specifies the xDS Server to use. Options are `contour` or `envoy`.  |
   108  
   109  
   110  ### Configuration Example
   111  
   112  The following is an example ConfigMap with configuration file included:
   113  
   114  ```yaml
   115  apiVersion: v1
   116  kind: ConfigMap
   117  metadata:
   118    name: contour
   119    namespace: projectcontour
   120  data:
   121    contour.yaml: |
   122      # server:
   123      #   determine which XDS Server implementation to utilize in Contour.
   124      #   xds-server-type: contour
   125      #
   126      # should contour expect to be running inside a k8s cluster
   127      # incluster: true
   128      #
   129      # path to kubeconfig (if not running inside a k8s cluster)
   130      # kubeconfig: /path/to/.kube/config
   131      #
   132      # disable httpproxy permitInsecure field
   133      # disablePermitInsecure: false
   134      tls:
   135        # minimum TLS version that Contour will negotiate
   136        # minimumProtocolVersion: "1.1"
   137        fallback-certificate:
   138        # name: fallback-secret-name
   139        # namespace: projectcontour
   140        envoy-client-certificate:
   141        # name: envoy-client-cert-secret-name
   142        # namespace: projectcontour
   143      # The following config shows the defaults for the leader election.
   144      # leaderelection:
   145        # configmap-name: leader-elect
   146        # configmap-namespace: projectcontour
   147      # Default HTTP versions.
   148      # default-http-versions:
   149      # - "HTTP/1.1"
   150      # - "HTTP/2"
   151      # The following shows the default proxy timeout settings.
   152      # timeouts:
   153      #  request-timeout: infinity
   154      #  connection-idle-timeout: 60s
   155      #  stream-idle-timeout: 5m
   156      #  max-connection-duration: infinity
   157      #  connection-shutdown-grace-period: 5s
   158      #
   159      # Envoy cluster settings.
   160      # cluster:
   161      #   configure the cluster dns lookup family
   162      #   valid options are: auto (default), v4, v6
   163      #   dns-lookup-family: auto
   164  ```
   165  
   166  _Note:_ The default example `contour` includes this [file][1] for easy deployment of Contour.
   167  
   168  ## Environment Variables
   169  
   170  ### CONTOUR_NAMESPACE
   171  
   172  If present, the value of the `CONTOUR_NAMESPACE` environment variable is used as:
   173  
   174  1. The value for the `contour bootstrap --namespace` flag unless otherwise specified.
   175  1. The value for the `contour certgen --namespace` flag unless otherwise specified.
   176  1. The value for the `contour serve --envoy-service-namespace` flag unless otherwise specified.
   177  1. The value for the `leaderelection.configmap-namespace` config file setting for `contour serve` unless otherwise specified.
   178  
   179  The `CONTOUR_NAMESPACE` environment variable is set via the [Downward API][6] in the Contour [example manifests][7].
   180  
   181  
   182  [1]: {{< param github_url >}}/tree/{{< param version >}}/examples/contour/01-contour-config.yaml
   183  [2]: /guides/structured-logs
   184  [3]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/
   185  [4]: https://golang.org/pkg/time/#ParseDuration
   186  [5]: https://godoc.org/github.com/projectcontour/contour/internal/envoy#DefaultFields
   187  [6]: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
   188  [7]: {{< param github_url >}}/tree/{{< param version >}}/examples/contour
   189  [8]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/protocol.proto#envoy-api-field-core-httpprotocoloptions-idle-timeout
   190  [9]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#envoy-api-field-config-filter-network-http-connection-manager-v2-httpconnectionmanager-stream-idle-timeout
   191  [10]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/protocol.proto#envoy-api-field-core-httpprotocoloptions-max-connection-duration
   192  [11]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#envoy-api-field-config-filter-network-http-connection-manager-v2-httpconnectionmanager-drain-timeout
   193  [12]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#envoy-api-field-config-filter-network-http-connection-manager-v2-httpconnectionmanager-request-timeout