Skip to content

Commit

Permalink
Update for v2 preview 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Dec 19, 2024
1 parent 64edc52 commit 5b616a2
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
skupper-version: [2.0.0-preview-1]
skupper-version: [2.0.0-preview-2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
149 changes: 80 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ across cloud providers, data centers, and edge sites.

* [Overview](#overview)
* [Prerequisites](#prerequisites)
* [Step 1: Set up your clusters](#step-1-set-up-your-clusters)
* [Step 1: Set up your Kubernetes clusters](#step-1-set-up-your-kubernetes-clusters)
* [Step 2: Deploy the frontend and backend](#step-2-deploy-the-frontend-and-backend)
* [Step 3: Install Skupper on your clusters](#step-3-install-skupper-on-your-clusters)
* [Step 4: Install the Skupper command-line tool](#step-4-install-the-skupper-command-line-tool)
* [Step 3: Install the Skupper command-line tool](#step-3-install-the-skupper-command-line-tool)
* [Step 4: Install Skupper on your Kubernetes clusters](#step-4-install-skupper-on-your-kubernetes-clusters)
* [Step 5: Create your sites](#step-5-create-your-sites)
* [Step 6: Link your sites](#step-6-link-your-sites)
* [Step 7: Expose the backend](#step-7-expose-the-backend)
* [Step 8: Access the frontend](#step-8-access-the-frontend)
* [Step 7: Expose the backend service](#step-7-expose-the-backend-service)
* [Step 8: Access the frontend service](#step-8-access-the-frontend-service)
* [Cleaning up](#cleaning-up)
* [Summary](#summary)
* [Next steps](#next-steps)
* [About this example](#about-this-example)
Expand Down Expand Up @@ -60,7 +61,7 @@ services without exposing the backend to the public internet.
[install-kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
[kube-providers]: https://skupper.io/start/kubernetes.html

## Step 1: Set up your clusters
## Step 1: Set up your Kubernetes clusters

Skupper is designed for use with multiple Kubernetes clusters.
The `skupper` and `kubectl` commands use your
Expand All @@ -71,11 +72,10 @@ and namespace where they operate.

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

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 multiple kubeconfigs.
variable to locate it. 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 multiple
kubeconfigs.

For each namespace, open a new terminal window. In each terminal,
set the `KUBECONFIG` environment variable to a different path and
Expand Down Expand Up @@ -130,28 +130,7 @@ _**East:**_
kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
~~~

## Step 3: Install Skupper on your clusters

Using Skupper on Kubernetes requires the installation of the
Skupper custom resource definitions (CRDs) and the Skupper
controller.

For each cluster, use `kubectl apply` with the Skupper
installation YAML to install the CRDs and controller.

_**West:**_

~~~ shell
kubectl apply -f https://skupper.io/v2/install.yaml
~~~

_**East:**_

~~~ shell
kubectl apply -f https://skupper.io/v2/install.yaml
~~~

## Step 4: Install the Skupper command-line tool
## Step 3: Install the Skupper command-line tool

This example uses the Skupper command-line tool to create Skupper
resources. You need to install the `skupper` command only once
Expand All @@ -161,7 +140,7 @@ On Linux or Mac, you can use the install script (inspect it
[here][install-script]) to download and extract the command:

~~~ shell
curl https://skupper.io/install.sh | sh -s -- --version 2.0.0-preview-1
curl https://skupper.io/install.sh | sh -s -- --version 2.0.0-preview-2
~~~

The script installs the command under your home directory. It
Expand All @@ -173,19 +152,39 @@ Skupper][install-docs].
[install-script]: https://github.com/skupperproject/skupper-website/blob/main/input/install.sh
[install-docs]: https://skupper.io/install/

## Step 4: Install Skupper on your Kubernetes clusters

Using Skupper on Kubernetes requires the installation of the
Skupper custom resource definitions (CRDs) and the Skupper
controller.

For each cluster, use `kubectl apply` with the Skupper
installation YAML to install the CRDs and controller.

_**West:**_

~~~ shell
kubectl apply -f https://github.com/skupperproject/skupper/releases/download/2.0.0-preview-2/skupper-setup-cluster-scope.yaml
~~~

_**East:**_

~~~ shell
kubectl apply -f https://github.com/skupperproject/skupper/releases/download/2.0.0-preview-2/skupper-setup-cluster-scope.yaml
~~~

## Step 5: Create your sites

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.
A Skupper _site_ is a location where your application workloads
are running. Sites are linked together to form a network for your
application.

For each namespace, use `skupper site create` with a site name of
your choice. This creates the site resource and deploys the
Skupper router to the namespace.

**Note:** If you are using Minikube, you need to [start minikube
tunnel][minikube-tunnel] before you run `skupper init`.
tunnel][minikube-tunnel] before you run `skupper site create`.

<!-- XXX Explain enabling link acesss on one of the sites -->

Expand All @@ -194,37 +193,29 @@ tunnel][minikube-tunnel] before you run `skupper init`.
_**West:**_

~~~ shell
skupper site create west --enable-link-access
kubectl wait --for condition=Ready site/west # Required with preview 1 - to be removed!
skupper site create west --enable-link-access --timeout 2m
~~~

_Sample output:_

~~~ console
$ skupper site create west --enable-link-access
$ skupper site create west --enable-link-access --timeout 2m
Waiting for status...
Site "west" is configured. Check the status to see when it is ready

$ kubectl wait --for condition=Ready site/west # Required with preview 1 - to be removed!
site.skupper.io/west condition met
~~~

_**East:**_

~~~ shell
skupper site create east
kubectl wait --for condition=Ready site/east # Required with preview 1 - to be removed!
skupper site create east --timeout 2m
~~~

_Sample output:_

~~~ console
$ skupper site create east
$ skupper site create east --timeout 2m
Waiting for status...
Site "east" is configured. Check the status to see when it is ready

$ kubectl wait --for condition=Ready site/east # Required with preview 1 - to be removed!
site.skupper.io/east condition met
~~~

You can use `skupper site status` at any time to check the status
Expand All @@ -236,14 +227,12 @@ A Skupper _link_ is a channel for communication between two sites.
Links serve as a transport for application connections and
requests.

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

Creating a link requires the use of two Skupper commands in
conjunction: `skupper token issue` and `skupper token redeem`.
The `skupper token issue` command generates a secret token that
signifies permission to create a link. The token also carries the
link details. Then, in a remote site, The `skupper token redeem`
command uses the token to create a link to the site that generated
it.
can be transferred to a remote site and redeemed for a link to the
issuing site. The `skupper token redeem` command uses the token
to create the link.

**Note:** The link token is truly a *secret*. Anyone who has the
token can link to your site. Make sure that only those you trust
Expand Down Expand Up @@ -295,17 +284,18 @@ to use `scp` or a similar tool to transfer the token securely. By
default, tokens expire after a single use or 15 minutes after
being issued.

## Step 7: Expose the backend
## Step 7: Expose the backend service

We now have our sites linked to form a Skupper network, but no
services are exposed on it.

Skupper uses _listeners_ and _connectors_ to expose services. A
listener is a local endpoint for client connections, configured
with a routing key. A connector exists in a remote site and binds
a routing key to a particular set of servers. Skupper routers
forward client connections from local listeners to remote
connectors with matching routing keys.
Skupper uses _listeners_ and _connectors_ to expose services
across sites inside a Skupper network. A listener is a local
endpoint for client connections, configured with a routing key. A
connector exists in a remote site and binds a routing key to a
particular set of servers. Skupper routers forward client
connections from local listeners to remote connectors with
matching routing keys.

In West, use the `skupper listener create` command to create a
listener for the backend. In East, use the `skupper connector
Expand Down Expand Up @@ -339,11 +329,13 @@ Waiting for create to complete...
Connector "backend" is ready
~~~

The commands shown above use the name argument, `backend`, to set
the default routing key and pod selector. You can use the
`--routing-key` and `--selector` options to specify other values.
The commands shown above use the name argument, `backend`, to also
set the default routing key and pod selector. You can use the
`--routing-key` and `--selector` options to set specific values.

## Step 8: Access the frontend
<!-- You can also use `--workload` -- more convenient! -->

## Step 8: Access the frontend service

In order to use and test the application, we need external access
to the frontend.
Expand All @@ -360,6 +352,25 @@ kubectl port-forward deployment/frontend 8080:8080
You can now access the web interface by navigating to
[http://localhost:8080](http://localhost:8080) in your browser.

## Cleaning up

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

_**West:**_

~~~ shell
skupper site delete --all
kubectl delete deployment/frontend
~~~

_**East:**_

~~~ shell
skupper site delete --all
kubectl delete deployment/backend
~~~

## Summary

This example locates the frontend and backend services in different
Expand Down
2 changes: 1 addition & 1 deletion external/skewer/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
skupper-version: [2.0.0-preview-1]
skupper-version: [2.0.0-preview-2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions external/skewer/.plano.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ def render(verbose=False, quiet=False):
if not quiet:
print(f"file:{get_real_path('README.html')}")

@command
def list_standard_steps():
data = read_yaml("python/skewer/standardsteps.yaml")
for key in data:
print(key)

@command
def clean():
remove(find(".", "__pycache__"))
Expand Down
Loading

0 comments on commit 5b616a2

Please sign in to comment.