Skip to content
Install the CLI

Reference experimental

envoy-gateway

These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.

A Gateway served by Envoy Gateway, with its own Envoy proxies and Service

This page is generated from kix/packages/experimental/envoy-gateway.

StabilityExperimental
package valuepackages.experimental.envoy-gateway
Default aliasesgateway

Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set deps.<name> in your cluster definition. See Declaring dependencies for how required and optional dependencies work.

DependencyRequirement
clusterIssuerOptional
envoyGatewayOptional
gatewayApiOptional
prometheusOptional

Addresses to request on the Gateway (spec.addresses), such as a static IP for the proxy LoadBalancer Service.

  • Type: list of (submodule)

  • Default: [ ]

  • Example:

    [
    {
    type = "IPAddress";
    value = "192.0.2.10";
    }
    ]

IPAddress (the Gateway API default), Hostname, or an implementation-specific type.

  • Type: null or string
  • Default: null

Address value, such as an IP address for IPAddress or a DNS name for Hostname.

  • Type: string

Traffic sources that the network policy allows to reach the proxies’ listener ports: "world" allows external IP addresses outside the cluster, and "all-pods" allows all pods and cluster nodes. Omit "world" (for example, [ "all-pods" ]) on an internal Gateway. Any securityPolicy IP allowlist runs after the network policy.

Clients need "world" when they reach the Gateway through a router that rewrites their source to an address other than a pod or node IP, as some VPN subnet routers do.

  • Type: list of (one of "world", "all-pods")

  • Default:

    [
    "world"
    "all-pods"
    ]
  • Example:

    [
    "all-pods"
    ]

Envoy Gateway ClientTrafficPolicy spec fields (gateway.envoyproxy.io/v1alpha1) configuring how the proxies handle client connections across all listeners. When non-empty, the package creates a ClientTrafficPolicy attached to this Gateway. Kix rejects targetRef, targetRefs, and targetSelectors.

Common settings: clientIPDetection.xForwardedFor.trustedCIDRs lists upstream proxy or CDN IP ranges whose X-Forwarded-For header the Gateway trusts; tls.minVersion sets the minimum TLS version (defaults to "1.2"); tls.alpnProtocols = [ "http/1.1" ] disables HTTP/2; and headers.lateResponseHeaders adds response headers across all routes on the Gateway.

  • Type: attribute set of anything

  • Default: { }

  • Example:

    {
    clientIPDetection.xForwardedFor.trustedCIDRs = [ "192.0.2.0/24" ];
    tls.minVersion = "1.3";
    headers.lateResponseHeaders.set = [
    {
    name = "Strict-Transport-Security";
    value = "max-age=31536000; includeSubDomains";
    }
    ];
    }

Redirect all requests on the Gateway’s HTTP listeners to HTTPS with a 301 status code. The package attaches a redirect HTTPRoute to each HTTP listener and sets allowedRoutes.namespaces.from = "Same" on HTTP listeners so routes from other namespaces attach only to HTTPS listeners. Requires at least one HTTP listener and one active HTTPS listener.

  • Type: boolean
  • Default: false

Map of HTTPS listener name to ClusterIssuer name for automatic TLS certificates. Each value must match a cluster-issuer instance wired to clusterIssuer. When only one issuer is wired, HTTPS listeners omitted here use it automatically.

When a clusterIssuer dependency is present, the package creates a cert-manager Certificate for each HTTPS listener without tls.certificateRefs (using the listener’s hostname) and attaches the generated Secret to the listener.

  • Type: attribute set of string

  • Default: { }

  • Example:

    {
    example-com = "letsencrypt-example-com";
    }

Gateway API v1 Listener entries for the Gateway’s spec.listeners, with the upstream field names. An HTTPS listener with no tls.certificateRefs is a placeholder and is not rendered.

