Update ambient getting started for ingress gw not installed by default (#12979)

* Update ambient getting started for ingress gw not installed by default

* fix index

* tweak

* fix tests

* fix tests
This commit is contained in:
Frank Budinsky 2023-04-03 09:48:33 -04:00 committed by GitHub
parent fd095a1374
commit 13a3f3ddd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 146 additions and 66 deletions

View File

@ -49,44 +49,6 @@ Follow these steps to get started with ambient:
EOF
{{< /text >}}
1. The `ambient` profile is designed to help you get started with ambient mesh.
Install Istio with the `ambient` profile on your Kubernetes cluster, using
the `istioctl` command downloaded above:
{{< text bash >}}
$ istioctl install --set profile=ambient --skip-confirmation
{{< /text >}}
1. After running the above command, youll get the following output that indicates
five components (including {{< gloss "ztunnel" >}}Ztunnel{{< /gloss >}}) have been installed successfully!
{{< text syntax=plain snip_id=none >}}
✔ Istio core installed
✔ Istiod installed
✔ CNI installed
✔ Ingress gateways installed
✔ Ztunnel installed
✔ Installation complete
{{< /text >}}
1. Verify the installed components using the following commands:
{{< text bash >}}
$ kubectl get pods -n istio-system
NAME READY STATUS RESTARTS AGE
istio-cni-node-n9tcd 1/1 Running 0 57s
istio-ingressgateway-5b79b5bb88-897lp 1/1 Running 0 57s
istiod-69d4d646cd-26cth 1/1 Running 0 67s
ztunnel-lr7lz 1/1 Running 0 69s
{{< /text >}}
{{< text bash >}}
$ kubectl get daemonset -n istio-system
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
istio-cni-node 1 1 1 1 1 kubernetes.io/os=linux 70s
ztunnel 1 1 1 1 1 <none> 82s
{{< /text >}}
1. Install Kubernetes Gateway CRDs, which dont come installed by default on most Kubernetes clusters:
{{< text bash >}}
@ -99,6 +61,98 @@ Follow these steps to get started with ambient:
{{< boilerplate gateway-api-choose >}}
{{< /tip >}}
1. The `ambient` profile is designed to help you get started with ambient mesh.
Install Istio with the `ambient` profile on your Kubernetes cluster, using
the `istioctl` command downloaded above:
{{< tabset category-name="config-api" >}}
{{< tab name="Istio classic" category-value="istio-classic" >}}
{{< text bash >}}
$ istioctl install --set profile=ambient --set components.ingressGateways[0].enabled=true --set components.ingressGateways[0].name=istio-ingressgateway --skip-confirmation
{{< /text >}}
After running the above command, youll get the following output that indicates
five components (including {{< gloss "ztunnel" >}}Ztunnel{{< /gloss >}}) have been installed successfully!
{{< text syntax=plain snip_id=none >}}
✔ Istio core installed
✔ Istiod installed
✔ CNI installed
✔ Ingress gateways installed
✔ Ztunnel installed
✔ Installation complete
{{< /text >}}
{{< /tab >}}
{{< tab name="Gateway API" category-value="gateway-api" >}}
{{< text bash >}}
$ istioctl install --set profile=ambient --skip-confirmation
{{< /text >}}
After running the above command, youll get the following output that indicates
four components (including {{< gloss "ztunnel" >}}Ztunnel{{< /gloss >}}) have been installed successfully!
{{< text syntax=plain snip_id=none >}}
✔ Istio core installed
✔ Istiod installed
✔ CNI installed
✔ Ztunnel installed
✔ Installation complete
{{< /text >}}
{{< /tab >}}
{{< /tabset >}}
5) Verify the installed components using the following commands:
{{< tabset category-name="config-api" >}}
{{< tab name="Istio classic" category-value="istio-classic" >}}
{{< text bash >}}
$ kubectl get pods -n istio-system
NAME READY STATUS RESTARTS AGE
istio-cni-node-n9tcd 1/1 Running 0 57s
istio-ingressgateway-5b79b5bb88-897lp 1/1 Running 0 57s
istiod-69d4d646cd-26cth 1/1 Running 0 67s
ztunnel-lr7lz 1/1 Running 0 69s
{{< /text >}}
{{< text bash >}}
$ kubectl get daemonset -n istio-system
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
istio-cni-node 1 1 1 1 1 kubernetes.io/os=linux 70s
ztunnel 1 1 1 1 1 <none> 82s
{{< /text >}}
{{< /tab >}}
{{< tab name="Gateway API" category-value="gateway-api" >}}
{{< text bash >}}
$ kubectl get pods -n istio-system
NAME READY STATUS RESTARTS AGE
istio-cni-node-n9tcd 1/1 Running 0 57s
istiod-69d4d646cd-26cth 1/1 Running 0 67s
ztunnel-lr7lz 1/1 Running 0 69s
{{< /text >}}
{{< text bash >}}
$ kubectl get daemonset -n istio-system
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
istio-cni-node 1 1 1 1 1 kubernetes.io/os=linux 70s
ztunnel 1 1 1 1 1 <none> 82s
{{< /text >}}
{{< /tab >}}
{{< /tabset >}}
## Deploy the sample application {#bookinfo}
Youll use the sample [bookinfo application](/docs/examples/bookinfo/), which is part of
@ -152,24 +206,17 @@ the bookinfo app from outside the cluster:
{{< text bash >}}
$ sed -e 's/from: Same/from: All/'\
-e '/^ name: bookinfo-gateway/a\
-e '/^ name: bookinfo-gateway/a\
namespace: istio-system\
' -e '/^ - name: bookinfo-gateway/a\
' -e '/^ - name: bookinfo-gateway/a\
namespace: istio-system\
' @samples/bookinfo/gateway-api/bookinfo-gateway.yaml@ | kubectl apply -f -
{{< /text >}}
Creating a Kubernetes Gateway resource deploys an associated
[proxy service](/docs/tasks/traffic-management/ingress/gateway-api/#automated-deployment), so run the following command
to wait for the gateway to be ready:
{{< text bash >}}
$ kubectl wait --for=condition=programmed gtw/bookinfo-gateway -n istio-system
{{< /text >}}
Set the environment variables for the Kubernetes gateway:
{{< text bash >}}
$ kubectl wait --for=condition=programmed gtw/bookinfo-gateway -n istio-system
$ export GATEWAY_HOST=bookinfo-gateway-istio.istio-system
$ export GATEWAY_SERVICE_ACCOUNT=ns/istio-system/sa/bookinfo-gateway-istio
{{< /text >}}

View File

@ -21,14 +21,23 @@
####################################################################################################
snip_download_and_install_download_2() {
kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null || \
{ kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.6.1" | kubectl apply -f -; }
}
snip_download_and_install_download_3() {
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=ambient --set components.ingressGateways[0].enabled=true --set components.ingressGateways[0].name=istio-ingressgateway --skip-confirmation
}
snip_download_and_install_download_5() {
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=ambient --skip-confirmation
}
snip_download_and_install_download_4() {
snip_download_and_install_download_7() {
kubectl get pods -n istio-system
}
! read -r -d '' snip_download_and_install_download_4_out <<\ENDSNIP
! read -r -d '' snip_download_and_install_download_7_out <<\ENDSNIP
NAME READY STATUS RESTARTS AGE
istio-cni-node-n9tcd 1/1 Running 0 57s
istio-ingressgateway-5b79b5bb88-897lp 1/1 Running 0 57s
@ -36,21 +45,37 @@ istiod-69d4d646cd-26cth 1/1 Running 0 67s
ztunnel-lr7lz 1/1 Running 0 69s
ENDSNIP
snip_download_and_install_download_5() {
snip_download_and_install_download_8() {
kubectl get daemonset -n istio-system
}
! read -r -d '' snip_download_and_install_download_5_out <<\ENDSNIP
! read -r -d '' snip_download_and_install_download_8_out <<\ENDSNIP
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
istio-cni-node 1 1 1 1 1 kubernetes.io/os=linux 70s
ztunnel 1 1 1 1 1 <none> 82s
ENDSNIP
snip_download_and_install_download_6() {
kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null || \
{ kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.6.1" | kubectl apply -f -; }
snip_download_and_install_download_9() {
kubectl get pods -n istio-system
}
! read -r -d '' snip_download_and_install_download_9_out <<\ENDSNIP
NAME READY STATUS RESTARTS AGE
istio-cni-node-n9tcd 1/1 Running 0 57s
istiod-69d4d646cd-26cth 1/1 Running 0 67s
ztunnel-lr7lz 1/1 Running 0 69s
ENDSNIP
snip_download_and_install_download_10() {
kubectl get daemonset -n istio-system
}
! read -r -d '' snip_download_and_install_download_10_out <<\ENDSNIP
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
istio-cni-node 1 1 1 1 1 kubernetes.io/os=linux 70s
ztunnel 1 1 1 1 1 <none> 82s
ENDSNIP
snip_deploy_the_sample_application_bookinfo_2() {
kubectl apply -f samples/sleep/sleep.yaml
kubectl apply -f samples/sleep/notsleep.yaml
@ -67,18 +92,15 @@ export GATEWAY_SERVICE_ACCOUNT=ns/istio-system/sa/istio-ingressgateway-service-a
snip_deploy_the_sample_application_bookinfo_5() {
sed -e 's/from: Same/from: All/'\
-e '/^ name: bookinfo-gateway/a\
-e '/^ name: bookinfo-gateway/a\
namespace: istio-system\
' -e '/^ - name: bookinfo-gateway/a\
' -e '/^ - name: bookinfo-gateway/a\
namespace: istio-system\
' samples/bookinfo/gateway-api/bookinfo-gateway.yaml | kubectl apply -f -
}
snip_deploy_the_sample_application_bookinfo_6() {
kubectl wait --for=condition=programmed gtw/bookinfo-gateway -n istio-system
}
snip_deploy_the_sample_application_bookinfo_7() {
export GATEWAY_HOST=bookinfo-gateway-istio.istio-system
export GATEWAY_SERVICE_ACCOUNT=ns/istio-system/sa/bookinfo-gateway-istio
}

View File

@ -25,16 +25,28 @@ set -o pipefail
source "tests/util/samples.sh"
# install istio with ambient profile
# Kubernetes Gateway API CRDs are required by waypoint proxy.
snip_download_and_install_download_2
# install istio with ambient profile
if [ "$GATEWAY_API" == "true" ]; then
snip_download_and_install_download_5
else
snip_download_and_install_download_3
fi
_wait_for_deployment istio-system istiod
_wait_for_daemonset istio-system ztunnel
_wait_for_daemonset istio-system istio-cni-node
_verify_like snip_download_and_install_download_4 "$snip_download_and_install_download_4_out"
_verify_like snip_download_and_install_download_5 "$snip_download_and_install_download_5_out"
# Kubernetes Gateway API CRDs are required by waypoint proxy.
snip_download_and_install_download_6
if [ "$GATEWAY_API" == "true" ]; then
# TODO: uncomment the following line after https://github.com/istio/istio/pull/44187 is available
#_verify_like snip_download_and_install_download_9 "$snip_download_and_install_download_9_out"
_verify_like snip_download_and_install_download_10 "$snip_download_and_install_download_10_out"
else
_verify_like snip_download_and_install_download_7 "$snip_download_and_install_download_7_out"
_verify_like snip_download_and_install_download_8 "$snip_download_and_install_download_8_out"
fi
# deploy test application
startup_bookinfo_sample
@ -43,7 +55,6 @@ snip_deploy_the_sample_application_bookinfo_2
if [ "$GATEWAY_API" == "true" ]; then
snip_deploy_the_sample_application_bookinfo_5
snip_deploy_the_sample_application_bookinfo_6
snip_deploy_the_sample_application_bookinfo_7
else
snip_deploy_the_sample_application_bookinfo_4
fi