Skip to content

Commit

Permalink
Skewer update
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Feb 3, 2024
1 parent e5b25b3 commit 4d683cf
Show file tree
Hide file tree
Showing 53 changed files with 812 additions and 716 deletions.
223 changes: 96 additions & 127 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ across cloud providers, data centers, and edge sites.

* [Overview](#overview)
* [Prerequisites](#prerequisites)
* [Step 1: Configure separate console sessions](#step-1-configure-separate-console-sessions)
* [Step 2: Access your clusters](#step-2-access-your-clusters)
* [Step 3: Set up your namespaces](#step-3-set-up-your-namespaces)
* [Step 4: Install Skupper in your namespaces](#step-4-install-skupper-in-your-namespaces)
* [Step 5: Check the status of your namespaces](#step-5-check-the-status-of-your-namespaces)
* [Step 6: Link your namespaces](#step-6-link-your-namespaces)
* [Step 7: Deploy SERVER](#step-7-deploy-server)
* [Step 8: Expose SERVER](#step-8-expose-server)
* [Step 9: Run CLIENT](#step-9-run-client)
* [Accessing the web console](#accessing-the-web-console)
* [Step 1: Install the Skupper command-line tool](#step-1-install-the-skupper-command-line-tool)
* [Step 2: Set up your namespaces](#step-2-set-up-your-namespaces)
* [Step 3: Create your sites](#step-3-create-your-sites)
* [Step 4: Link your sites](#step-4-link-your-sites)
* [Step 5: Deploy SERVER](#step-5-deploy-server)
* [Step 6: Expose SERVER](#step-6-expose-server)
* [Step 7: Run CLIENT](#step-7-run-client)
* [Cleaning up](#cleaning-up)
* [Summary](#summary)
* [Next steps](#next-steps)
Expand All @@ -45,89 +42,99 @@ This example shows how you can use Skupper to access SERVER.
[install-kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
[kube-providers]: https://skupper.io/start/kubernetes.html

## Step 1: Configure separate console sessions
## Step 1: Install the Skupper command-line tool

Skupper is designed for use with multiple namespaces, usually on
different clusters. The `skupper` and `kubectl` commands use your
[kubeconfig][kubeconfig] and current context to select the
namespace where they operate.
This example uses the Skupper command-line tool to deploy Skupper.
You need to install the `skupper` command only once for each
development environment.

[kubeconfig]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/
On Linux or Mac, you can use the install script (inspect it
[here][install-script]) to download and extract the command:

Your kubeconfig is stored in a file in your home directory. The
`skupper` and `kubectl` commands use the `KUBECONFIG` environment
variable to locate it.
~~~ shell
curl https://skupper.io/install.sh | sh
~~~

A single kubeconfig supports only one active context per user.
Since you will be using multiple contexts at once in this
exercise, you need to create distinct kubeconfigs.
The script installs the command under your home directory. It
prompts you to add the command to your path if necessary.

Start a console session for each of your namespaces. Set the
`KUBECONFIG` environment variable to a different path in each
session.
For Windows and other installation options, see [Installing
Skupper][install-docs].

_**Console for Public:**_
[install-script]: https://github.com/skupperproject/skupper-website/blob/main/input/install.sh
[install-docs]: https://skupper.io/install/

~~~ shell
export KUBECONFIG=~/.kube/config-public
~~~
## Step 2: Set up your namespaces

_**Console for Private:**_
Skupper is designed for use with multiple Kubernetes namespaces,
usually on different clusters. The `skupper` and `kubectl`
commands use your [kubeconfig][kubeconfig] and current context to
select the namespace where they operate.

~~~ shell
export KUBECONFIG=~/.kube/config-private
~~~
[kubeconfig]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

## Step 2: Access your clusters
Your kubeconfig is stored in a file in your home directory. The
`skupper` and `kubectl` commands use the `KUBECONFIG` environment
variable to locate it.

The procedure for accessing a Kubernetes cluster varies by
provider. [Find the instructions for your chosen
provider][kube-providers] and use them to authenticate and
configure access for each console session.
A single kubeconfig supports only one active context per user.
Since you will be using multiple contexts at once in this
exercise, you need to create distinct kubeconfigs.

[kube-providers]: https://skupper.io/start/kubernetes.html
For each namespace, open a new terminal window. In each terminal,
set the `KUBECONFIG` environment variable to a different path and
log in to your cluster. Then create the namespace you wish to use
and set the namespace on your current context.

## Step 3: Set up your namespaces
**Note:** The login procedure varies by provider. See the
documentation for yours:

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.
* [Minikube](https://skupper.io/start/minikube.html#cluster-access)
* [Amazon Elastic Kubernetes Service (EKS)](https://skupper.io/start/eks.html#cluster-access)
* [Azure Kubernetes Service (AKS)](https://skupper.io/start/aks.html#cluster-access)
* [Google Kubernetes Engine (GKE)](https://skupper.io/start/gke.html#cluster-access)
* [IBM Kubernetes Service](https://skupper.io/start/ibmks.html#cluster-access)
* [OpenShift](https://skupper.io/start/openshift.html#cluster-access)

_**Console for Public:**_
_**Public:**_

~~~ shell
export KUBECONFIG=~/.kube/config-public
# Enter your provider-specific login command
kubectl create namespace public
kubectl config set-context --current --namespace public
~~~

_**Console for Private:**_
_**Private:**_

~~~ shell
export KUBECONFIG=~/.kube/config-private
# Enter your provider-specific login command
kubectl create namespace private
kubectl config set-context --current --namespace private
~~~

## Step 4: Install Skupper in your namespaces
## Step 3: Create your sites

The `skupper init` command installs the Skupper router and
controller in the current namespace. Run the `skupper init` command
in each namespace.
A Skupper _site_ is a location where components of your
application are running. Sites are linked together to form a
network for your application. In Kubernetes, a site is associated
with a namespace.

**Note:** If you are using Minikube, [you need to start `minikube
tunnel`][minikube-tunnel] before you install Skupper.

[minikube-tunnel]: https://skupper.io/start/minikube.html#running-minikube-tunnel
For each namespace, use `skupper init` to create a site. This
deploys the Skupper router and controller. Then use `skupper
status` to see the outcome.

_**Console for Public:**_
**Note:** If you are using Minikube, you need to [start minikube
tunnel][minikube-tunnel] before you run `skupper init`.

~~~ shell
skupper init --enable-console --enable-flow-collector
~~~
[minikube-tunnel]: https://skupper.io/start/minikube.html#running-minikube-tunnel

_**Console for Private:**_
_**Public:**_

~~~ shell
skupper init
skupper status
~~~

_Sample output:_
Expand All @@ -136,58 +143,54 @@ _Sample output:_
$ skupper init
Waiting for LoadBalancer IP or hostname...
Waiting for status...
Skupper is now installed in namespace '<namespace>'. Use 'skupper status' to get more information.
~~~

## Step 5: Check the status of your namespaces

Use `skupper status` in each console to check that Skupper is
installed.
Skupper is now installed in namespace 'west'. Use 'skupper status' to get more information.

_**Console for Public:**_

~~~ shell
skupper status
$ skupper status
Skupper is enabled for namespace "west". It is not connected to any other sites. It has no exposed services.
~~~

_**Console for Private:**_
_**Private:**_

~~~ shell
skupper init
skupper status
~~~

_Sample output:_

~~~ console
$ skupper init
Waiting for LoadBalancer IP or hostname...
Waiting for status...
Skupper is now installed in namespace 'east'. Use 'skupper status' to get more information.

$ skupper status
Skupper is enabled for namespace "<namespace>" in interior mode. It is connected to 1 other site. It has 1 exposed service.
The site console url is: <console-url>
The credentials for internal console-auth mode are held in secret: 'skupper-console-users'
Skupper is enabled for namespace "east". It is not connected to any other sites. It has no exposed services.
~~~

As you move through the steps below, you can use `skupper status` at
any time to check your progress.

## Step 6: Link your namespaces
## Step 4: Link your sites

Creating a link requires use of two `skupper` commands in
conjunction, `skupper token create` and `skupper link create`.

The `skupper token create` command generates a secret token that
signifies permission to create a link. The token also carries the
link details. Then, in a remote namespace, The `skupper link
create` command uses the token to create a link to the namespace
link details. Then, in a remote site, The `skupper link
create` command uses the token to create a link to the site
that generated it.

**Note:** The link token is truly a *secret*. Anyone who has the
token can link to your namespace. Make sure that only those you
trust have access to it.
token can link to your site. Make sure that only those you trust
have access to it.

First, use `skupper token create` in one namespace to generate the
token. Then, use `skupper link create` in the other to create a
link.
First, use `skupper token create` in site Public to generate the
token. Then, use `skupper link create` in site Private to link
the sites.

_**Console for Public:**_
_**Public:**_

~~~ shell
skupper token create ~/secret.token
Expand All @@ -200,7 +203,7 @@ $ skupper token create ~/secret.token
Token written to ~/secret.token
~~~

_**Console for Private:**_
_**Private:**_

~~~ shell
skupper link create ~/secret.token
Expand All @@ -214,17 +217,17 @@ Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-0
Check the status of the link using 'skupper link status'.
~~~

If your console sessions are on different machines, you may need
If your terminal sessions are on different machines, you may need
to use `scp` or a similar tool to transfer the token securely. By
default, tokens expire after a single use or 15 minutes after
creation.

## Step 7: Deploy SERVER
## Step 5: Deploy SERVER

In the private namespace, use the `kubectl apply` command to
install the server.

_**Console for Private:**_
_**Private:**_

~~~ shell
kubectl apply -f server/kubernetes.yaml
Expand All @@ -237,15 +240,15 @@ $ kubectl apply -f server/kubernetes.yaml
deployment.apps/server created
~~~

## Step 8: Expose SERVER
## Step 6: Expose SERVER

In the private namespace, use `skupper expose` to expose SERVER
on the Skupper network.

Then, in the public namespace, use `kubectl get service/server`
to check that the service appears after a moment.

_**Console for Private:**_
_**Private:**_

~~~ shell
skupper expose deployment/server --port 8080 --target-port 80
Expand All @@ -258,7 +261,7 @@ $ skupper expose deployment/server --port 8080 --target-port 80
deployment server exposed as server
~~~

_**Console for Public:**_
_**Public:**_

~~~ shell
kubectl get service/server
Expand All @@ -272,11 +275,11 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
server ClusterIP 10.100.58.95 <none> 8080/TCP 2s
~~~

## Step 9: Run CLIENT
## Step 7: Run CLIENT

In the public namespace, use `kubectl run` to run CLIENT.

_**Console for Public:**_
_**Public:**_

~~~ shell
kubectl run client --attach --rm --image docker.io/library/nginx --restart Never -- curl -sf http://server:8080/
Expand All @@ -290,53 +293,19 @@ OUTPUT
pod "client" deleted
~~~

## Accessing the web console

Skupper includes a web console you can use to view the application
network. To access it, use `skupper status` to look up the URL of
the web console. Then use `kubectl get
secret/skupper-console-users` to look up the console admin
password.

**Note:** The `<console-url>` and `<password>` fields in the
following output are placeholders. The actual values are specific
to your environment.

_**Console for Public:**_

~~~ shell
skupper status
kubectl get secret/skupper-console-users -o jsonpath={.data.admin} | base64 -d
~~~

_Sample output:_

~~~ console
$ skupper status
Skupper is enabled for namespace "public". It is connected to 1 other site. It has 1 exposed service.
The site console url is: <console-url>
The credentials for internal console-auth mode are held in secret: 'skupper-console-users'

$ kubectl get secret/skupper-console-users -o jsonpath={.data.admin} | base64 -d
<password>
~~~

Navigate to `<console-url>` in your browser. When prompted, log
in as user `admin` and enter the password.

## Cleaning up

To remove Skupper and the other resources from this exercise, use
the following commands.

_**Console for Private:**_
_**Private:**_

~~~ shell
skupper delete
kubectl delete -f server/kubernetes.yaml
~~~

_**Console for Public:**_
_**Public:**_

~~~ shell
skupper delete
Expand Down
1 change: 0 additions & 1 deletion external/skewer-main/example/external/skewer-main

This file was deleted.

1 change: 0 additions & 1 deletion external/skewer-main/example/python/plano

This file was deleted.

1 change: 0 additions & 1 deletion external/skewer-main/example/python/skewer

This file was deleted.

1 change: 0 additions & 1 deletion external/skewer-main/python/plano

This file was deleted.

Loading

0 comments on commit 4d683cf

Please sign in to comment.