diff --git a/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/index.md b/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/index.md index 99abeb4f997d..b7c4f62f0f42 100644 --- a/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/index.md +++ b/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/index.md @@ -114,10 +114,9 @@ Both of these issues can be resolved by configuring Istio to perform TLS origina ## TLS origination for egress traffic -1. Redefine your `ServiceEntry` from the previous section to redirect HTTP requests to port 443 - and add a `DestinationRule` to perform TLS origination: +1. Redefine your `ServiceEntry` from the previous section to redirect HTTP requests to port 443: - {{< text syntax=bash snip_id=apply_origination >}} + {{< text syntax=bash snip_id=apply_origination_serviceentry >}} $ kubectl apply -f - <}} + +1. Add a policy to perform TLS origination: + + {{< tabset category-name="tls-origination" >}} + + {{< tab name="Istio API" category-value="istio-api" >}} + + {{< text syntax=bash snip_id=apply_origination_destinationrule >}} + $ kubectl apply -f - <}} + + {{< tab name="Gateway API" category-value="gateway-api" >}} + + {{< text syntax=bash snip_id=apply_origination_backendtlspolicy >}} + $ kubectl apply -f - <}} + + The above `BackendTLSPolicy` will perform TLS origination for HTTP requests on the `http` port and the `ServiceEntry` + will then redirect the requests on port 80 to target port 443. + + {{< /tab >}} + + {{< /tabset >}} + 1. Send an HTTP request to `http://edition.cnn.com/politics`, as in the previous section: {{< text syntax=bash snip_id=curl_origination_http >}} @@ -198,11 +236,28 @@ topics and articles but does not prevent attackers from learning that `edition.c Remove the Istio configuration items you created: +{{< tabset category-name="cleanup-tls-origination" >}} + +{{< tab name="Istio API" category-value="istio-api" >}} + {{< text bash >}} $ kubectl delete serviceentry edition-cnn-com $ kubectl delete destinationrule edition-cnn-com {{< /text >}} +{{< /tab >}} + +{{< tab name="Gateway API" category-value="gateway-api" >}} + +{{< text bash >}} +$ kubectl delete serviceentry edition-cnn-com +$ kubectl delete backendtlspolicy edition-cnn-com +{{< /text >}} + +{{< /tab >}} + +{{< /tabset >}} + ## Mutual TLS origination for egress traffic This section describes how to configure a sidecar to perform TLS origination for an external service, this time using a diff --git a/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/snips.sh b/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/snips.sh index 26a8a1967c61..31d5cad19364 100644 --- a/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/snips.sh +++ b/content/en/docs/tasks/traffic-management/egress/egress-tls-origination/snips.sh @@ -66,7 +66,7 @@ HTTP/2 200 ... ENDSNIP -snip_apply_origination() { +snip_apply_origination_serviceentry() { kubectl apply -f - <