Skip to content

Commit 8d58f1d

Browse files
committed
add site cost annotation and related README update
1 parent 1d04f22 commit 8d58f1d

File tree

2 files changed

+100
-23
lines changed

2 files changed

+100
-23
lines changed

README.adoc

+97-21
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Lets use the following variables to refer to the source repositories cloned abov
2626

2727
* https://skupper.io/releases/index.html[skupper]
2828

29+
* https://mikefarah.gitbook.io/yq/[yq]
30+
2931
Let us call the OpenShift Clusters as *Cloud-1*, *Cloud-2* and *Cloud-3*.
3032

3133
The following table shows the cloud and what components gets installed on each of them:
@@ -52,7 +54,7 @@ oc project hybrid-cloud-demo
5254
oc apply -k k8s/rbac
5355
----
5456

55-
=== Cloud-1(gcp)
57+
=== Cloud-1
5658

5759
=== Add Image Streams
5860

@@ -71,7 +73,7 @@ oc set image-lookup hybrid-cloud-frontend
7173
oc apply -k k8s/skupper/gcp
7274
----
7375

74-
=== Cloud-2(aws)
76+
=== Cloud-2
7577

7678
=== Add Image Streams
7779

@@ -87,7 +89,7 @@ oc set image-lookup hybrid-cloud-backend
8789
oc apply -k k8s/skupper/aws
8890
----
8991

90-
=== Cloud-3(azr)
92+
=== Cloud-3
9193

9294
=== Add Image Streams
9395

@@ -162,7 +164,7 @@ service/skupper-messaging ClusterIP 172.30.14.214 <no
162164
service/skupper-router-console ClusterIP 172.30.72.116 <none> 443/TCP 43m
163165
164166
NAME URL LATESTCREATED LATESTREADY READY REASON
165-
service.serving.knative.dev/hybrid-cloud-backend http://hybrid-cloud-backend-hybrid-cloud-demo.apps.gcp.kameshs.me hybrid-cloud-backend-p948k hybrid-cloud-backend-p948k True
167+
service.serving.knative.dev/hybrid-cloud-backend http://hybrid-cloud-backend.hybrid-cloud-demo.svc.cluster.local hybrid-cloud-backend-p948k hybrid-cloud-backend-p948k True
166168
----
167169

