apiVersion: v1
kind: ConfigMap
metadata:
  namespace: web
  name: envoy-config
data:
  envoy.yaml: |-
    static_resources:
      listeners:
      - address:
          socket_address:
            address: 0.0.0.0
            port_value: 8080
        filter_chains:
        - filters:
          - name: envoy.filters.network.http_connection_manager
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
              codec_type: AUTO
              stat_prefix: ingress_http
              upgrade_configs:
              - upgrade_type: websocket
              route_config:
                name: local_route
                virtual_hosts:
                - name: backend
                  domains:
                  - "*"
                  routes:
                  - match:
                      prefix: "/"
                    route:
                      cluster: home-assistant
              http_filters:
              - name: envoy.filters.http.router

      clusters:
      - name: home-assistant
        type: STRICT_DNS
        lb_policy: ROUND_ROBIN
        load_assignment:
          cluster_name: home-assistant
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: home-assistant.home-assistant.svc.cluster.local
                    port_value: 80
