Skip to content

Commit b44021c

Browse files
author
mgoulish
committed
Fixes after review -- still needs diagram.
1 parent 099d18f commit b44021c

File tree

2 files changed

+31
-74
lines changed

2 files changed

+31
-74
lines changed

README.md

Lines changed: 31 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Skupper enables inter-cluster TCP communication.
22

3-
This is a simple demonstration of TCP communication tunneled through a Skupper network from a private to a public namespace and back again. We will set up a Skupper network between the two namespaces, start a TCP echo-server on the public namespace, then communicate to it from the private namespace, and receive its replies. We will assume that Kubernetes is running on your local machine, and we will create and access both namespaces from within a single shell.
3+
This is a simple demonstration of TCP communication tunneled through a Skupper network from a private to a public namespace and back again. We will use two namespaces for simplicity of setup, but this would work the same way on two separate clusters.
4+
<br/>
5+
We will set up a Skupper network between the two namespaces, start a TCP echo-server on the public namespace, then communicate to it from the private namespace, and receive its replies. We will assume that Kubernetes is running on your local machine, and we will create and access both namespaces from within a single shell.
46

57
* [Prerequisites](#prereq)
68
* [Step 1: Set up the demo.](#step_1)
@@ -14,7 +16,10 @@ This is a simple demonstration of TCP communication tunneled through a Skupper n
1416

1517
## Prerequisites <a name="prereq"></a>
1618

17-
You will need the skupper command line tool installed, and on your executable path.
19+
* The `kubectl` command-line tool, version 1.15 or later ([installation guide](https://kubernetes.io/docs/tasks/tools/install-kubectl/))
20+
* The `skupper` command-line tool, the latest version ([installation guide](https://skupper.io/start/index.html#step-1-install-the-skupper-command-line-tool-in-your-environment))
21+
* Two Kubernetes namespaces, from any providers you choose, on any clusters you choose
22+
1823

1924

2025

@@ -32,73 +37,43 @@ On your machine make a directory for this tutorial, clone the tutorial repo, and
3237
## Step 2: Start your cluster and define two namespaces. <a name="step_2"></a>
3338

3439
```
35-
$ alias kc='kubectl'
36-
$ oc cluster up
37-
$ oc new-project public
38-
Now using project "public" on server "https://127.0.0.1:8443".
39-
...
40-
$ oc new-project private
41-
Now using project "private" on server "https://127.0.0.1:8443".
42-
...
40+
alias kc='kubectl'
41+
oc cluster up
42+
oc new-project public
43+
oc new-project private
4344
```
4445

4546
## Step 3: Start Skupper in the public namespace. <a name="step_3"></a>
4647

4748
```
48-
$ kc config set-context --current --namespace=public
49-
Context "private/127-0-0-1:8443/developer" modified.
50-
$ skupper status
51-
skupper not enabled for public
52-
$ skupper init --cluster-local --id public
53-
Skupper is now installed in 'public'. Use 'skupper status' to get more information.
54-
$ skupper status
55-
Skupper enabled for "public". It is not connected to any other sites.
49+
kc config set-context --current --namespace=public
50+
skupper init --cluster-local --id public
51+
skupper status
5652
```
5753

5854
## Step 4: Make a connection token, and start the service. <a name="step_4"></a>
5955

6056
```
61-
$ skupper connection-token ${HOME}/secret.yaml
62-
token will only be valid for local cluster
63-
$ oc apply -f ${HOME}/tcp-echo-demo/public-deployment-and-service.yaml
64-
deployment.extensions/tcp-go-echo created
65-
service/tcp-go-echo created
57+
skupper connection-token ${HOME}/secret.yaml
58+
oc apply -f ${HOME}/tcp-echo-demo/public-deployment-and-service.yaml
6659
6760
```
6861

6962
## Step 5: Start Skupper in the private namespace. <a name="step_5"></a>
7063

7164
```
72-
$ kc config set-context --current --namespace=private
73-
Context "private/127-0-0-1:8443/developer" modified.
74-
$ skupper status
75-
skupper not enabled for private
76-
$ skupper init --cluster-local --id private
77-
Skupper is now installed in 'private'. Use 'skupper status' to get more information.
78-
$ skupper status
79-
Skupper enabled for "private". It is not connected to any other sites.
80-
```
81-
82-
If you ever issue the "skupper status" command and see this response...
83-
84-
```
85-
Skupper enabled for "private". Status pending...
65+
kc config set-context --current --namespace=private
66+
skupper init --cluster-local --id private
67+
skupper status
8668
```
87-
... just wait a few seconds and re-issue the command.
88-
89-
9069

9170
## Step 6: Make the connection. <a name="step_6"></a>
9271

9372
After issuing the connect command, a new service will show up in this namespace called tcp-go-echo. (It may take as long as two minutes for the service to appear.)
9473

9574
```
96-
$ skupper connect ${HOME}/secret.yaml
97-
$ kc get svc
98-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
99-
skupper-internal ClusterIP 172.30.46.68 <none> 55671/TCP,45671/TCP 2m
100-
skupper-messaging ClusterIP 172.30.180.253 <none> 5671/TCP 2m
101-
tcp-go-echo ClusterIP 172.30.17.63 <none> 9090/TCP 38s
75+
skupper connect ${HOME}/secret.yaml
76+
kc get svc
10277
```
10378

10479

@@ -107,7 +82,10 @@ After issuing the connect command, a new service will show up in this namespace
10782
Using the IP address and port number from the 'kc get svc' result, send a message to the local service. Skupper will route the message to the service that is running on the other namespace, and will route the reply back here.
10883

10984
```
110-
ncat Mr. Watson, come here. I want to see you.
85+
ADDR=`kubectl get svc/tcp-go-echo -o=jsonpath='{.spec.clusterIP}'`
86+
PORT=`kubectl get svc/tcp-go-echo -o=jsonpath='{.spec.ports[0].port}'`
87+
telnet ${ADDR} ${PORT}
88+
Mr. Watson, come here. I want to see you.
11189
tcp-go-echo-67c875768f-kt6dc : MR. WATSON, COME HERE. I WANT TO SEE YOU.
11290
```
11391

@@ -127,18 +105,12 @@ We demonstrated this using two namespaces in a single local cluster for ease of
127105
Let's tidy up so no one trips over any of this stuff later. In the private namespace, delete the Skupper artifacts. In public, delete both Kubernetes and Skupper atrifacts.
128106

129107
```
130-
$ kc config set-context --current --namespace=private
131-
Context "private/127-0-0-1:8443/developer" modified.
132-
$ skupper delete
133-
Skupper is now removed from 'private'.
134-
$ kc config set-context --current --namespace=public
135-
Context "private/127-0-0-1:8443/developer" modified.
136-
$ kc delete -f ${HOME}/tcp-echo-demo/public-deployment-and-service.yaml
137-
deployment.extensions "tcp-go-echo" deleted
138-
service "tcp-go-echo" deleted
139-
$ skupper delete
140-
Skupper is now removed from 'public'.
141-
$ oc cluster down
108+
kc config set-context --current --namespace=private
109+
skupper delete
110+
kc config set-context --current --namespace=public
111+
kc delete -f ${HOME}/tcp-echo-demo/public-deployment-and-service.yaml
112+
skupper delete
113+
oc cluster down
142114
```
143115
<br/>
144116
<br/>

private-service-only.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)