168170
[NOTE]
@@ -172,41 +174,114 @@ When using the vanilla deployment you will not have `ksvc` and `service/hybrid-c
172174

173175
== Connecting Clouds
174176

175-
=== Generate Skupper Connection Token
176-
177-
On *Cloud-1*, create the following Kubenretes Secret:
177+
On *Cloud-1*, run the following command to create `site-token` secret:
178178

179179
[source,bash]
180180
----
181-
skupper connection-token $HYBRID_CLOUD_HOME/token.yaml
181+
oc apply -k k8s/van
182182
----
183183

184-
The `token.yaml` will be used in other clouds *Cloud-2* and *Cloud-3* to connect the clouds using _Virtual Application Network(VAN)_.
184+
The `site-token` seceret will be used to connect clouds *Cloud-2* and *Cloud-3* to *Cloud-1* forming a _Virtual Application Network(VAN)_.
185185

186+
Run the following command to export the `site-token` secret:
187+
188+
[source,bash]
189+
----
190+
oc get secret -n hybrid-cloud-demo site-token -o yaml > $HYBRID_CLOUD_HOME/token.yaml
191+
----
186192

187193
To connect *Cloud-2* and *Cloud-3* with *Cloud-1*, run the following command on *Cloud-2* and *Cloud-3*:
188194

189-
==== Cloud-2
195+
=== Cloud-2
190196

191197
Make sure the *Cloud-2* starts to spill over after *4* requests in queue:
192198

193199
[source,bash]
194200
----
195-
skupper connect --connection-name=cloud-1 --cost 4 $HYBRID_CLOUD_HOME/token.yaml
201+
yq w $HYBRID_CLOUD_HOME/token.yaml 'metadata.annotations[skupper.io/cost]' --tag '!!str' 4 | oc create -n hybrid-cloud-demo -f -
196202
----
197203

198-
==== Cloud-3
204+
=== Cloud-3
199205

200206
Make sure the *Cloud-3* starts to spill over after *2* requests in queue:
201207

202208
[source,bash]
203209
----
204-
skupper connect --connection-name=cloud-1 --cost 2 $HYBRID_CLOUD_HOME/token.yaml
210+
yq w $HYBRID_CLOUD_HOME/token.yaml 'metadata.annotations[skupper.io/cost]' --tag '!!str' 2 | oc create -n hybrid-cloud-demo -f -
205211
----
206212

207-
=== Verify Status
213+
A successfull connection can be verified using the following commands, on *Cloud-1*:
208214

209-
==== Cloud-1
215+
[source,bash]
216+
----
217+
export SKUPPER_POD=$(SKUPPER_POD (oc get pods --selector=application=skupper-router -ojsonpath='{.items[0].metadata.name}'))
218+
kubectl exec -it $SKUPPER_POD -- qdmanage query --type node
219+
----
220+
221+
The command should show an output as shown below:
222+
223+
[source,json]
224+
----
225+
[
226+
{
227+
"index": 0,
228+
"nextHop": "(self)",
229+
"name": "router.node/hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd",
230+
"validOrigins": [],
231+
"linkState": [
232+
"hybrid-cloud-azr-skupper-router-675cb597fc-75g2x",
233+
"hybrid-cloud-aws-skupper-router-5946d4544f-mgswf"
234+
],
235+
"instance": 1599839762,
236+
"identity": "router.node/hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd",
237+
"protocolVersion": 1,
238+
"lastTopoChange": 1599840055,
239+
"type": "org.apache.qpid.dispatch.router.node",
240+
"id": "hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd",
241+
"address": "amqp:/_topo/0/hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd"
242+
},
243+
{
244+
"routerLink": 0,
245+
"name": "router.node/hybrid-cloud-aws-skupper-router-5946d4544f-mgswf",
246+
"index": 1,
247+
"validOrigins": [
248+
"hybrid-cloud-azr-skupper-router-675cb597fc-75g2x"
249+
],
250+
"protocolVersion": 1,
251+
"linkState": [
252+
"hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd"
253+
],
254+
"instance": 1599840049,
255+
"cost": 4,
256+
"address": "amqp:/_topo/0/hybrid-cloud-aws-skupper-router-5946d4544f-mgswf",
257+
"type": "org.apache.qpid.dispatch.router.node",
258+
"id": "hybrid-cloud-aws-skupper-router-5946d4544f-mgswf",
259+
"identity": "router.node/hybrid-cloud-aws-skupper-router-5946d4544f-mgswf"
260+
},
261+
{
262+
"routerLink": 1,
263+
"name": "router.node/hybrid-cloud-azr-skupper-router-675cb597fc-75g2x",
264+
"index": 2,
265+
"validOrigins": [
266+
"hybrid-cloud-aws-skupper-router-5946d4544f-mgswf"
267+
],
268+
"protocolVersion": 1,
269+
"linkState": [
270+
"hybrid-cloud-gcp-skupper-router-7b9fcf9575-knrsd"
271+
],
272+
"instance": 1599840051,
273+
"cost": 2,
274+
"address": "amqp:/_topo/0/hybrid-cloud-azr-skupper-router-675cb597fc-75g2x",
275+
"type": "org.apache.qpid.dispatch.router.node",
276+
"id": "hybrid-cloud-azr-skupper-router-675cb597fc-75g2x",
277+
"identity": "router.node/hybrid-cloud-azr-skupper-router-675cb597fc-75g2x"
278+
}
279+
]
280+
----
281+
282+
== Verify Status
283+
284+
=== Cloud-1
210285

211286
Running `skupper status` on the clouds should show the following output:
212287

@@ -215,7 +290,7 @@ Running `skupper status` on the clouds should show the following output:
215290
Skupper is enabled for namespace '"hybrid-cloud-demo" in interior mode'. It is connected to 2 other sites. It has 1 exposed service.
216291
----
217292

218-
==== Cloud-2
293+
=== Cloud-2
219294

220295
Running `skupper status` on the clouds should show the following output:
221296

@@ -224,7 +299,7 @@ Running `skupper status` on the clouds should show the following output:
224299
Skupper is enabled for namespace '"hybrid-cloud-demo" in interior mode'. It is connected to 2 other sites (1 indirectly). It has 1 exposed service.
225300
----
226301

227-
==== Cloud-3
302+
=== Cloud-3
228303

229304
Running `skupper status` on the clouds should show the following output:
230305

@@ -238,9 +313,9 @@ Skupper is enabled for namespace '"hybrid-cloud-demo" in interior mode'. It is c
238313
Since *Cloud-1* is where we generated the `site-token` secret to connect to other sites, makes it directly connected to other clouds *Cloud-2* and *Cloud-3*. For other clouds you will see one direct to *Cloud-1* and one indirect connection to other cloud.
239314
====
240315

241-
=== Verify Exposed Services
316+
== Verify Exposed Services
242317

243-
You can verify that, in all connected clouds running the following command `skupper list-exposed` shows the following output:
318+
You can verify that, in *all* connected clouds running the following command `skupper list-exposed` shows the following output:
244319

245320
When `Knative` backend was deployed:
246321

@@ -270,8 +345,9 @@ cd $FRONTEND_APP_HOME
270345
oc apply -k k8s/knative
271346
----
272347

273-
Create OpenShift route to access the frontend application
348+
Get the URL to access the frontend application:
349+
274350
[source,bash]
275351
----
276-
oc create route edge --service=hybrid-cloud-frontend --port=8080
352+
oc get route -n hybrid-cloud-demo hybrid-cloud-frontend
277353
----

k8s/van/site-token.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5+
# only allow 5 outstanding requests, before spillover
6+
# annotations:
7+
# skupper.io/cost: "5"
58
labels:
69
skupper.io/type: connection-token-request
7-
# only allow 5 outstanding requests, before spillover
8-
skupper.io/cost: "5"
910
name: site-token

0 commit comments

Comments
 (0)