apiVersion: v1
kind: ConfigMap
metadata:
  name: envoy-configmap
data:
  envoy.yaml: |
    static_resources:
      listeners:
        - address:
            socket_address:
              address: 0.0.0.0
              port_value: 443
          filter_chains:
            - tls_context:
                common_tls_context:
                  alpn_protocols: h2,http/1.1
                  tls_certificates:
                    - certificate_chain:
                        filename: "/etc/webhook/certs/cert"
                      private_key:
                        filename: "/etc/webhook/certs/key"
              filters:
                - name: envoy.http_connection_manager
                  config:
                    use_remote_address: true
                    access_log:
                      - name: envoy.file_access_log
                        config:
                          path: /dev/stdout
                    codec_type: auto
                    stat_prefix: ingress_http
                    route_config:
                      name: local_route
                      virtual_hosts:
                        - name: webhook
                          domains:
                            - "*"
                          routes:
                            - match:
                                prefix: "/"
                              route:
                                cluster: webhook
                    http_filters:
                      - name: envoy.router
                        config: {}
      clusters:
        - name: webhook
          connect_timeout: 30s
          type: LOGICAL_DNS
          lb_policy: round_robin
          #    http2_protocol_options: {}
          hosts:
            - socket_address:
                address: 192.168.31.90
                port_value: 8181
    admin:
      access_log_path: "/dev/null"
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 8081
