contour: Index | Files

package config

import ""


Package Files

accesslog.go parameters.go


const DEFAULT_ACCESS_LOG_TYPE = EnvoyAccessLog

DEFAULT_ACCESS_LOG_TYPE is the default access log format.


var DefaultFields = AccessLogFields([]string{

DefaultFields are fields that will be included by default when JSON logging is enabled.

func GetenvOr Uses

func GetenvOr(key string, defaultVal string) string

GetenvOr reads an environment or return a default value

type AccessLogFields Uses

type AccessLogFields []string

func (AccessLogFields) AsFieldMap Uses

func (a AccessLogFields) AsFieldMap() map[string]string

func (AccessLogFields) Validate Uses

func (a AccessLogFields) Validate() error

type AccessLogType Uses

type AccessLogType string

AccessLogType is the name of a supported access logging mechanism.

const EnvoyAccessLog AccessLogType = "envoy"
const JSONAccessLog AccessLogType = "json"

func (AccessLogType) Validate Uses

func (a AccessLogType) Validate() error

type ClusterDNSFamilyType Uses

type ClusterDNSFamilyType string

ClusterDNSFamilyType is the Ip family to use for resolving DNS names in an Envoy cluster configuration.

const AutoClusterDNSFamily ClusterDNSFamilyType = "auto"
const IPv4ClusterDNSFamily ClusterDNSFamilyType = "v4"
const IPv6ClusterDNSFamily ClusterDNSFamilyType = "v6"

func (ClusterDNSFamilyType) Validate Uses

func (c ClusterDNSFamilyType) Validate() error

type ClusterParameters Uses

type ClusterParameters struct {
    // DNSLookupFamily defines how external names are looked up
    // When configured as V4, the DNS resolver will only perform a lookup
    // for addresses in the IPv4 family. If V6 is configured, the DNS resolver
    // will only perform a lookup for addresses in the IPv6 family.
    // If AUTO is configured, the DNS resolver will first perform a lookup
    // for addresses in the IPv6 family and fallback to a lookup for addresses
    // in the IPv4 family.
    // Note: This only applies to externalName clusters.
    // See
    // for more information.
    DNSLookupFamily ClusterDNSFamilyType `yaml:"dns-lookup-family"`

ClusterParameters holds various configurable cluster values.

type HTTPVersionType Uses

type HTTPVersionType string

HTTPVersionType is the name of a supported HTTP version.

const HTTPVersion1 HTTPVersionType = "http/1.1"
const HTTPVersion2 HTTPVersionType = "http/2"

func (HTTPVersionType) Validate Uses

func (h HTTPVersionType) Validate() error

type LeaderElectionParameters Uses

type LeaderElectionParameters struct {
    LeaseDuration time.Duration `yaml:"lease-duration,omitempty"`
    RenewDeadline time.Duration `yaml:"renew-deadline,omitempty"`
    RetryPeriod   time.Duration `yaml:"retry-period,omitempty"`
    Namespace     string        `yaml:"configmap-namespace,omitempty"`
    Name          string        `yaml:"configmap-name,omitempty"`

LeaderElectionParameters holds the config bits for leader election inside the configuration file.

type NamespacedName Uses

type NamespacedName struct {
    Name      string `yaml:"name"`
    Namespace string `yaml:"namespace"`

NamespacedName defines the namespace/name of the Kubernetes resource referred from the configuration file. Used for Contour configuration YAML file parsing, otherwise we could use K8s types.NamespacedName.

func (NamespacedName) Validate Uses

func (n NamespacedName) Validate() error

Validate that both name fields are present, or neither are.

type Parameters Uses

type Parameters struct {
    // Enable debug logging
    Debug bool

    // Kubernetes client parameters.
    InCluster  bool   `yaml:"incluster,omitempty"`
    Kubeconfig string `yaml:"kubeconfig,omitempty"`

    // Server contains parameters for the xDS server.
    Server ServerParameters `yaml:"server,omitempty"`

    // Address to be placed in status.loadbalancer field of Ingress objects.
    // May be either a literal IP address or a host name.
    // The value will be placed directly into the relevant field inside the status.loadBalancer struct.
    IngressStatusAddress string `yaml:"ingress-status-address,omitempty"`

    // AccessLogFormat sets the global access log format.
    // Valid options are 'envoy' or 'json'
    AccessLogFormat AccessLogType `yaml:"accesslog-format,omitempty"`

    // AccessLogFields sets the fields that JSON logging will
    // output when AccessLogFormat is json.
    AccessLogFields AccessLogFields `yaml:"json-fields,omitempty"`

    // TLS contains TLS policy parameters.
    TLS TLSParameters `yaml:"tls,omitempty"`

    // DisablePermitInsecure disables the use of the
    // permitInsecure field in HTTPProxy.
    DisablePermitInsecure bool `yaml:"disablePermitInsecure,omitempty"`

    // DisableAllowChunkedLength disables the RFC-compliant Envoy behavior to
    // strip the "Content-Length" header if "Transfer-Encoding: chunked" is
    // also set. This is an emergency off-switch to revert back to Envoy's
    // default behavior in case of failures. Please file an issue if failures
    // are encountered.
    // See:
    DisableAllowChunkedLength bool `yaml:"disableAllowChunkedLength,omitempty"`

    // LeaderElection contains leader election parameters.
    LeaderElection LeaderElectionParameters `yaml:"leaderelection,omitempty"`

    // Timeouts holds various configurable timeouts that can
    // be set in the config file.
    Timeouts TimeoutParameters `yaml:"timeouts,omitempty"`

    // Namespace of the envoy service to inspect for Ingress status details.
    EnvoyServiceNamespace string `yaml:"envoy-service-namespace,omitempty"`

    // Name of the envoy service to inspect for Ingress status details.
    EnvoyServiceName string `yaml:"envoy-service-name,omitempty"`

    // DefaultHTTPVersions defines the default set of HTTPS
    // versions the proxy should accept. HTTP versions are
    // strings of the form "HTTP/xx". Supported versions are
    // "HTTP/1.1" and "HTTP/2".
    // If this field not specified, all supported versions are accepted.
    DefaultHTTPVersions []HTTPVersionType `yaml:"default-http-versions"`

    // Cluster holds various configurable Envoy cluster values that can
    // be set in the config file.
    Cluster ClusterParameters `yaml:"cluster,omitempty"`

Parameters contains the configuration file parameters for the Contour ingress controller.

func Defaults Uses

func Defaults() Parameters

Defaults returns the default set of parameters.

func Parse Uses

func Parse(in io.Reader) (*Parameters, error)

Parse reads parameters from a YAML input stream. Any parameters not specified by the input are according to Defaults().

func (*Parameters) Validate Uses

func (p *Parameters) Validate() error

Validate verifies that the parameter values do not have any syntax errors.

type ResourceVersion Uses

type ResourceVersion string

ResourceVersion is a version of an xDS server.

const XDSv3 ResourceVersion = "v3"

func (ResourceVersion) Validate Uses

func (s ResourceVersion) Validate() error

Validate the xDS server versions.

type ServerParameters Uses

type ServerParameters struct {
    // Defines the XDSServer to use for `contour serve`.
    // Defaults to "contour"
    XDSServerType ServerType `yaml:"xds-server-type,omitempty"`

ServerParameters holds the configuration for the Contour xDS server.

type ServerType Uses

type ServerType string

ServerType is the name of a xDS server implementation.

const ContourServerType ServerType = "contour"
const EnvoyServerType ServerType = "envoy"

func (ServerType) Validate Uses

func (s ServerType) Validate() error

Validate the xDS server type.

type TLSParameters Uses

type TLSParameters struct {
    MinimumProtocolVersion string `yaml:"minimum-protocol-version"`

    // FallbackCertificate defines the namespace/name of the Kubernetes secret to
    // use as fallback when a non-SNI request is received.
    FallbackCertificate NamespacedName `yaml:"fallback-certificate,omitempty"`

    // ClientCertificate defines the namespace/name of the Kubernetes
    // secret containing the client certificate and private key
    // to be used when establishing TLS connection to upstream
    // cluster.
    ClientCertificate NamespacedName `yaml:"envoy-client-certificate,omitempty"`

TLSParameters holds configuration file TLS configuration details.

type TimeoutParameters Uses

type TimeoutParameters struct {
    // RequestTimeout sets the client request timeout globally for Contour. Note that
    // this is a timeout for the entire request, not an idle timeout. Omit or set to
    // "infinity" to disable the timeout entirely.
    // See
    // for more information.
    RequestTimeout string `yaml:"request-timeout,omitempty"`

    // ConnectionIdleTimeout 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. Set to "infinity" to disable the timeout entirely.
    // See
    // for more information.
    ConnectionIdleTimeout string `yaml:"connection-idle-timeout,omitempty"`

    // StreamIdleTimeout 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. Set to "infinity" to disable the
    // timeout entirely.
    // See
    // for more information.
    StreamIdleTimeout string `yaml:"stream-idle-timeout,omitempty"`

    // MaxConnectionDuration 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. Omit or set to "infinity" for
    // no max duration.
    // See
    // for more information.
    MaxConnectionDuration string `yaml:"max-connection-duration,omitempty"`

    // ConnectionShutdownGracePeriod 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.
    // See
    // for more information.
    ConnectionShutdownGracePeriod string `yaml:"connection-shutdown-grace-period,omitempty"`

TimeoutParameters holds various configurable proxy timeout values.

func (TimeoutParameters) Validate Uses

func (t TimeoutParameters) Validate() error

Validate the timeout parameters.

Package config imports 9 packages (graph) and is imported by 7 packages. Updated 2021-01-28. Refresh now. Tools for package owners.