Skip to content

Commit

Permalink
Update for Skewer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jan 20, 2024
1 parent 716086a commit bf14ab7
Show file tree
Hide file tree
Showing 20 changed files with 705 additions and 564 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
- cron: "0 0 * * 0"
jobs:
main:
strategy:
fail-fast: false
matrix:
skupper-version: [latest, main]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -36,7 +40,7 @@ jobs:
minikube version: "v1.32.0"
kubernetes version: "v1.29.0"
github token: ${{secrets.GITHUB_TOKEN}}
- run: curl https://skupper.io/install.sh | sh
- run: curl https://skupper.io/install.sh | bash -s -- --version ${{matrix.skupper-version}}
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: ./plano test
env:
Expand Down
82 changes: 40 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ across cloud providers, data centers, and edge sites.
* [Step 5: Install Skupper in your namespaces](#step-5-install-skupper-in-your-namespaces)
* [Step 6: Check the status of your namespaces](#step-6-check-the-status-of-your-namespaces)
* [Step 7: Link your namespaces](#step-7-link-your-namespaces)
* [Step 8: Deploy and expose the backend](#step-8-deploy-and-expose-the-backend)
* [Step 9: Deploy and expose the frontend](#step-9-deploy-and-expose-the-frontend)
* [Step 8: Deploy the application](#step-8-deploy-the-application)
* [Step 9: Expose the backend service](#step-9-expose-the-backend-service)
* [Step 10: Test the application](#step-10-test-the-application)
* [Accessing the web console](#accessing-the-web-console)
* [Cleaning up](#cleaning-up)
* [Summary](#summary)
* [Next steps](#next-steps)
* [About this example](#about-this-example)

## Overview
Expand Down Expand Up @@ -80,8 +81,8 @@ prompts you to add the command to your path if necessary.
For Windows and other installation options, see [Installing
Skupper][install-docs].

[install-script]: https://github.com/skupperproject/skupper-website/blob/main/docs/install.sh
[install-docs]: https://skupper.io/install/index.html
[install-script]: https://github.com/skupperproject/skupper-website/blob/main/input/install.sh
[install-docs]: https://skupper.io/install/

## Step 2: Configure separate console sessions

Expand Down Expand Up @@ -257,82 +258,79 @@ 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 8: Deploy and expose the backend
## Step 8: Deploy the application

Use `kubectl create deployment` to deploy the frontend and backend
services.

_**Console for West:**_

~~~ shell
kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend
~~~

_**Console for East:**_

~~~ shell
kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
~~~

## Step 9: Expose the backend service

We now have two namespaces linked to form a Skupper network, but
no services are exposed on it. Skupper uses the `skupper
expose` command to select a service from one namespace for
exposure on all the linked namespaces.
exposure in all the linked namespaces.

Use `kubectl create deployment` to deploy the backend service in
East. Use `skupper expose` to expose the backend service to the
frontend service.
Use `skupper expose` to expose the backend service on the Skupper
network.

_**Console for East:**_

~~~ shell
kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
skupper expose deployment/backend --port 8080
~~~

_Sample output:_

~~~ console
$ kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
deployment.apps/backend created

$ skupper expose deployment/backend --port 8080
deployment backend exposed as backend
~~~

## Step 9: Deploy and expose the frontend
## Step 10: Test the application

We have established connectivity between the two namespaces and
made the backend in `east` available to the frontend in `west`.
Before we can test the application, we need external access to the
frontend.
made the backend available to the frontend. Before we can test
the application, we need external access to the frontend.

Use `kubectl create deployment` to deploy the frontend service in
West. Use `kubectl expose` with `--type LoadBalancer` to open
network access to the frontend service.
Use `kubectl expose` with `--type LoadBalancer` to open network
access to the frontend service.

_**Console for West:**_
Once the frontend is exposed, use `kubectl get service/frontend`
to look up the external IP of the frontend service. If the
external IP is `<pending>`, try again after a moment.

~~~ shell
kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend
kubectl expose deployment/frontend --port 8080 --type LoadBalancer
~~~

_Sample output:_

~~~ console
$ kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend
deployment.apps/frontend created

$ kubectl expose deployment/frontend --port 8080 --type LoadBalancer
service/frontend exposed
~~~

## Step 10: Test the application

Now we're ready to try it out. Use `kubectl get service/frontend`
to look up the external IP of the frontend service. Then use
`curl` or a similar tool to request the `/api/health` endpoint at
that address.
Once you have the external IP, use `curl` or a similar tool to
request the `/api/health` endpoint at that address.

**Note:** The `<external-ip>` field in the following commands is a
placeholder. The actual value is an IP address.

_**Console for West:**_

~~~ shell
kubectl expose deployment/frontend --port 8080 --type LoadBalancer
kubectl get service/frontend
curl http://<external-ip>:8080/api/health
~~~

_Sample output:_

~~~ console
$ kubectl expose deployment/frontend --port 8080 --type LoadBalancer
service/frontend exposed

$ kubectl get service/frontend
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend LoadBalancer 10.103.232.28 <external-ip> 8080:30407/TCP 15s
Expand Down
6 changes: 5 additions & 1 deletion external/skewer-main/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- cron: "0 0 * * 0"
jobs:
main:
strategy:
fail-fast: false
matrix:
skupper-version: [latest, main]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,7 +21,7 @@ jobs:
minikube version: "v1.32.0"
kubernetes version: "v1.29.0"
github token: ${{secrets.GITHUB_TOKEN}}
- run: curl https://skupper.io/install.sh | sh
- run: curl https://skupper.io/install.sh | bash -s -- --version ${{matrix.skupper-version}}
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: ./plano test
env:
Expand Down
1 change: 1 addition & 0 deletions external/skewer-main/.plano.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import skewer.tests

from plano import *
from skewer import *

@command(passthrough=True)
Expand Down
27 changes: 18 additions & 9 deletions external/skewer-main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ options:
commands:
{command}
generate Generate README.md from the data in skewer.yaml
render Render README.html from the data in skewer.yaml
render Render README.html from README.md
clean Clean up the source tree
run Run the example steps using Minikube
run-external Run the example steps with user-provided kubeconfigs
demo Run the example steps and pause before cleaning up
run Run the example steps
demo Run the example steps and pause for a demo before cleaning up
test Test README generation and run the steps on Minikube
update-skewer Update the embedded Skewer repo and GitHub workflow
~~~
Expand All @@ -92,7 +91,7 @@ The top level:
~~~ yaml
title: # Your example's title (required)
subtitle: # Your chosen subtitle (required)
github_actions_url: # The URL of your workflow (optional)
workflow: # The filename of your GitHub workflow (optional, default 'main.yaml')
overview: # Text introducing your example (optional)
prerequisites: # Text describing prerequisites (optional, has default text)
sites: # A map of named sites (see below)
Expand Down Expand Up @@ -200,16 +199,26 @@ steps:
- standard: check_the_status_of_your_namespaces
- standard: link_your_namespaces
<your-custom-steps>
- standard: test_the_application
- standard: accessing_the_web_console
- standard: cleaning_up
~~~

Note that the `link_your_namespaces` and `test_the_application` steps
are less generic than the other steps, so check that the text and
commands they produce are doing what you need. If not, you'll need to
Note that the `link_your_namespaces` step is less generic than the
other steps (it assumes only two sites), so check that the text and
commands it produces are doing what you need. If not, you'll need to
provide a custom step.

There are also some standard steps for examples based on the Skupper
Hello World application:

~~~ yaml
steps:
- standard: hello_world/deploy_the_application
- standard: hello_world/expose_the_backend_service
- standard: hello_world/test_the_application
- standard: hello_world/cleaning_up
~~~

The step commands are separated into named groups corresponding to the
sites. Each named group contains a list of command entries. Each
command entry has a `run` field containing a shell command and other
Expand Down
6 changes: 5 additions & 1 deletion external/skewer-main/config/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
- cron: "0 0 * * 0"
jobs:
main:
strategy:
fail-fast: false
matrix:
skupper-version: [latest, main]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -36,7 +40,7 @@ jobs:
minikube version: "v1.32.0"
kubernetes version: "v1.29.0"
github token: ${{secrets.GITHUB_TOKEN}}
- run: curl https://skupper.io/install.sh | sh
- run: curl https://skupper.io/install.sh | bash -s -- --version ${{matrix.skupper-version}}
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: ./plano test
env:
Expand Down
65 changes: 31 additions & 34 deletions external/skewer-main/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ across cloud providers, data centers, and edge sites.
* [Step 6: Check the status of your namespaces](#step-6-check-the-status-of-your-namespaces)
* [Step 7: Link your namespaces](#step-7-link-your-namespaces)
* [Step 8: Fail on demand](#step-8-fail-on-demand)
* [Step 9: Deploy and expose the frontend](#step-9-deploy-and-expose-the-frontend)
* [Step 10: Deploy and expose the backend](#step-10-deploy-and-expose-the-backend)
* [Step 9: Deploy the application](#step-9-deploy-the-application)
* [Step 10: Expose the backend service](#step-10-expose-the-backend-service)
* [Step 11: Test the application](#step-11-test-the-application)
* [Accessing the web console](#accessing-the-web-console)
* [Cleaning up](#cleaning-up)
Expand Down Expand Up @@ -59,8 +59,8 @@ prompts you to add the command to your path if necessary.
For Windows and other installation options, see [Installing
Skupper][install-docs].

[install-script]: https://github.com/skupperproject/skupper-website/blob/main/docs/install.sh
[install-docs]: https://skupper.io/install/index.html
[install-script]: https://github.com/skupperproject/skupper-website/blob/main/input/install.sh
[install-docs]: https://skupper.io/install/

## Step 2: Configure separate console sessions

Expand Down Expand Up @@ -245,82 +245,79 @@ if [ -n "${SKEWER_FAIL}" ]; then expr 1 / 0; fi

~~~

## Step 9: Deploy and expose the frontend
## Step 9: Deploy the application

We have established connectivity between the two namespaces and
made the backend in `east` available to the frontend in `west`.
Before we can test the application, we need external access to the
frontend.

Use `kubectl create deployment` to deploy the frontend service in
West. Use `kubectl expose` with `--type LoadBalancer` to open
network access to the frontend service.
Use `kubectl create deployment` to deploy the frontend and backend
services.

_**Console for West:**_

~~~ shell
kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend
kubectl expose deployment/frontend --port 8080 --type LoadBalancer
~~~

_Sample output:_

~~~ console
$ kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend
deployment.apps/frontend created
_**Console for East:**_

$ kubectl expose deployment/frontend --port 8080 --type LoadBalancer
service/frontend exposed
~~~ shell
kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
~~~

## Step 10: Deploy and expose the backend
## Step 10: Expose the backend service

We now have two namespaces linked to form a Skupper network, but
no services are exposed on it. Skupper uses the `skupper
expose` command to select a service from one namespace for
exposure on all the linked namespaces.
exposure in all the linked namespaces.

Use `kubectl create deployment` to deploy the backend service in
East. Use `skupper expose` to expose the backend service to the
frontend service.
Use `skupper expose` to expose the backend service on the Skupper
network.

_**Console for East:**_

~~~ shell
kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
skupper expose deployment/backend --port 8080
~~~

_Sample output:_

~~~ console
$ kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
deployment.apps/backend created

$ skupper expose deployment/backend --port 8080
deployment backend exposed as backend
~~~

## Step 11: Test the application

Now we're ready to try it out. Use `kubectl get service/frontend`
to look up the external IP of the frontend service. Then use
`curl` or a similar tool to request the `/api/health` endpoint at
that address.
We have established connectivity between the two namespaces and
made the backend available to the frontend. Before we can test
the application, we need external access to the frontend.

Use `kubectl expose` with `--type LoadBalancer` to open network
access to the frontend service.

Once the frontend is exposed, use `kubectl get service/frontend`
to look up the external IP of the frontend service. If the
external IP is `<pending>`, try again after a moment.

Once you have the external IP, use `curl` or a similar tool to
request the `/api/health` endpoint at that address.

**Note:** The `<external-ip>` field in the following commands is a
placeholder. The actual value is an IP address.

_**Console for West:**_

~~~ shell
kubectl expose deployment/frontend --port 8080 --type LoadBalancer
kubectl get service/frontend
curl http://<external-ip>:8080/api/health
~~~

_Sample output:_

~~~ console
$ kubectl expose deployment/frontend --port 8080 --type LoadBalancer
service/frontend exposed

$ kubectl get service/frontend
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend LoadBalancer 10.103.232.28 <external-ip> 8080:30407/TCP 15s
Expand Down
Loading

0 comments on commit bf14ab7

Please sign in to comment.