From 00235785327d644afbaa30fb1dc3229db2f7fc10 Mon Sep 17 00:00:00 2001 From: Kyle Hodgetts Date: Wed, 24 Nov 2021 11:39:31 +0200 Subject: [PATCH] Update Ambassador and Traefik quick start examples (#195) * Update Ambassador docs and example with correct cluster creation command and missing apply listener step * Update Traefik example --- docs/ambassador.md | 3 ++ docs/ambassador2.md | 3 ++ examples/petstore/README.md | 70 +++++++++++++++++++++++++++++-------- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/docs/ambassador.md b/docs/ambassador.md index a2325af..5b92b22 100644 --- a/docs/ambassador.md +++ b/docs/ambassador.md @@ -1,5 +1,8 @@ # Ambassador +** Note** +Ambassador uses `CustomResourceDefinition`s with `apiVersion` = `apiextensions.k8s.io/v1beta1` which was removed in Kubernetes version 1.22+. Please ensure your Kubernetes version is compatible with the version of Ambassador you're using + ```shell kusk ambassador --help Generates Ambassador Mappings for your service diff --git a/docs/ambassador2.md b/docs/ambassador2.md index 8ef736f..f306dbc 100644 --- a/docs/ambassador2.md +++ b/docs/ambassador2.md @@ -1,6 +1,9 @@ # Ambassador 2.0 **Warning**: Ambassador 2.0 is currently in Developer Preview and could change at any point, breaking the implementation here. +** Note** +Ambassador2 uses `CustomResourceDefinition`s with `apiVersion` = `apiextensions.k8s.io/v1` which is compatible with Kubernetes version 1.22+. Please ensure your Kubernetes version is compatible with the version of Ambassador you're using. + ```shell kusk ambassador2 --help diff --git a/examples/petstore/README.md b/examples/petstore/README.md index bb524a0..a12bebc 100644 --- a/examples/petstore/README.md +++ b/examples/petstore/README.md @@ -2,9 +2,31 @@ Sample petstore application from Swagger. -## Create cluster +## Prerequisites +This example uses k3d version v5.0.1 and Kubernetes version v1.22.2 +```shell +❯ k3d --version +k3d version v5.0.1 +k3s version latest (default) +``` + +```shell +kubectl version +Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4", GitCommit:"b695d79d4f967c403a96986f1750a35eb75e75f1", GitTreeState:"clean", BuildDate:"2021-11-17T15:41:42Z", GoVersion:"go1.16.10", Compiler:"gc", Platform:"darwin/amd64"} +Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2+k3s2", GitCommit:"3f5774b41eb475eb10c93bb0ce58459a6f777c5f", GitTreeState:"clean", BuildDate:"2021-10-05T20:29:33Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"} +``` + +## Create cluster if not using Traefik +```shell +k3d cluster create cl1 \ +-p 8080:80@loadbalancer \ +-p 8443:443@loadbalancer \ +--k3s-arg "--disable=traefik@server:0" +``` +## Create cluster if using Traefik ```shell k3d cluster create -p "8080:80@loadbalancer" -p "8443:443@loadbalancer" cl1 +kubectl wait --for=condition=available --timeout=600s deployment/traefik -n kube-system ``` Apply Petstore manifest @@ -17,28 +39,50 @@ kubectl apply -f examples/petstore/manifest.yaml ### Setup ```shell -kubectl apply -f https://www.getambassador.io/yaml/aes-crds.yaml && \ -kubectl wait --for condition=established --timeout=90s crd -lproduct=aes && \ -kubectl apply -f https://www.getambassador.io/yaml/aes.yaml && \ -kubectl -n ambassador wait --for condition=available --timeout=90s deploy -lproduct=aes +kubectl create namespace emissary && \ +kubectl apply -f https://app.getambassador.io/yaml/emissary/latest/emissary-crds.yaml && \ +kubectl wait --for condition=established --timeout=90s crd -lapp.kubernetes.io/name=ambassador && \ +kubectl apply -f https://app.getambassador.io/yaml/emissary/latest/emissary-ingress.yaml && \ +kubectl -n emissary wait --for condition=available --timeout=90s deploy -lproduct=aes +``` + +```shell +kubectl apply -f - <