From 8d94726d98aad1eebff61839b174b2d0379cc0d4 Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Fri, 10 Nov 2023 07:49:11 -0500 Subject: [PATCH] WIP --- README.md | 102 +++++++++++++++++---------------- {west => site-1}/frontend.yaml | 0 {west => site-1}/site.yaml | 4 +- {east => site-2}/backend.yaml | 0 {east => site-2}/site.yaml | 2 +- skewer.yaml | 86 ++++++++++++++------------- 6 files changed, 102 insertions(+), 92 deletions(-) rename {west => site-1}/frontend.yaml (100%) rename {west => site-1}/site.yaml (68%) rename {east => site-2}/backend.yaml (100%) rename {east => site-2}/site.yaml (85%) diff --git a/README.md b/README.md index 12f7b7c..33bc323 100644 --- a/README.md +++ b/README.md @@ -80,16 +80,16 @@ Start a console session for each of your namespaces. Set the `KUBECONFIG` environment variable to a different path in each session. -_**Console for west:**_ +_**Console for site-1:**_ ~~~ shell -export KUBECONFIG=~/.kube/config-west +export KUBECONFIG=~/.kube/config-site-1 ~~~ -_**Console for east:**_ +_**Console for site-2:**_ ~~~ shell -export KUBECONFIG=~/.kube/config-east +export KUBECONFIG=~/.kube/config-site-2 ~~~ ## Step 2: Access your clusters @@ -107,18 +107,18 @@ Use `kubectl create namespace` to create the namespaces you wish to use (or use existing namespaces). Use `kubectl config set-context` to set the current namespace for each session. -_**Console for west:**_ +_**Console for site-1:**_ ~~~ shell -kubectl create namespace west -kubectl config set-context --current --namespace west +kubectl create namespace site-1 +kubectl config set-context --current --namespace site-1 ~~~ -_**Console for east:**_ +_**Console for site-2:**_ ~~~ shell -kubectl create namespace east -kubectl config set-context --current --namespace east +kubectl create namespace site-2 +kubectl config set-context --current --namespace site-2 ~~~ ## Step 4: Install Skupper in your namespaces @@ -131,13 +131,13 @@ tunnel`][minikube-tunnel] before you install Skupper. [minikube-tunnel]: https://skupper.io/start/minikube.html#running-minikube-tunnel -_**Console for west:**_ +_**Console for site-1:**_ ~~~ shell kubectl apply -f skupper.yaml ~~~ -_**Console for east:**_ +_**Console for site-2:**_ ~~~ shell kubectl apply -f skupper.yaml @@ -148,28 +148,29 @@ kubectl apply -f skupper.yaml To configure our example sites and service bindings, we are using the following resources: -West: +Site 1: -* [site.yaml](west/site.yaml) - Configuration for site `west` -* [frontend.yaml](west/frontend.yaml) - The Hello World frontend +* [site.yaml](site-1/site.yaml) - Skupper configuration for site 1 +* [frontend.yaml](site-1/frontend.yaml) - The Hello World frontend -East: +Site 2: -* [site.yaml](east/site.yaml) - Configuration for site `east` -* [backend.yaml](east/backend.yaml) - The Hello World backend +* [site.yaml](site-2/site.yaml) - Skupper configuration for site 2 +* [backend.yaml](site-2/backend.yaml) - The Hello World backend Let's look at some of these resources in more detail. -#### Resources in west +#### Resources in site 1 The `site` ConfigMap defines a Skupper site for its associated Kubernetes namespace. This is where you set site configuration -options. See the [config reference][config] for more -information. +options. We are setting the `console` and `flow-collector` +options here in order to enable the console. See the [config +reference][config] for more information. [config]: https://skupper.io/docs/declarative/index.html -[site.yaml](west/site.yaml): +[site.yaml](site-1/site.yaml): ~~~ yaml apiVersion: v1 @@ -177,17 +178,18 @@ kind: ConfigMap metadata: name: skupper-site data: - name: west + name: site-1 + console: "true" + flow-collector: "true" ~~~ -#### Resources in east +#### Resources in site 2 -Like the one for west, here is the Skupper site definition for -the east namespace. It includes the `ingress: "false"` setting -since no ingress is required at this site for the Hello World -example. +Like the one for site 1, here is the Skupper site definition for +the site 2. It includes the `ingress: "false"` setting since no +ingress is required at this site for the Hello World example. -[site.yaml](east/site.yaml): +[site.yaml](site-2/site.yaml): ~~~ yaml apiVersion: v1 @@ -195,17 +197,17 @@ kind: ConfigMap metadata: name: skupper-site data: - name: east + name: site-2 ingress: "false" ~~~ -In east, the `backend` deployment has an annotation named +In site 2, the `backend` deployment has an annotation named `skupper.io/proxy` with the value `tcp`. This tells Skupper to expose the backend on the Skupper network. As a consequence, -the frontend in west will be able to see the backend and call +the frontend in site 1 will be able to see the backend and call its API. -[backend.yaml](east/backend.yaml): +[backend.yaml](site-2/backend.yaml):
apiVersion: apps/v1
 kind: Deployment
