From 1b38e61ae2f32972376ea109cd28f43207d9e4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 15:30:39 +0200 Subject: [PATCH 1/7] Added Linux support to generate_docs.sh script --- generate_docs.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generate_docs.sh b/generate_docs.sh index 63a72b8a..60478388 100755 --- a/generate_docs.sh +++ b/generate_docs.sh @@ -1,3 +1,13 @@ #!/bin/sh docker run -v `pwd`:/antora --rm -t antora/antora:2.2.0 --pull --stacktrace site-gh-pages.yml -open gh-pages/istio-tutorial/1.1.x/index.html +INDEX_BASE=gh-pages/istio-tutorial/1.6.x/index.html +case $(uname) in + Linux ) + xdg-open "$INDEX_BASE" + ;; + Darwin ) + open "$INDEX_BASE" + ;; + * ) + ;; +esac From c7fd3958b71e6b493370017bd1c04114dd7b57d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 15:31:12 +0200 Subject: [PATCH 2/7] Fixed Istio Linux releases URLs Linux releases have an arch prefix --- documentation/modules/ROOT/pages/1setup.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/modules/ROOT/pages/1setup.adoc b/documentation/modules/ROOT/pages/1setup.adoc index 98412733..87602638 100644 --- a/documentation/modules/ROOT/pages/1setup.adoc +++ b/documentation/modules/ROOT/pages/1setup.adoc @@ -11,7 +11,7 @@ include::https://raw.githubusercontent.com/redhat-developer-demos/rhd-tutorial-c | `istioctl` | https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-osx.tar.gz[Download] | https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-win.zip[Download] -| https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-linux.tar.gz[Download] +| https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-linux-amd64.tar.gz[Download] |=== include::https://raw.githubusercontent.com/redhat-developer-demos/rhd-tutorial-common/master/optional-requisites.adoc[] @@ -43,7 +43,7 @@ include::https://raw.githubusercontent.com/redhat-developer-demos/rhd-tutorial-c [#upstreamistioinstallation] == Istio Installation -[tabs, subs="attributes+,+macros"] +[tabs, subs="attributes+,+macros"] ==== Minikube:: + @@ -56,7 +56,7 @@ Minikube:: curl -L https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-osx.tar.gz | tar xz # Fedora/RHEL: -curl -L https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-linux.tar.gz | tar xz +curl -L https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-linux-amd64.tar.gz | tar xz # Windows curl -L https://github.com/istio/istio/releases/download/{istio-version}/istio-{istio-version}-win.zip @@ -142,4 +142,4 @@ kiali-774f655f6c-sv7nv 1/1 Running 0 18m prometheus-9db548fb6-vhwhc 3/3 Running 0 57m ---- -- -==== \ No newline at end of file +==== From 4ce794f7dde06273dad2686cde619e44e242bdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 15:34:44 +0200 Subject: [PATCH 3/7] No kube-inject required when using Openshift --- .../ROOT/pages/2deploy-microservices.adoc | 66 +++++++++++++++++++ .../ROOT/pages/4simple-routerules.adoc | 16 +++++ documentation/modules/ROOT/pages/8egress.adoc | 16 +++++ 3 files changed, 98 insertions(+) diff --git a/documentation/modules/ROOT/pages/2deploy-microservices.adoc b/documentation/modules/ROOT/pages/2deploy-microservices.adoc index 5126c758..68c8b06d 100644 --- a/documentation/modules/ROOT/pages/2deploy-microservices.adoc +++ b/documentation/modules/ROOT/pages/2deploy-microservices.adoc @@ -67,11 +67,27 @@ NOTE: You will deploy docker images that were previously built for this tutorial If you *have not built* the images on your own then let's deploy the customer pod with its sidecar using the already built images for this tutorial: +[tabs] +==== +Minikube:: ++ +-- [.console-input] [source,bash,subs="+macros,+attributes"] ---- kubectl apply -f <(istioctl kube-inject -f link:{github-repo}/{customer-repo}/kubernetes/Deployment.yml[{customer-repo}/kubernetes/Deployment.yml]) -n tutorial{namespace-suffix} ---- +-- +OpenShift:: ++ +-- +[.console-input] +[source,bash,subs="+macros,+attributes"] +---- +kubectl apply -f link:{github-repo}/{customer-repo}/kubernetes/Deployment.yml[{customer-repo}/kubernetes/Deployment.yml] -n tutorial{namespace-suffix} +---- +-- +==== [.console-input] [source,bash,subs="+macros,+attributes"] @@ -103,11 +119,29 @@ kubectl get pods -w -n tutorial{namespace-suffix} kubectl get svc istio-ingressgateway -n istio-system ---- +[tabs] +==== +Minikube:: ++ +-- [.console-output] [source,bash,subs="attributes+,+macros"] ---- istio-ingressgateway LoadBalancer 10.101.82.250 15020:31582/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:30818/TCP,15030:32542/TCP,15031:30106/TCP,15032:32284/TCP,15443:31080/TCP 19m ---- +-- + +OpenShift:: ++ +-- +[.console-output] +[source,bash,subs="attributes+,+macros"] +---- +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +istio-ingressgateway ClusterIP 172.21.17.3 15021/TCP,80/TCP,443/TCP,15443/TCP 41m +---- +-- +==== [tabs] ==== @@ -195,11 +229,27 @@ NOTE: You will deploy docker images that were previously built for this tutorial If you *have not built* the images on your own then let's deploy the customer pod with its sidecar using the already built images for this tutorial: +[tabs] +==== +Minikube:: ++ +-- [.console-input] [source,bash,subs="+macros,+attributes"] ---- kubectl apply -f <(istioctl kube-inject -f link:{github-repo}/{preference-repo}/kubernetes/Deployment.yml[{preference-repo}/kubernetes/Deployment.yml]) -n tutorial{namespace-suffix} ---- +-- +OpenShift:: ++ +-- +[.console-input] +[source,bash,subs="+macros,+attributes"] +---- +kubectl apply -f link:{github-repo}/{preference-repo}/kubernetes/Deployment.yml[{preference-repo}/kubernetes/Deployment.yml] -n tutorial{namespace-suffix} +---- +-- +==== [.console-input] [source,bash,subs="+macros,+attributes"] @@ -262,11 +312,27 @@ NOTE: You will deploy docker images that were previously built for this tutorial If you *have not built* the images on your own then let's deploy the customer pod with its sidecar using the already built images for this tutorial: +[tabs] +==== +Minikube:: ++ +-- [.console-input] [source,bash,subs="+macros,+attributes"] ---- kubectl apply -f <(istioctl kube-inject -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment.yml[{recommendation-repo}/kubernetes/Deployment.yml]) -n tutorial{namespace-suffix} ---- +-- +OpenShift:: ++ +-- +[.console-input] +[source,bash,subs="+macros,+attributes"] +---- +kubectl apply -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment.yml[{recommendation-repo}/kubernetes/Deployment.yml] -n tutorial{namespace-suffix} +---- +-- +==== [.console-input] [source,bash,subs="+macros,+attributes"] diff --git a/documentation/modules/ROOT/pages/4simple-routerules.adoc b/documentation/modules/ROOT/pages/4simple-routerules.adoc index cd586318..314446a4 100644 --- a/documentation/modules/ROOT/pages/4simple-routerules.adoc +++ b/documentation/modules/ROOT/pages/4simple-routerules.adoc @@ -16,11 +16,27 @@ If you *have not built* the images on your own then let's deploy the customer po == Deploy Recommendation microservice V2 using an existing image +[tabs] +==== +Minikube:: ++ +-- [.console-input] [source,bash,subs="+macros,+attributes"] ---- kubectl apply -f <(istioctl kube-inject -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment-v2.yml[{recommendation-repo}/kubernetes/Deployment-v2.yml]) -n tutorial{namespace-suffix} ---- +-- +OpenShift:: ++ +-- +[.console-input] +[source,bash,subs="+macros,+attributes"] +---- +kubectl apply -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment-v2.yml[{recommendation-repo}/kubernetes/Deployment-v2.yml] -n tutorial{namespace-suffix} +---- +-- +==== === Wait for v2 to be deployed diff --git a/documentation/modules/ROOT/pages/8egress.adoc b/documentation/modules/ROOT/pages/8egress.adoc index 59fe0fa9..55ba4deb 100644 --- a/documentation/modules/ROOT/pages/8egress.adoc +++ b/documentation/modules/ROOT/pages/8egress.adoc @@ -26,11 +26,27 @@ NOTE: You will deploy docker images that were previously built for this tutorial If you *have not built* the images on your own then let's deploy the customer pod with its sidecar using the already built images for this tutorial: +[tabs] +==== +Minikube:: ++ +-- [.console-input] [source,bash, subs="+macros,+attributes"] ---- kubectl apply -f <(istioctl kube-inject -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment-v3.yml[{recommendation-repo}/kubernetes/Deployment-v3.yml]) -n tutorial ---- +-- +OpenShift:: ++ +-- +[.console-input] +[source,bash, subs="+macros,+attributes"] +---- +kubectl apply -f link:{github-repo}/{recommendation-repo}/kubernetes/Deployment-v3.yml[{recommendation-repo}/kubernetes/Deployment-v3.yml] -n tutorial +---- +-- +==== [.console-input] [source,bash,subs="+macros,+attributes"] From 30c6f23d483803859d75edc27ec12621f00253db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 15:40:15 +0200 Subject: [PATCH 4/7] Fix navigation to Istio installation --- documentation/modules/ROOT/nav.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/modules/ROOT/nav.adoc b/documentation/modules/ROOT/nav.adoc index 228734a0..3edf6a81 100644 --- a/documentation/modules/ROOT/nav.adoc +++ b/documentation/modules/ROOT/nav.adoc @@ -10,7 +10,7 @@ ifndef::workshop[] ** xref:1setup.adoc#download-tutorial-sources[Download Tutorial] ** xref:1setup.adoc#install-minikube[Install Minikube] ** xref:1setup.adoc#start-kubernetes[Start Kubernetes] -** xref:1setup.adoc#istioinstallation[Install Istio] +** xref:1setup.adoc#upstreamistioinstallation[Install Istio] endif::workshop[] * xref:2deploy-microservices.adoc[2. Deploy Microservices] From acb227609ac2801607b1865314bfe20c8dc4b4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 16:07:41 +0200 Subject: [PATCH 5/7] Add OpenShift ServiceMeshMember creation Automatic sidecar injection won't work without a ServiceMeshMember present in the target project. --- .../modules/ROOT/pages/2deploy-microservices.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/documentation/modules/ROOT/pages/2deploy-microservices.adoc b/documentation/modules/ROOT/pages/2deploy-microservices.adoc index 68c8b06d..63126d4e 100644 --- a/documentation/modules/ROOT/pages/2deploy-microservices.adoc +++ b/documentation/modules/ROOT/pages/2deploy-microservices.adoc @@ -40,7 +40,15 @@ kubectl create namespace tutorial{namespace-suffix} ---- kubectl config set-context $(kubectl config current-context) --namespace=tutorial{namespace-suffix} ---- +=== (Openshift only) Create Service Mesh Member in your project +When using Openshift, you need to declare a Service Mesh Member in your `tutorial` project. +See https://docs.openshift.com/container-platform/4.6/service_mesh/v2x/installing-ossm.html#ossm-member-roll-create-member_installing-ossm for details. +From OpenShift Web Console, it's as simple as selecting the `tutorial` project in "Installed Operators", opening "Istio Service Mesh Member", and clicking on the "Create ServiceMeshMember" button. + +Select `istio-system` as the namespace for the "Control Plane Ref" and click the "Create" button + +=== Check proper communication between istioctl and your cluster Start deploying the microservice projects, starting with customer Make sure `istioctl` is in your `PATH`: From 665ac5a24a8e56ee43dba93feb2cec0b6f942f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 16:30:46 +0200 Subject: [PATCH 6/7] Revert "Add OpenShift ServiceMeshMember creation" This reverts commit acb227609ac2801607b1865314bfe20c8dc4b4d1. --- .../modules/ROOT/pages/2deploy-microservices.adoc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/documentation/modules/ROOT/pages/2deploy-microservices.adoc b/documentation/modules/ROOT/pages/2deploy-microservices.adoc index 63126d4e..68c8b06d 100644 --- a/documentation/modules/ROOT/pages/2deploy-microservices.adoc +++ b/documentation/modules/ROOT/pages/2deploy-microservices.adoc @@ -40,15 +40,7 @@ kubectl create namespace tutorial{namespace-suffix} ---- kubectl config set-context $(kubectl config current-context) --namespace=tutorial{namespace-suffix} ---- -=== (Openshift only) Create Service Mesh Member in your project -When using Openshift, you need to declare a Service Mesh Member in your `tutorial` project. -See https://docs.openshift.com/container-platform/4.6/service_mesh/v2x/installing-ossm.html#ossm-member-roll-create-member_installing-ossm for details. -From OpenShift Web Console, it's as simple as selecting the `tutorial` project in "Installed Operators", opening "Istio Service Mesh Member", and clicking on the "Create ServiceMeshMember" button. - -Select `istio-system` as the namespace for the "Control Plane Ref" and click the "Create" button - -=== Check proper communication between istioctl and your cluster Start deploying the microservice projects, starting with customer Make sure `istioctl` is in your `PATH`: From 22333a2904d6001145f2d9a37aed674f0a850fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Rondinaud?= Date: Sun, 4 Apr 2021 17:13:44 +0200 Subject: [PATCH 7/7] Detailed project create wrt. Service Mesh Member Roll --- documentation/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/2deploy-microservices.adoc | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/documentation/modules/ROOT/nav.adoc b/documentation/modules/ROOT/nav.adoc index 3edf6a81..9bc815fb 100644 --- a/documentation/modules/ROOT/nav.adoc +++ b/documentation/modules/ROOT/nav.adoc @@ -14,6 +14,7 @@ ifndef::workshop[] endif::workshop[] * xref:2deploy-microservices.adoc[2. Deploy Microservices] +** xref:2deploy-microservices.adoc#createproject[Create Project] ** xref:2deploy-microservices.adoc#deploycustomer[Deploy Customer] ** xref:2deploy-microservices.adoc#deploypreference[Deploy Preference] ** xref:2deploy-microservices.adoc#deployrecommendation[Deploy Recommendation] diff --git a/documentation/modules/ROOT/pages/2deploy-microservices.adoc b/documentation/modules/ROOT/pages/2deploy-microservices.adoc index 68c8b06d..82ac9ced 100644 --- a/documentation/modules/ROOT/pages/2deploy-microservices.adoc +++ b/documentation/modules/ROOT/pages/2deploy-microservices.adoc @@ -16,9 +16,8 @@ oc login -u user$WORKSHOP_USER -p openshift {ocpurl} ---- endif::workshop[] -[#deploycustomer] -== Deploy customer - +[#createproject] +== Create the `tutorial` project Make sure you are logged in [.console-input] @@ -41,6 +40,26 @@ kubectl create namespace tutorial{namespace-suffix} kubectl config set-context $(kubectl config current-context) --namespace=tutorial{namespace-suffix} ---- +=== ServiceMemberRoll (only in OpenShift) +When working with OpenShift, you need to either: + +1. add your project to one of the ServiceMemberRoll in the `istio-system` namespace +2. create a ServiceMember in the `tutorial` project. + +If you opt for the first option, you might have to wait a bit for the Mesh service to enroll your +project. + +If you're in a hurry, create a ServiceMember in the `tutorial` project: + +1. from the "Installed operators", select the `tutorial` project from the Project drop-down +2. click on the "Istio Service Mesh Member" +3. click on the "Create ServiceMeshMember" button +4. open the "Control Plane Ref" +5. select the `istio-system` as the Namespace +6. click on the "Create" button + +[#deploycustomer] +== Deploy customer Start deploying the microservice projects, starting with customer Make sure `istioctl` is in your `PATH`: