From 6abdcec82731f6af4f6a08004443a6abd9d28e9b Mon Sep 17 00:00:00 2001 From: Sam Naser Date: Wed, 20 Jan 2021 11:38:48 -0500 Subject: [PATCH] Service API task doc test (#8796) * mark as tested * generate snips * test progress * add -I to curl output in command * regenerate snips * doc test fixes * Add HTTP/1.1 to expected output * change to use verify_elided --- .../ingress/service-apis/index.md | 4 +- .../ingress/service-apis/snips.sh | 107 ++++++++++++++++++ .../ingress/service-apis/test.sh | 52 +++++++++ 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 content/en/docs/tasks/traffic-management/ingress/service-apis/snips.sh create mode 100644 content/en/docs/tasks/traffic-management/ingress/service-apis/test.sh diff --git a/content/en/docs/tasks/traffic-management/ingress/service-apis/index.md b/content/en/docs/tasks/traffic-management/ingress/service-apis/index.md index 250a0f755b..c0381d5233 100644 --- a/content/en/docs/tasks/traffic-management/ingress/service-apis/index.md +++ b/content/en/docs/tasks/traffic-management/ingress/service-apis/index.md @@ -4,7 +4,7 @@ description: Describes how to configure the Kubernetes Service APIs with Istio. weight: 50 keywords: [traffic-management,ingress] owner: istio/wg-networking-maintainers -test: no +test: yes --- This task describes how to configure Istio to expose a service outside of the service mesh cluster, using the Kubernetes [Service APIs](https://kubernetes-sigs.github.io/service-apis/). @@ -102,7 +102,7 @@ See the [Service APIs](https://kubernetes-sigs.github.io/service-apis/) document 1. Access the _httpbin_ service using _curl_: {{< text bash >}} - $ curl -s -HHost:httpbin.example.com "http://$INGRESS_HOST:$INGRESS_PORT/get" + $ curl -s -I -HHost:httpbin.example.com "http://$INGRESS_HOST:$INGRESS_PORT/get" HTTP/1.1 200 OK server: istio-envoy ... diff --git a/content/en/docs/tasks/traffic-management/ingress/service-apis/snips.sh b/content/en/docs/tasks/traffic-management/ingress/service-apis/snips.sh new file mode 100644 index 0000000000..dea11d0a0c --- /dev/null +++ b/content/en/docs/tasks/traffic-management/ingress/service-apis/snips.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# shellcheck disable=SC2034,SC2153,SC2155,SC2164 + +# Copyright Istio Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#################################################################################################### +# WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL MARKDOWN FILE: +# docs/tasks/traffic-management/ingress/service-apis/index.md +#################################################################################################### + +snip_setup_1() { +kubectl kustomize "github.com/kubernetes-sigs/service-apis/config/crd?ref=v0.1.0" | kubectl apply -f - +} + +snip_setup_2() { +istioctl install --set values.pilot.env.PILOT_ENABLED_SERVICE_APIS=true +} + +snip_configuring_a_gateway_1() { +kubectl apply -f samples/httpbin/httpbin.yaml +} + +snip_configuring_a_gateway_2() { +kubectl apply -f - <