@@ -234,31 +236,31 @@ spec:
 Now we're ready to apply everything.  Use the `kubectl apply`
 command with the resource definitions for each site.
 
-_**Console for west:**_
+_**Console for site-1:**_
 
 ~~~ shell
-kubectl apply -f west/site.yaml -f west/frontend.yaml
+kubectl apply -f site-1/site.yaml -f site-1/frontend.yaml
 ~~~
 
 _Sample output:_
 
 ~~~ console
-$ kubectl apply -f west/site.yaml -f west/frontend.yaml
+$ kubectl apply -f site-1/site.yaml -f site-1/frontend.yaml
 configmap/skupper-site created
 deployment.apps/frontend created
 service/frontend created
 ~~~
 
-_**Console for east:**_
+_**Console for site-2:**_
 
 ~~~ shell
-kubectl apply -f east/site.yaml -f east/backend.yaml
+kubectl apply -f site-2/site.yaml -f site-2/backend.yaml
 ~~~
 
 _Sample output:_
 
 ~~~ console
-$ kubectl apply -f east/site.yaml -f east/backend.yaml
+$ kubectl apply -f site-2/site.yaml -f site-2/backend.yaml
 configmap/skupper-site created
 deployment.apps/backend created
 ~~~
@@ -277,7 +279,7 @@ Backstage, or Vault.  See [Token distribution]() for more
 information.
 
 This example uses the Skupper command line tool to generate the
-secret token in west and create the link in east.
+secret token in site 1 and create the link in site 2.
 
 To install the Skupper command:
 
@@ -289,12 +291,12 @@ For more installation options, see [Installing
 Skupper][install].
 
 Once the command is installed, use `skupper token create` in
-west to generate the token.  Then, use `skupper link create` in
-east to create a link.
+site 1 to generate the token.  Then, use `skupper link create` in
+site 2 to create a link.
 
 [install]: https://skupper.io/install/index.html
 
-_**Console for west:**_
+_**Console for site-1:**_
 
 ~~~ shell
 skupper token create ~/secret.token
@@ -307,7 +309,7 @@ $ skupper token create ~/secret.token
 Token written to ~/secret.token
 ~~~
 
-_**Console for east:**_
+_**Console for site-2:**_
 
 ~~~ shell
 skupper link create ~/secret.token
@@ -336,7 +338,7 @@ that address.
 **Note:** The `` field in the following commands is a
 placeholder.  The actual value is an IP address.
 
-_**Console for west:**_
+_**Console for site-1:**_
 
 ~~~ shell
 kubectl get service/frontend
@@ -362,16 +364,18 @@ navigating to `http://:8080/` in your browser.
 To remove Skupper and the other resources from this exercise, use
 the following commands.
 
