replace the statistics of envoy with envoy's log for TCP (#3018)

This commit is contained in:
Vadim Eisenberg 2019-01-03 18:12:03 +02:00 committed by Martin Taillefer
parent 1cfab42441
commit bb795b90c3
3 changed files with 28 additions and 17 deletions

View File

@ -1025,13 +1025,18 @@ to hold the configuration of the Nginx SNI proxy:
1. Refresh the web page of the application again and verify that the ratings are still displayed correctly.
1. Check the statistics of the egress gateway's Envoy proxy and see a counter that corresponds to your requests to
_*.com_ (the counter for traffic to the SNI proxy). If Istio is deployed in the `istio-system` namespace, the command
to print the counter is:
1. Check the log of the egress gateway's Envoy proxy. If Istio is deployed in the `istio-system` namespace, the command
to print the log is:
{{< text bash >}}
$ kubectl exec -it $(kubectl get pod -l istio=egressgateway-with-sni-proxy -n istio-system -o jsonpath='{.items[0].metadata.name}') -c istio-proxy -n istio-system -- curl -s localhost:15000/stats | grep sni-proxy.local.upstream_cx_total
cluster.outbound|8443||sni-proxy.local.upstream_cx_total: 1
$ kubectl logs -l istio=egressgateway-with-sni-proxy -c istio-proxy -n istio-system
{{< /text >}}
You should see lines similar to the following:
{{< text plain >}}
[2019-01-02T17:22:04.602Z] "- - -" 0 - 768 1863 88 - "-" "-" "-" "-" "127.0.0.1:28543" outbound|28543||sni-proxy.local 127.0.0.1:49976 172.30.146.115:443 172.30.146.118:58510 placeholder.com
[2019-01-02T17:22:04.713Z] "- - -" 0 - 1534 2590 85 - "-" "-" "-" "-" "127.0.0.1:28543" outbound|28543||sni-proxy.local 127.0.0.1:49988 172.30.146.115:443 172.30.146.118:58522 placeholder.com
{{< /text >}}
1. Check the logs of the SNI proxy. If Istio is deployed in the `istio-system` namespace, the command to print the

View File

@ -458,17 +458,18 @@ You need to specify port 443 with protocol `TLS` in a corresponding `ServiceEntr
...
{{< /text >}}
1. Check the statistics of the egress gateway's proxy which includes a counter that corresponds to your
requests to _edition.cnn.com_. If Istio is deployed in the `istio-system` namespace, the command to print the
counter is:
1. Check the log of the egress gateway's proxy. If Istio is deployed in the `istio-system` namespace, the command to
print the log is:
{{< text bash >}}
$ kubectl exec -it $(kubectl get pod -l istio=egressgateway -n istio-system -o jsonpath='{.items[0].metadata.name}') -c istio-proxy -n istio-system -- curl -s localhost:15000/stats | grep edition.cnn.com.upstream_cx_total
cluster.outbound|443||edition.cnn.com.upstream_cx_total: 1
$ kubectl logs -l istio=egressgateway -n istio-system
{{< /text >}}
You may want to perform a couple of additional requests and verify that the counter increases by 1 with each
request.
You should see a line similar to the following:
{{< text plain >}}
[2019-01-02T11:46:46.981Z] "- - -" 0 - 627 1879689 44 - "-" "-" "-" "-" "151.101.129.67:443" outbound|443||edition.cnn.com 172.30.109.80:41122 172.30.109.80:443 172.30.109.112:59970 edition.cnn.com
{{< /text >}}
### Cleanup HTTPS gateway

View File

@ -488,13 +488,18 @@ The SNI proxy will forward the traffic to port `443`.
<title>Wikipedia Die freie Enzyklopädie</title>
{{< /text >}}
1. Check the statistics of the egress gateway's Envoy proxy for the counter that corresponds to your requests to
_*.wikipedia.org_ (the counter for traffic to the SNI proxy). If Istio is deployed in the `istio-system` namespace, the command
to print the counter is:
1. Check the log of the egress gateway's Envoy proxy. If Istio is deployed in the `istio-system` namespace, the command to
print the log is:
{{< text bash >}}
$ kubectl exec -it $(kubectl get pod -l istio=egressgateway-with-sni-proxy -n istio-system -o jsonpath='{.items[0].metadata.name}') -c istio-proxy -n istio-system -- curl -s localhost:15000/stats | grep sni-proxy.local.upstream_cx_total
cluster.outbound|8443||sni-proxy.local.upstream_cx_total: 2
$ kubectl logs -l istio=egressgateway-with-sni-proxy -c istio-proxy -n istio-system
{{< /text >}}
You should see lines similar to the following:
{{< text plain >}}
[2019-01-02T16:34:23.312Z] "- - -" 0 - 578 79141 624 - "-" "-" "-" "-" "127.0.0.1:8443" outbound|8443||sni-proxy.local 127.0.0.1:55018 172.30.109.84:443 172.30.109.112:45346 en.wikipedia.org
[2019-01-02T16:34:24.079Z] "- - -" 0 - 586 65770 638 - "-" "-" "-" "-" "127.0.0.1:8443" outbound|8443||sni-proxy.local 127.0.0.1:55034 172.30.109.84:443 172.30.109.112:45362 de.wikipedia.org
{{< /text >}}
1. Check the logs of the SNI proxy. If Istio is deployed in the `istio-system` namespace, the command to print the