For listener ports below 1024, Envoy binds to container port port + 10000 (for example, port 80 maps to 10080) unless proxySpec.provider.kubernetes.useListenerPortAsContainerPort is true. When network policy is enabled, the package allows incoming client traffic to those container ports. kix.expose reads the rendered listeners: protocol, hostname, port, and allowedRoutes.namespaces.from decide whether an HTTPRoute can attach and which URL scheme and port it gets.

  • Type: list of (submodule)

  • Default:

    [
    {
    allowedRoutes = {
    namespaces = {
    from = "All";
    };
    };
    name = "http";
    port = 80;
    protocol = "HTTP";
    }
    {
    allowedRoutes = {
    namespaces = {
    from = "All";
    };
    };
    name = "https";
    port = 443;
    protocol = "HTTPS";
    tls = {
    certificateRefs = [ ];
    mode = "Terminate";
    };
    }
    ]
  • Type: null or (submodule)
  • Default: null
  • Type: null or (list of attribute set of anything)
  • Default: null
  • Type: null or (submodule)
  • Default: null
  • Type: null or one of "All", "Same", "Selector"
  • Default: null

listeners.*.allowedRoutes.namespaces.selector

Section titled “listeners.*.allowedRoutes.namespaces.selector”
  • Type: null or (attribute set of anything)
  • Default: null
  • Type: null or string
  • Default: null
  • Type: string
  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Type: one of "HTTP", "HTTPS", "TLS", "TCP", "UDP"
  • Type: null or (submodule)
  • Default: null
  • Type: null or (list of attribute set of anything)
  • Default: null
  • Type: null or (attribute set of anything)
  • Default: null
  • Type: null or one of "Terminate", "Passthrough"
  • Default: null
  • Type: null or (attribute set of string)
  • Default: null

Enable metrics endpoint and monitoring resources (ServiceMonitor, PrometheusRules) when prometheus is available.

  • Type: boolean
  • Default: true

Scrape interval (e.g. ”30s”). Null = use Prometheus default.

  • Type: null or string
  • Default: null

EnvoyProxy spec fields (gateway.envoyproxy.io/v1alpha1) merged into this Gateway’s EnvoyProxy resource.

By default, the package sets provider.type = "Kubernetes", the Envoy image from envoy-gateway-controller (operandImages.envoy), the replica count from the cluster’s availability level (provider.kubernetes.envoyDeployment.replicas), pod topology spread constraints and a PodDisruptionBudget when running multiple replicas, and the proxy Service type (NodePort when cluster.roles.loadBalancer.binding = "absent", or LoadBalancer otherwise).

You can override the replica count, Service type, and other EnvoyProxy fields here. Kix rejects overrides to provider.type (must be "Kubernetes"), provider.kubernetes.envoyDeployment.container.image (set operandImages.envoy on envoy-gateway-controller instead), provider.kubernetes.envoyDeployment.pod.topologySpreadConstraints, and mergeGateways.

  • Type: attribute set of anything

  • Default: { }

  • Example:

    {
    provider.kubernetes.envoyService.annotations."service.beta.kubernetes.io/aws-load-balancer-type" = "nlb";
    logging.level.default = "info";
    }

Envoy Gateway SecurityPolicy spec fields (gateway.envoyproxy.io/v1alpha1) applied to every route on this Gateway unless overridden by a route-level policy. When non-empty, the package creates a SecurityPolicy attached to this Gateway. Kix rejects targetRef, targetRefs, and targetSelectors.

Use authorization with principal.clientCIDRs to restrict access by client IP range. Envoy Gateway evaluates the connection’s source IP, or the client IP extracted via clientTrafficPolicy.clientIPDetection from a trusted proxy.

  • Type: attribute set of anything

  • Default: { }

  • Example:

    {
    authorization = {
    defaultAction = "Deny";
    rules = [
    {
    action = "Allow";
    principal.clientCIDRs = [ "10.0.0.0/8" ];
    }
    ];
    };
    }