-_**Console for west:**_
+_**Console for site-1:**_
 
 ~~~ shell
-kubectl delete -f skupper.yaml -f west/site.yaml -f west/frontend.yaml
+kubectl delete -f site-1/site.yaml -f site-1/frontend.yaml
+kubectl delete -f skupper.yaml
 ~~~
 
-_**Console for east:**_
+_**Console for site-2:**_
 
 ~~~ shell
-kubectl delete -f skupper.yaml -f east/site.yaml -f east/backend.yaml
+kubectl delete -f site-2/site.yaml -f site-2/backend.yaml
+kubectl delete -f skupper.yaml
 ~~~
 
 ## Next steps
diff --git a/west/frontend.yaml b/site-1/frontend.yaml
similarity index 100%
rename from west/frontend.yaml
rename to site-1/frontend.yaml
diff --git a/west/site.yaml b/site-1/site.yaml
similarity index 68%
rename from west/site.yaml
rename to site-1/site.yaml
index b1f1f9e..71a6062 100644
--- a/west/site.yaml
+++ b/site-1/site.yaml
@@ -3,6 +3,6 @@ kind: ConfigMap
 metadata:
   name: skupper-site
 data:
-  name: west
+  name: site-1
   console: "true"
-  flow-controller: "true"
+  flow-collector: "true"
diff --git a/east/backend.yaml b/site-2/backend.yaml
similarity index 100%
rename from east/backend.yaml
rename to site-2/backend.yaml
diff --git a/east/site.yaml b/site-2/site.yaml
similarity index 85%
rename from east/site.yaml
rename to site-2/site.yaml
index 220d597..65fcde0 100644
--- a/east/site.yaml
+++ b/site-2/site.yaml
@@ -3,5 +3,5 @@ kind: ConfigMap
 metadata:
   name: skupper-site
 data:
-  name: east
+  name: site-2
   ingress: "false"
diff --git a/skewer.yaml b/skewer.yaml
index 15981c4..5f9e775 100644
--- a/skewer.yaml
+++ b/skewer.yaml
@@ -23,12 +23,14 @@ overview: |
 
   [hello-world]: https://github.com/skupperproject/skupper-example-hello-world
 sites:
-  west:
-    kubeconfig: ~/.kube/config-west
-    namespace: west
-  east:
-    kubeconfig: ~/.kube/config-east
-    namespace: east
+  site-1:
+    title: site 1
+    kubeconfig: ~/.kube/config-site-1
+    namespace: site-1
+  site-2:
+    title: site 2
+    kubeconfig: ~/.kube/config-site-2
+    namespace: site-2
 steps:
   - standard: configure_separate_console_sessions
   - standard: access_your_clusters
@@ -43,37 +45,38 @@ steps:
 
       [minikube-tunnel]: https://skupper.io/start/minikube.html#running-minikube-tunnel
     commands:
-      west:
+      site-1:
         - run: kubectl apply -f skupper.yaml
-      east:
+      site-2:
         - run: kubectl apply -f skupper.yaml
   - title: Apply your YAML resources
     preamble: |
       To configure our example sites and service bindings, we are
       using the following resources:
 
-      West:
+      Site 1:
 
-      * [site.yaml](west/site.yaml) - Configuration for site `west`
-      * [frontend.yaml](west/frontend.yaml) - The Hello World frontend
+      * [site.yaml](site-1/site.yaml) - Skupper configuration for site 1
+      * [frontend.yaml](site-1/frontend.yaml) - The Hello World frontend
 
-      East:
+      Site 2:
 
-      * [site.yaml](east/site.yaml) - Configuration for site `east`
-      * [backend.yaml](east/backend.yaml) - The Hello World backend
+      * [site.yaml](site-2/site.yaml) - Skupper configuration for site 2
+      * [backend.yaml](site-2/backend.yaml) - The Hello World backend
 
       Let's look at some of these resources in more detail.
 
-      #### Resources in west
+      #### Resources in site 1
 
       The `site` ConfigMap defines a Skupper site for its associated
       Kubernetes namespace.  This is where you set site configuration
