Как правильно запросить req_ssl_sni HAproxy, определенный Kubernetes Ingress? - PullRequest
0 голосов
/ 04 мая 2020

Я пытаюсь выяснить, как я могу проверить, правильно ли работает Kubernetes Ingress И проверяет ли он сертификат клиента. На данный момент эта часть инфраструктуры составлена ​​следующим образом: enter image description here

Конфигурация HAproxy выглядит следующим образом:

#------------------
# Global settings
#------------------
# Global and default settings here, hidden for simplicity


#------------------
# frontend instances
#------------------
frontend stats
    bind    *:80
    mode http

# Other frontend blocks here

frontend frontend_ssl_prod_publicip3
    bind    privateip4:443,privateip5:443
    log-format %Ci:%Cp\ [%t]\ %ft\ %b/%s\ %Tw/%Tc/%Tt\ %B\ %ts\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq
    mode tcp
    maxconn 4000
    stick-table type ip size 100k expire 30s store conn_rate(3s),conn_cur
    acl ingress req_ssl_sni -i api.shop.domain1.suffix
    acl ingress  req_ssl_sni -i b2b.shop.domain1.suffix
    tcp-request inspect-delay 5s
    tcp-request connection accept if { src -f /etc/haproxy/ourservice-whitelist.lst }
    tcp-request connection reject if { src_conn_rate ge 20 }
    tcp-request connection reject if { src_conn_cur ge 30 }
    tcp-request connection track-sc0 src
    tcp-request content accept if { req_ssl_hello_type 1 }
    use_backend kubernetes_ingress if ingress
    use_backend static_ssl_prod_be if www_ssl_prod



#------------------
# backend instances
#------------------
# other backend blocks here, hidden

backend kubernetes_ingress
    mode tcp
    stick-table type binary len 32 size 30k expire 30m
    acl clienthello req_ssl_hello_type 1
    acl serverhello rep_ssl_hello_type 2
    tcp-request inspect-delay 5s
    tcp-request content accept if clienthello
    tcp-response content accept if serverhello
    stick on payload_lv(43,1) if clienthello
    stick  store-response payload_lv(43,1) if serverhello
    server kube-node01 kubeip1:31443 check weight 100 send-proxy agent-check agent-port 8080
    server kube-node02 kubeip2:31443 check weight 100 send-proxy agent-check agent-port 8080
    server kube-node03 kubeip3:31443 check weight 100 send-proxy agent-check agent-port 8080


# Other backends here

На kube-node01, служба kube-proxy работает.

Я пытаюсь curl -vvv b2b.shop.domain1.suffix из:

  1. Узел loadbalancer
  2. Узел kube0 #
  3. Контейнер Kube-прокси

    но я просто вижу:

* Rebuilt URL to: b2b.shop.domain1.suffix/
*   Trying publicip3...
* TCP_NODELAY set
* connect to publicip3 port 80 failed: Connection timed out
* Failed to connect to b2b.shop.domain1.suffix port 80: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to b2b.shop.domain1.suffix port 80: Connection timed out

Как проверить вход?

...