diff --git a/content/boilerplates/start-httpbin-service.md b/content/boilerplates/start-httpbin-service.md new file mode 100644 index 0000000000..f0ae957ad2 --- /dev/null +++ b/content/boilerplates/start-httpbin-service.md @@ -0,0 +1,13 @@ +* Start the [httpbin]({{< github_tree >}}/samples/httpbin) sample. + + If you have enabled [automatic sidecar injection](/docs/setup/kubernetes/additional-setup/sidecar-injection/#automatic-sidecar-injection), deploy the `httpbin` service: + + {{< text bash >}} + $ kubectl apply -f @samples/httpbin/httpbin.yaml@ + {{< /text >}} + + Otherwise, you have to manually inject the sidecar before deploying the `httpbin` application: + + {{< text bash >}} + $ kubectl apply -f <(istioctl kube-inject -f @samples/httpbin/httpbin.yaml@) + {{< /text >}} diff --git a/content/docs/tasks/traffic-management/circuit-breaking/index.md b/content/docs/tasks/traffic-management/circuit-breaking/index.md index 2c860fe599..54769b1a5d 100644 --- a/content/docs/tasks/traffic-management/circuit-breaking/index.md +++ b/content/docs/tasks/traffic-management/circuit-breaking/index.md @@ -19,21 +19,9 @@ configuration by intentionally "tripping" the circuit breaker. * Setup Istio by following the instructions in the [Installation guide](/docs/setup/). -* Add the [httpbin]({{< github_tree >}}/samples/httpbin) sample to the mesh: +{{< boilerplate start-httpbin-service >}} - If you have enabled [automatic sidecar injection](/docs/setup/kubernetes/additional-setup/sidecar-injection/#automatic-sidecar-injection), run this command: - - {{< text bash >}} - $ kubectl apply -f @samples/httpbin/httpbin.yaml@ - {{< /text >}} - - otherwise, manually inject the sidecar before deploying the `httpbin` application: - - {{< text bash >}} - $ kubectl apply -f <(istioctl kube-inject -f @samples/httpbin/httpbin.yaml@) - {{< /text >}} - - The `httpbin` application serves as the backend service for this task. +The `httpbin` application serves as the backend service for this task. ## Configuring the circuit breaker diff --git a/content/docs/tasks/traffic-management/ingress/index.md b/content/docs/tasks/traffic-management/ingress/index.md index 7953eb8791..c345384920 100644 --- a/content/docs/tasks/traffic-management/ingress/index.md +++ b/content/docs/tasks/traffic-management/ingress/index.md @@ -21,20 +21,7 @@ This task describes how to configure Istio to expose a service outside of the se * Make sure your current directory is the `istio` directory. -* Start the [httpbin]({{< github_tree >}}/samples/httpbin) sample, - which will be used as the destination service to be exposed externally. - - If you have enabled [automatic sidecar injection](/docs/setup/kubernetes/additional-setup/sidecar-injection/#automatic-sidecar-injection), deploy the `httpbin` service: - - {{< text bash >}} - $ kubectl apply -f @samples/httpbin/httpbin.yaml@ - {{< /text >}} - - Otherwise, you have to manually inject the sidecar before deploying the `httpbin` application: - - {{< text bash >}} - $ kubectl apply -f <(istioctl kube-inject -f @samples/httpbin/httpbin.yaml@) - {{< /text >}} +{{< boilerplate start-httpbin-service >}} * Determine the ingress IP and ports as described in the following subsection.