-      options.  See the [config reference][config] for more
-      information.
+      options.  We are setting the `console` and `flow-collector`
+      options here in order to enable the console.  See the [config
+      reference][config] for more information.
 
       [config]: https://skupper.io/docs/declarative/index.html
 
-      [site.yaml](west/site.yaml):
+      [site.yaml](site-1/site.yaml):
 
       ~~~ yaml
       apiVersion: v1
@@ -81,17 +84,18 @@ steps:
       metadata:
         name: skupper-site
       data:
-        name: west
+        name: site-1
+        console: "true"
+        flow-collector: "true"
       ~~~
 
-      #### Resources in east
+      #### Resources in site 2
 
-      Like the one for west, here is the Skupper site definition for
-      the east namespace.  It includes the `ingress: "false"` setting
-      since no ingress is required at this site for the Hello World
-      example.
+      Like the one for site 1, here is the Skupper site definition for
+      the site 2.  It includes the `ingress: "false"` setting since no
+      ingress is required at this site for the Hello World example.
 
-      [site.yaml](east/site.yaml):
+      [site.yaml](site-2/site.yaml):
 
       ~~~ yaml
       apiVersion: v1
@@ -99,17 +103,17 @@ steps:
       metadata:
         name: skupper-site
       data:
-        name: east
+        name: site-2
         ingress: "false"
       ~~~
 
-      In east, the `backend` deployment has an annotation named
+      In site 2, the `backend` deployment has an annotation named
       `skupper.io/proxy` with the value `tcp`.  This tells Skupper to
       expose the backend on the Skupper network.  As a consequence,
-      the frontend in west will be able to see the backend and call
+      the frontend in site 1 will be able to see the backend and call
       its API.
 
-      [backend.yaml](east/backend.yaml):
+      [backend.yaml](site-2/backend.yaml):
 
       
apiVersion: apps/v1
       kind: Deployment
@@ -138,15 +142,15 @@ steps:
       Now we're ready to apply everything.  Use the `kubectl apply`
       command with the resource definitions for each site.
     commands:
-      west:
-        - run: kubectl apply -f west/site.yaml -f west/frontend.yaml
+      site-1:
+        - run: kubectl apply -f site-1/site.yaml -f site-1/frontend.yaml
           output: |
             configmap/skupper-site created
             deployment.apps/frontend created
             service/frontend created
         - await_external_ip: service/skupper
-      east:
-        - run: kubectl apply -f east/site.yaml -f east/backend.yaml
+      site-2:
+        - run: kubectl apply -f site-2/site.yaml -f site-2/backend.yaml
           output: |
             configmap/skupper-site created
             deployment.apps/backend created
@@ -164,7 +168,7 @@ steps:
       information.
 
       This example uses the Skupper command line tool to generate the
-      secret token in west and create the link in east.
+      secret token in site 1 and create the link in site 2.
 
       To install the Skupper command:
 
@@ -176,14 +180,16 @@ steps:
       Skupper][install].
 
       Once the command is installed, use `skupper token create` in
-      west to generate the token.  Then, use `skupper link create` in
-      east to create a link.
+      site 1 to generate the token.  Then, use `skupper link create` in
+      site 2 to create a link.
 
       [install]: https://skupper.io/install/index.html
   - standard: test_the_application
   - standard: cleaning_up
     commands:
-      west:
-        - run: kubectl delete -f skupper.yaml -f west/site.yaml -f west/frontend.yaml
-      east:
-        - run: kubectl delete -f skupper.yaml -f east/site.yaml -f east/backend.yaml
+      site-1:
+        - run: kubectl delete -f site-1/site.yaml -f site-1/frontend.yaml
+        - run: kubectl delete -f skupper.yaml
+      site-2:
+        - run: kubectl delete -f site-2/site.yaml -f site-2/backend.yaml
+        - run: kubectl delete -f skupper.yaml