Skip to content

Commit

Permalink
Update for recent Skewer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jan 19, 2024
1 parent dec8774 commit 0914ee9
Showing 69 changed files with 3,229 additions and 2,490 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -24,18 +24,24 @@ on:
schedule:
- cron: "0 0 * * 0"
jobs:
test:
main:
strategy:
fail-fast: false
matrix:
skupper-version: [latest, main]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: manusa/actions-setup-minikube@v2.6.0
- uses: manusa/actions-setup-minikube@v2.10.0
with:
minikube version: "v1.25.2"
kubernetes version: "v1.24.1"
minikube version: "v1.32.0"
kubernetes version: "v1.29.0"
github token: ${{secrets.GITHUB_TOKEN}}
- run: curl -f https://skupper.io/install.sh | sh
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: curl https://skupper.io/install.sh | bash -s -- --version ${{matrix.skupper-version}}
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: ./plano test
env:
PLANO_COLOR: 1
20 changes: 20 additions & 0 deletions .plano.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

from skewer.planocommands import *
1 change: 0 additions & 1 deletion .planofile

This file was deleted.

118 changes: 39 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Accessing SERVER using Skupper

[![main](https://github.com/skupperproject/REPO/actions/workflows/main.yaml/badge.svg)](https://github.com/skupperproject/REPO/actions/workflows/main.yaml)
[![main](https://github.com/skupperproject/skupper-example-template/actions/workflows/main.yaml/badge.svg)](https://github.com/skupperproject/skupper-example-template/actions/workflows/main.yaml)

#### Securely connect to SERVER on a remote Kubernetes cluster

@@ -26,6 +26,8 @@ across cloud providers, data centers, and edge sites.
* [Step 9: Run CLIENT](#step-9-run-client)
* [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
@@ -41,14 +43,14 @@ This example shows how you can use Skupper to access SERVER.
choose][kube-providers]

[install-kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
[kube-providers]: https://skupper.io/start/index.html#prerequisites
[kube-providers]: https://skupper.io/start/kubernetes.html

## Step 1: Configure separate console sessions

Skupper is designed for use with multiple namespaces, usually on
different clusters. The `skupper` command uses your
different clusters. The `skupper` and `kubectl` commands use your
[kubeconfig][kubeconfig] and current context to select the
namespace where it operates.
namespace where they operate.

[kubeconfig]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

@@ -64,76 +66,50 @@ Start a console session for each of your namespaces. Set the
`KUBECONFIG` environment variable to a different path in each
session.

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

~~~ shell
export KUBECONFIG=~/.kube/config-public
~~~

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

~~~ shell
export KUBECONFIG=~/.kube/config-private
~~~

## Step 2: Access your clusters

The methods for accessing your clusters vary by Kubernetes
provider. Find the instructions for your chosen providers and use
them to authenticate and configure access for each console
session. See the following links for more information:
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.

* [Minikube](https://skupper.io/start/minikube.html)
* [Amazon Elastic Kubernetes Service (EKS)](https://skupper.io/start/eks.html)
* [Azure Kubernetes Service (AKS)](https://skupper.io/start/aks.html)
* [Google Kubernetes Engine (GKE)](https://skupper.io/start/gke.html)
* [IBM Kubernetes Service](https://skupper.io/start/ibmks.html)
* [OpenShift](https://skupper.io/start/openshift.html)
* [More providers](https://kubernetes.io/partners/#kcsp)
[kube-providers]: https://skupper.io/start/kubernetes.html

## Step 3: Set up your namespaces

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.

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

~~~ shell
kubectl create namespace public
kubectl config set-context --current --namespace public
~~~

_Sample output:_

~~~ console
$ kubectl create namespace public
namespace/public created

$ kubectl config set-context --current --namespace public
Context "minikube" modified.
~~~

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

~~~ shell
kubectl create namespace private
kubectl config set-context --current --namespace private
~~~

_Sample output:_

~~~ console
$ kubectl create namespace private
namespace/private created

$ kubectl config set-context --current --namespace private
Context "minikube" modified.
~~~

## Step 4: Install Skupper in your namespaces

The `skupper init` command installs the Skupper router and service
The `skupper init` command installs the Skupper router and
controller in the current namespace. Run the `skupper init` command
in each namespace.

@@ -142,21 +118,13 @@ tunnel`][minikube-tunnel] before you install Skupper.

[minikube-tunnel]: https://skupper.io/start/minikube.html#running-minikube-tunnel

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

~~~ shell
skupper init
~~~

_Sample output:_

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

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

~~~ shell
skupper init
@@ -167,30 +135,22 @@ _Sample output:_
~~~ console
$ skupper init
Waiting for LoadBalancer IP or hostname...
Skupper is now installed in namespace 'private'. Use 'skupper status' to get more information.
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.

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

~~~ shell
skupper status
~~~

_Sample output:_

~~~ console
$ skupper status
Skupper is enabled for namespace "public" 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'
~~~

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

~~~ shell
skupper status
@@ -200,7 +160,7 @@ _Sample output:_

~~~ console
$ skupper status
Skupper is enabled for namespace "private" in interior mode. It is connected to 1 other site. It has 1 exposed service.
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'
~~~
@@ -227,7 +187,7 @@ First, use `skupper token create` in one namespace to generate the
token. Then, use `skupper link create` in the other to create a
link.

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

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

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

~~~ shell
skupper link create ~/secret.token
@@ -255,16 +215,16 @@ Check the status of the link using 'skupper link status'.
~~~

If your console sessions are on different machines, you may need
to use `sftp` or a similar tool to transfer the token securely.
By default, tokens expire after a single use or 15 minutes after
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

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

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

~~~ shell
kubectl apply -f server/kubernetes.yaml
@@ -285,7 +245,7 @@ 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:**_
_**Console for Private:**_

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

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

~~~ shell
kubectl get service/server
@@ -316,7 +276,7 @@ server ClusterIP 10.100.58.95 <none> 8080/TCP 2s

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

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

~~~ shell
kubectl run client --attach --rm --image docker.io/library/nginx --restart Never -- curl -sf http://server:8080/
@@ -342,7 +302,7 @@ password.
following output are placeholders. The actual values are specific
to your environment.

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

~~~ shell
skupper status
@@ -353,7 +313,7 @@ _Sample output:_

~~~ console
$ skupper status
Skupper is enabled for namespace "public" in interior mode. It is connected to 1 other site. It has 1 exposed service.
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'

@@ -369,14 +329,14 @@ in as user `admin` and enter the password.
To remove Skupper and the other resources from this exercise, use
the following commands.

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

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

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

~~~ shell
skupper delete
@@ -393,9 +353,9 @@ documenting and testing Skupper examples.

[skewer]: https://github.com/skupperproject/skewer

Skewer provides some utilities for generating the README and running
the example steps. Use the `./plano` command in the project root to
see what is available.
Skewer provides utility functions for generating the README and
running the example steps. Use the `./plano` command in the project
root to see what is available.

To quickly stand up the example using Minikube, try the `./plano demo`
command.
28 changes: 28 additions & 0 deletions external/skewer-main/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: main
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0"
jobs:
main:
strategy:
fail-fast: false
matrix:
skupper-version: [latest, main]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: manusa/actions-setup-minikube@v2.10.0
with:
minikube version: "v1.32.0"
kubernetes version: "v1.29.0"
github token: ${{secrets.GITHUB_TOKEN}}
- run: curl https://skupper.io/install.sh | bash -s -- --version ${{matrix.skupper-version}}
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: ./plano test
env:
PLANO_COLOR: 1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__/
/README.html
/htmlcov
/.coverage
Loading

0 comments on commit 0914ee9

Please sign in to comment.