### Bootstrap Skupper Non-Kubernetes Site via CLI Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This example demonstrates how to bootstrap a non-Kubernetes Skupper site using the command-line interface. It involves setting the `SKUPPER_PLATFORM` environment variable to specify the target container engine (e.g., `podman`) and then running `skupper system start`. This command initiates the site based on pre-configured Custom Resources (CRs) and allows for namespace overrides. ```shell export SKUPPER_PLATFORM=podman skupper system start ``` -------------------------------- ### Set Up Test Environment Using Makefile Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Command to create a Python virtual environment and install all required dependencies and Ansible collections using the `make create-venv` target. This automates the setup process for running Skupper E2E tests. ```bash # Create a Python virtual environment make create-venv FORCE=true ``` -------------------------------- ### Deploy Frontend and Backend Applications Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Deploys a 'hello-world-frontend' application in the 'west' namespace and a 'hello-world-backend' application with 3 replicas in the 'east' namespace. This sets up the base applications for Skupper to connect. ```bash kubectl create namespace west kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend -n west ``` ```bash kubectl create namespace east kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3 -n east ``` -------------------------------- ### Expose Backend Service in East Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Applies a Skupper connector configuration in the 'east' namespace to expose the 'hello-world-backend' service. This makes the backend service available for consumption by other Skupper sites. ```bash kubectl apply -n east -f https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/controller/example/connector.yaml ``` -------------------------------- ### Install Skupper Sites from Bundles Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md These commands execute the generated installation bundles for both the 'west' and 'east' Skupper sites. Running these scripts installs and configures each site within its respective namespace. ```shell /home/user/.local/share/skupper/bundles/skupper-install-west.sh -n west /home/user/.local/share/skupper/bundles/skupper-install-east.sh -n east ``` -------------------------------- ### Create Skupper Sites Declaratively Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Applies Skupper site configurations for 'west' and 'east' namespaces using remote YAML files. These commands initialize Skupper controllers in each namespace, establishing them as distinct sites. ```bash kubectl apply -n west -f https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/controller/example/site1.yaml ``` ```bash kubectl apply -n east -f https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/controller/example/site2.yaml ``` -------------------------------- ### Test Connectivity via Port Forward Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Establishes a local port-forward to the frontend deployment in the 'west' namespace. This allows direct access to the frontend application from localhost, enabling testing of the end-to-end Skupper connectivity. ```bash kubectl -n west port-forward deployment/frontend 8080:8080 ``` -------------------------------- ### Create Skupper West Site Installation Bundle Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This snippet demonstrates two ways to create a distributable installation bundle for the 'west' Skupper site. The first uses the bootstrap.sh script, and the second uses the skupper system generate-bundle command, both producing a shell script bundle for easy deployment. ```shell $ ./cmd/bootstrap/bootstrap.sh -p ./west/ -b bundle Skupper nonkube bootstrap (version: main-release-161-g7c5100a2-modified) Site "west" has been created (as a distributable bundle) Installation bundle available at: /home/user/.local/share/skupper/bundles/skupper-install-west.sh Default namespace: default Default platform: podman ``` ```shell skupper system generate-bundle my-bundle --input ./west --type shell-script 2024/11/18 12:17:56 updating listener /backend... Site "west" has been created (as a distributable bundle) Installation bundle available at: {HOME}/.local/share/skupper/bundles/my-bundle.sh Default namespace: default Default platform: podman ``` -------------------------------- ### Skupper Bundle Installation Script Flags Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This section outlines the command-line flags accepted by the Skupper bundle installation script. It provides options for displaying help, specifying the platform, overriding the namespace, removing sites, and dumping static links to a directory. ```APIDOC -h help -p podman, docker, linux -n if not provided, the namespace defined in the bundle is used (if none, default is used) -x remove site and namespace -d dump static links into the provided directory ``` -------------------------------- ### Set Up Python Virtual Environment for Skupper Tests Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Instructions to create and activate a Python virtual environment and install test dependencies. This is required for running tests directly, but not when using the Makefile. ```bash # Under E2E test directory python3.13 -m venv --upgrade-deps venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Link Skupper Sites with Access Grant Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Creates an Access Grant in the 'west' site to generate connection details (CA, code, URL) required for linking. It then waits for the grant to be ready and displays its YAML, from which the details are copied to create an Access Token in the 'east' site, establishing the link. ```bash kubectl apply -n west -f https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/controller/example/access_grant.yaml ``` ```bash kubectl wait --for=condition=ready accessgrant/my-grant -n west && kubectl get accessgrant my-grant -n west -o yaml ``` -------------------------------- ### Create Skupper East Site Installation Bundle Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command creates a distributable installation bundle for the 'east' Skupper site using the bootstrap.sh script. The bundle simplifies the deployment of the 'east' site configuration. ```shell $./cmd/bootstrap/bootstrap.sh -p ./east -b bundle Skupper nonkube bootstrap (version: main-release-161-g7c5100a2-modified) Site "east" has been created (as a distributable bundle) Installation bundle available at: /home/user/.local/share/skupper/bundles/skupper-install-east.sh Default namespace: default Default platform: podman ``` -------------------------------- ### Install Python and Ansible Dependencies Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/attached-connector/README.md This snippet outlines the steps to set up a Python virtual environment and install required Python packages and Ansible collections for the Skupper iPerf3 E2E test. ```bash # Create a virtual environment python3 -m venv .venv source .venv/bin/activate # Install Python dependencies pip install -r requirements.txt # Install Ansible collections ansible-galaxy collection install -r collections/requirements.yml ``` -------------------------------- ### Bootstrap Skupper East Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This snippet provides two methods to bootstrap the 'east' Skupper site, similar to the 'west' site. It shows how to use either the bootstrap.sh script or the skupper system start command to initialize the site within the 'east' namespace. ```shell ./cmd/bootstrap/bootstrap.sh -n east ``` ```shell skupper system start -n east ``` -------------------------------- ### Consume Backend Service in West Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/example/README.md Applies a Skupper listener configuration in the 'west' namespace to consume the exposed backend service from the 'east' site. This allows applications in the 'west' site to access the backend as if it were local. ```bash kubectl apply -n west -f https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/controller/example/listener.yaml ``` -------------------------------- ### Clean Up Skupper Bundle Installations Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md These commands uninstall the Skupper sites that were deployed using the installation bundles. The -x flag indicates an uninstall operation, removing all resources associated with the bundle installation. ```shell /home/user/.local/share/skupper/bundles/skupper-install-west.sh -x /home/user/.local/share/skupper/bundles/skupper-install-east.sh -x ``` -------------------------------- ### Example Configuration of Resource Multipliers in vars.yml Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Illustrates how to set `RESOURCE_RETRY_MULTIPLIER` and `RESOURCE_DELAY_MULTIPLIER` in `vars.yml` to adjust retry attempts and delay durations for resource operations, doubling retries and tripling delays in this example. ```yaml RESOURCE_RETRY_MULTIPLIER: 2 RESOURCE_DELAY_MULTIPLIER: 3 ``` -------------------------------- ### Install Skupper Network Observer with Basic Manifest Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/README.md This snippet applies the most basic Skupper Network Observer deployment manifest, exposing the console and API as a ClusterIP Service without authentication. It then sets up a port-forward to access the service locally via kube-proxy. ```bash kubectl apply -f skupper-network-observer.yaml; kubectl port-forward services/skupper-network-observer 8443:443 ``` -------------------------------- ### Define Skupper East Site and Connector Resources Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This section provides the YAML definitions for the 'east' Skupper site and a Connector resource, which links to a backend service. It also includes the equivalent Skupper CLI commands for creating these resources, offering an alternative, more automated approach to site and connector setup. ```yaml apiVersion: skupper.io/v2alpha1 kind: Site metadata: name: east ``` ```yaml --- apiVersion: skupper.io/v2alpha1 kind: Connector metadata: name: backend spec: host: 127.0.0.1 port: 9090 routingKey: backend-8080 ``` ```shell skupper site create east -n east skupper connector create backend 9090 --host 127.0.0.1 --routing-key backend -n east ``` -------------------------------- ### Install Ansible Collections from requirements.yml Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/README.md This command installs all Ansible collections listed in the specified `requirements.yml` file, ensuring all project dependencies are met. ```bash ansible-galaxy collection install -r requirements.yml ``` -------------------------------- ### Example Subject Alternative Name (SAN) from Server Certificate Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/PROVIDED_CERTIFICATES.md This snippet provides an example of a Subject Alternative Name (SAN) found in a server certificate. Skupper inspects these SANs (like `DNS:my.local.server.com`) to automatically generate static link files, ensuring the links are valid for the specified hostnames or IP addresses. ```shell X509v3 Subject Alternative Name: DNS:my.local.server.com ``` -------------------------------- ### Copy Base E2E Test Directory for New Tests Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md This command copies the `hello-world` E2E test directory to create a new test. It serves as a recommended starting point for developing new end-to-end test scenarios, which should then be customized and documented according to project guidelines. ```bash cp -r tests/e2e/scenarios/hello-world tests/e2e/scenarios/your-new-test ``` -------------------------------- ### Install Locally Generated Skupper Chart (Namespace Scope) Source: https://github.com/skupperproject/skupper/blob/main/charts/skupper/README.md This command installs a locally generated Skupper Helm chart with a namespace-scoped controller, suitable for development and testing within a specific namespace. ```bash helm install skupper ./skupper --set scope=namespace ``` -------------------------------- ### Install Ansible Collection from Galaxy Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/README.md This command installs the `e2e.tests` Ansible collection directly from Ansible Galaxy, making its roles and modules available for use in Ansible playbooks. ```bash ansible-galaxy collection install e2e.tests ``` -------------------------------- ### Clean Up Skupper Site Installations Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md These commands stop and remove the Skupper installations for both the 'west' and 'east' namespaces. This is used for cleaning up resources after testing or when decommissioning the sites. ```shell skupper system stop -n west skupper system stop -n east ``` -------------------------------- ### Bootstrap Skupper West Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This snippet demonstrates two methods to bootstrap the 'west' Skupper site. The first uses a local bootstrap.sh script, while the second uses the skupper system start command. Both commands ensure the site is initialized within the specified 'west' namespace, handling CRs defined without explicit namespaces. ```shell ./cmd/bootstrap/bootstrap.sh -n west ``` ```shell skupper system start -n west ``` -------------------------------- ### Install Specific Version of Ansible Collection Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/README.md This command installs a precise version of the `e2e.tests` Ansible collection, useful for maintaining compatibility or reverting to a known stable state. ```bash ansible-galaxy collection install e2e.tests:==X.Y.Z ``` -------------------------------- ### Run Ansible Playbook for Redis Multicloud HA Test Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/redis/README.md This command executes the `redis_test.yml` Ansible playbook using the specified `inventory/` directory. It initiates the setup process for the Redis Multicloud HA environment across multiple clusters and a Podman environment. ```bash ansible-playbook redis_test.yml -i inventory/ ``` -------------------------------- ### Example Usage: Test API Connectivity with Ansible Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/roles/run_curl/README.md This example demonstrates how to include the `e2e.tests.run_curl` Ansible role to test API connectivity. It configures the namespace using a prefix and base name, specifies the container image for the curl pod, and sets the target address for the HTTP request. The role will deploy a temporary pod and execute the curl command against the specified endpoint. ```yaml - name: Test API connectivity ansible.builtin.include_role: name: e2e.tests.run_curl vars: namespace_prefix: "e2e" namespace_name: "hello-world" run_curl_image: "quay.io/skupper/lanyard" run_curl_address: "backend:8080/api/hello" ``` -------------------------------- ### Install Locally Generated Skupper Chart (Cluster Scope) Source: https://github.com/skupperproject/skupper/blob/main/charts/skupper/README.md This command installs a locally generated Skupper Helm chart with a cluster-scoped controller, useful for testing development changes or custom builds. ```bash helm install skupper ./skupper --set scope=cluster ``` -------------------------------- ### Deploy Skupper Controller to a Specific Namespace with Helm Source: https://github.com/skupperproject/skupper/blob/main/charts/skupper/README.md This command installs the Skupper controller into a user-defined Kubernetes namespace, creating the namespace if it doesn't exist, using the official Helm chart. ```bash helm install skupper oci://quay.io/skupper/helm/skupper \ --namespace \ --create-namespace ``` -------------------------------- ### Generate Skupper Helm Chart for Development Source: https://github.com/skupperproject/skupper/blob/main/charts/skupper/README.md This command executes the 'make' target to generate the Skupper Helm chart locally, which is necessary for development and testing purposes before installation. ```bash make generate-skupper-helm-chart ``` -------------------------------- ### Manage Secure Basic Authentication Credentials for Skupper Observer Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/README.md This sequence of commands shows how to generate htpasswd credentials, create a Kubernetes secret from them, configure a Helm installation to use this custom secret, and subsequently rotate the credentials by patching the existing secret with updated values. ```bash # Use htpasswd to generate a new password file htpasswd -B -c passwords \ my-username; # Add a new secret with that password file kubectl create secret generic my-custom-auth \ --from-file=htpasswd=passwords; # Point the chart at the new secret helm install ... \ --set auth.basic.create=false \ --set auth.basic.secretName=my-custom-auth # Rotate the credentials with a new htpasswd file by patching # the existing secret with updated credentials in ./passwords kubectl patch secrets \ my-custom-auth -p '{"data":{"htpasswd":"'$(base64 -w0 ./passwords)'"}}' ``` -------------------------------- ### Extract Static Links from Skupper West Bundle Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command extracts the static link configuration files from the generated 'west' site installation bundle to a specified temporary directory. This is necessary to copy the link definition to the 'east' site for inter-site connectivity. ```shell /home/user/.local/share/skupper/bundles/skupper-install-west.sh -d /tmp ``` ```shell cp /tmp/west/link-go-west-127.0.0.1.yaml ./east/link-go-west.yaml ``` -------------------------------- ### Generated Static Link File Path Example Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/PROVIDED_CERTIFICATES.md This snippet illustrates the path where Skupper generates a static link file based on a server certificate's Subject Alternative Name (SAN). If `my.local.server.com` is a SAN, Skupper creates a corresponding YAML link file at this location, enabling connections to that specific endpoint. ```shell $HOME/.local/share/skupper/namespaces/default/runtime/links/link-my-router-access-my.local.server.com.yaml ``` -------------------------------- ### Ansible Playbook Example: Wait for Kubernetes Pods Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/roles/pod_wait/README.md This YAML snippet demonstrates how to integrate and configure the `e2e.tests.pod_wait` Ansible role within a playbook. It specifies the target namespace, the kubeconfig file path for cluster access, and uses a label selector to wait for pods matching 'app=myapp'. ```YAML - name: Wait for all pods to be in Running state ansible.builtin.include_role: name: e2e.tests.pod_wait vars: namespace_prefix: "e2e" namespace_name: "hello-world" kubeconfig: "/path/to/kubeconfig" pod_wait_label_selectors: "app=myapp" ``` -------------------------------- ### Define Skupper RouterAccess for Inter-Router and Edge Connections Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This snippet defines a RouterAccess Custom Resource (CR) in YAML, specifying roles for inter-router and edge connections on specific ports. It also shows the equivalent Skupper CLI command that automates the creation of this resource, simplifying the setup process. ```yaml apiVersion: skupper.io/v2alpha1 kind: RouterAccess metadata: name: go-west spec: roles: - port: 55671 name: inter-router - port: 45671 name: edge bindHost: 127.0.0.1 ``` ```shell skupper site create west --enable-link-access -n west skupper listener create backend 8080 -n west ``` -------------------------------- ### Configure Resource Retry and Delay Multipliers in Test YAML Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Example of how `RESOURCE_RETRY_MULTIPLIER` and `RESOURCE_DELAY_MULTIPLIER` variables are used within a `test.yml` file to dynamically control retry attempts and delays for Kubernetes operations, aiding in managing network latency and resource availability. ```yaml retries: "{{ resource_retry_value * RESOURCE_RETRY_MULTIPLIER }}" delay: "{{ resource_delay_value * RESOURCE_DELAY_MULTIPLIER }}" ``` -------------------------------- ### Ansible Task to Create Kubernetes Namespaces Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/roles/generate_namespaces/README.md This Ansible task demonstrates how to invoke the `generate_namespaces` role. It configures the `namespace_prefix` to 'my-app', `namespace_name` to 'dev', and specifies the `kubeconfig` path for Kubernetes cluster access. This setup will create a namespace named 'my-app-dev' (assuming the role concatenates prefix and name) with the default label 'test'. ```yaml - hosts: localhost tasks: - name: Create namespaces include_role: name: generate_namespaces vars: namespace_prefix: "my-app" namespace_name: "dev" kubeconfig: "~/.kube/config" ``` -------------------------------- ### Run Hello World Frontend Container with Podman Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command runs the `hello-world-frontend` container using Podman. It maps port 7070 on the host to 8080 in the container and configures the frontend to connect to a backend service at `http://host.containers.internal:8080`. ```shell podman run --name frontend -d --rm -p 127.0.0.1:7070:8080 quay.io/skupper/hello-world-frontend --backend http://host.containers.internal:8080 ``` -------------------------------- ### Inspect Certificate Subject Alternative Names using OpenSSL Source: https://github.com/skupperproject/skupper/blob/main/doc/tls/README.md Demonstrates how to inspect the Subject Alternative Name (SAN) extension of an X.509 certificate using the `openssl` command-line tool. This is relevant to a known Skupper issue where IP addresses are added as DNS entries in SANs, as shown in the example output: `X509v3 Subject Alternative Name:\n DNS:skupper-router, DNS:172.18.255.193, IP Address:172.18.255.193`. ```Shell openssl x509 -ext subjectAltName ``` -------------------------------- ### Run Hello World Backend Container with Podman Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command runs the `hello-world-backend` container using Podman. It maps port 9090 on the host to 8080 in the container, making the backend service available for the frontend application. ```shell podman run --name backend -d --rm -p 127.0.0.1:9090:8080 quay.io/skupper/hello-world-backend ``` -------------------------------- ### Skupper CLI: Bootstrap Command Reference Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This section provides the full command-line interface reference for the `skupper bootstrap` command. It details its purpose for initializing non-Kubernetes Skupper sites, how it processes custom resources from a specified path, manages namespaces, and supports different bundle strategies. All available flags and their descriptions are included. ```APIDOC Skupper bootstrap Bootstraps a nonkube Skupper site base on the provided flags. When the path (-p) flag is provided, it will be used as the source directory containing the Skupper custom resources to be processed, generating a local Skupper site using the "default" namespace, unless a namespace is set in the custom resources, or if the namespace (-n) flag is provided. A namespace is just a directory in the file system where all site specific files are stored, like certificates, configurations, the original sources (original custom resources used to bootstrap the nonkube site) and the runtime files generated during initialization. Namespaces are stored under ${XDG_DATA_HOME}/skupper/namespaces for regular users when XDG_DATA_HOME environment variable is set, or under ${HOME}/.local/share/skupper/namespaces when it is not set. As the root user, namespaces are stored under: /var/lib/skupper/namespaces. Skupper will process custom resources stored at the input/resources directory of the default namespace, or from the namespace provided through the namespace (-n) flag. To produce a bundle, instead of rendering a site, the bundle strategy (-b) flag must be set to "bundle" or "tarball". This action needs the path (-p) flag is provided, that it will be used as the source directory containing the Skupper custom resources to be processed, generating a local Skupper site using the "default" namespace, unless a namespace is set in the custom resources, or if the namespace (-n) flag is provided. Usage: bootstrap [options...] Flags: -b string The bundle strategy to be produced: bundle or tarball -n string The target namespace used for installation -p string Custom resources location on the file system for the bundle -v Report the version of the Skupper bootstrap command ``` -------------------------------- ### Run Skupper Hello World Ansible Playbook Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Executes the `hello_world_test.yml` Ansible playbook using the specified inventory directory to initiate the Skupper connectivity test. ```bash ansible-playbook hello_world_test.yml -i hello-world/inventory/ ``` -------------------------------- ### Create Kind Development Cluster with Metallb and Podman Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md This command quickly sets up a Kind Kubernetes cluster for development purposes. It configures the KUBECONFIG environment variable, includes Metallb for load balancing capabilities, and specifies Podman as the container runtime for the cluster. ```bash KUBECONFIG=~/.kube/config ../scripts/kind-dev-cluster -r --metallb -i podman ``` -------------------------------- ### Run Specific Skupper E2E Test Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md This command executes a specific end-to-end test, such as 'hello-world', which is located in the `e2e/hello-world` directory. Running this command activates the virtual environment and initiates the associated test playbook for the specified test. ```bash make test TEST="hello-world" ``` -------------------------------- ### Available Make Commands for Skupper Testing Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md This section lists various `make` commands available for managing the virtual environment and running different types of tests within the Skupper project. These commands facilitate creating/refreshing the virtual environment, testing specific roles, running individual tests, executing all E2E tests, running a subset of tests, and running CI tests. ```bash # Create or refresh the virtual environment make create-venv FORCE=true # Testing a specific role make test-role ROLE="role_name" # Run a specific test make test TEST="test_directory_name" # Run all tests (all directories in e2e/ that start with test_) make e2e-tests # Run a specific test with a subset of tests make test-subset TESTS="test1,test2" # Run CI tests make ci-tests ``` -------------------------------- ### Deploy Frontend Application in West Namespace using kubectl Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Deploys a 'hello-world-frontend' application into the 'west' Kubernetes namespace. This command creates the namespace if it doesn't exist and then deploys the frontend component, which will act as the client in the distributed application. ```kubectl kubectl create namespace west kubectl create deployment frontend --image quay.io/skupper/hello-world-frontend -n west ``` -------------------------------- ### Deploy Skupper Network Observer using Helm Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/README.md This command deploys the Skupper Network Observer to a Kubernetes namespace using the Helm package manager. It pulls the chart from the specified OCI registry, enabling development versions. ```bash helm install skupper-network-observer oci://quay.io/skupper/helm/network-observer --devel ``` -------------------------------- ### Bootstrap Skupper Site using Shell Script Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This snippet shows how to bootstrap a Skupper site using a shell script. It sets the `SKUPPER_PLATFORM` environment variable to 'podman' before executing the bootstrap script. This process initializes a local Skupper site. ```shell export SKUPPER_PLATFORM=podman ./cmd/bootstrap/bootstrap.sh ``` -------------------------------- ### Create Skupper Site in West Namespace Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Initializes a Skupper site named 'site1' in the 'west' namespace. The '--enable-link-access' flag ensures that this site can generate tokens or link resources for other Skupper sites to connect. ```skupper skupper site create site1 --enable-link-access -n west ``` -------------------------------- ### Deploying Skupper Test Images with Ansible Playbook Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/roles/skupper_test_images/README.md Demonstrates how to include the `skupper_test_images` Ansible role in a playbook to manage image references for Skupper testing. It shows a basic deployment of a hello-world frontend using the role's image variable. ```yaml - name: Run tests with default images hosts: all roles: - e2e.tests.skupper_test_images tasks: - name: Deploy hello world frontend kubernetes.core.k8s: definition: apiVersion: apps/v1 kind: Deployment metadata: name: frontend spec: template: spec: containers: - name: frontend image: "{{ skupper_test_image_hello_world_frontend }}" ``` -------------------------------- ### Build Skupper with Podman Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md This command builds the Skupper project using Podman. It should be executed from the project's root directory to ensure all necessary components are compiled. ```bash make podman-build ``` -------------------------------- ### Deploy Skupper Network Observer with HTTP Basic Authentication Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/README.md This set of commands deploys the Skupper Network Observer with HTTP basic authentication enabled. It includes steps to create an htpasswd file with user credentials, update the Kubernetes secret containing the hashed credentials, and then port-forward to access the secured service. ```bash kubectl apply -f skupper-network-observer-httpbasic.yaml; # Create a htpasswd file with user provided credentials htpasswd -c /tmp/htpasswd my-user; # Update the secret containing the authenticated users and hashed credentials kubectl patch secret skupper-network-observer-auth \ -p '{"data":{"htpasswd":"'$(base64 -w0 /tmp/htpasswd)'"}}'; # access the service at https://localhost:8443 via kube-proxy # should be prompted for http basic auth. kubectl port-forward services/skupper-network-observer 8443:443 ``` -------------------------------- ### Initialize SwaggerUI with OpenAPI Spec Source: https://github.com/skupperproject/skupper/blob/main/cmd/network-observer/spec/index.html This JavaScript snippet initializes the Swagger UI bundle when the window loads. It configures Swagger UI to fetch and display an OpenAPI specification from the '/swagger/openapi.yaml' URL within the DOM element identified by '#swagger-ui'. ```JavaScript window.onload = () => { window.ui = SwaggerUIBundle({ url: '/swagger/openapi.yaml', dom_id: '#swagger-ui' }); }; ``` -------------------------------- ### Run Skupper Playbook with Kubeconfig Overrides Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Executes the Skupper Hello World Ansible playbook, allowing users to specify custom kubeconfig paths for the 'west' and 'east' clusters via extra variables. ```bash ansible-playbook hello_world_test.yml -i hello-world/inventory/ \ -e kubeconfig_1=/path/to/west/kubeconfig \ -e kubeconfig_2=/path/to/east/kubeconfig ``` -------------------------------- ### Deploy Backend Application in East Namespace using kubectl Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Deploys a 'hello-world-backend' application with three replicas into the 'east' Kubernetes namespace. This sets up the server-side component of the distributed application, which will be exposed and consumed by the frontend. ```kubectl kubectl create namespace east kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3 -n east ``` -------------------------------- ### Create Skupper Site in East Namespace Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Initializes a Skupper site named 'site2' in the 'east' namespace. This prepares the backend namespace for Skupper integration, allowing it to expose services and connect to other Skupper sites. ```skupper skupper site create site2 -n east ``` -------------------------------- ### Ansible Host Variables for West Kubernetes Cluster Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Specifies Ansible variables unique to the 'west' Kubernetes cluster, including kubeconfig path, namespace name, and curl test configuration for verifying connectivity. ```yaml # Kubeconfig path for west site kubeconfig_1: "{{ ansible_env.HOME }}/.kube/config" kubeconfig: "{{ kubeconfig_1 }}" # Namespace configuration namespace_name: hello-world-west # Run curl configuration run_curl_namespace: default run_curl_address: "backend:8080/api/hello" run_curl_image: "{{ skupper_test_images_lanyard }}" run_curl_pod_name: curl-test run_curl_retries: 30 run_curl_delay: 6 ``` -------------------------------- ### Define Skupper Listener Custom Resource for Backend Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This YAML snippet defines a Skupper `Listener` custom resource named 'backend'. It configures a listener on host `0.0.0.0` at port `8080` with a `routingKey` of 'backend-8080', enabling the exposure of a service through Skupper. ```yaml apiVersion: skupper.io/v2alpha1 kind: Listener metadata: name: backend spec: host: 0.0.0.0 port: 8080 routingKey: backend-8080 ``` -------------------------------- ### Generate Skupper Deployment YAMLs using Make Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/README.md This snippet provides `make` commands to generate the Skupper deployment YAML files locally. It includes commands for both cluster-scoped and namespace-scoped deployments, offering an alternative to direct `kubectl apply` from remote URLs. ```Makefile make generate-skupper-deployment-cluster-scoped make generate-skupper-deployment-namespace-scoped ``` -------------------------------- ### Ansible Global Variables for Skupper Hello World Test Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Defines common Ansible variables applicable to all hosts in the Skupper Hello World test, including connection type, user, debug flag, and namespace prefixes. ```yaml ansible_connection: local ansible_user: "{{ lookup('env', 'USER') }}" debug: false namespace_prefix: "e2e" generate_namespaces_namespace_label: "e2e" teardown_test_namespace_label: generate_namespaces_namespace_label site_access_token_path: "" ``` -------------------------------- ### Issue Skupper Access Token from West Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Generates an access token file ('my-token.yaml') from the Skupper site in the 'west' namespace. This token contains the necessary credentials for another Skupper site to establish a secure link back to the 'west' site. ```skupper skupper token issue ~/my-token.yaml -n west ``` -------------------------------- ### Deploy Skupper Controllers using kubectl apply Source: https://github.com/skupperproject/skupper/blob/main/cmd/controller/README.md This snippet demonstrates how to deploy Skupper controllers using `kubectl apply` with static manifest YAMLs. It shows commands for both cluster-scoped and namespace-scoped deployments, utilizing a `SKUPPER_VERSION` variable to specify the release. ```Shell SKUPPER_VERSION=v2-dev-release # Deploys a cluster scoped controller to the 'skupper' namespace. kubectl apply -f "https://github.com/skupperproject/skupper/releases/download/$SKUPPER_VERSION/skupper-cluster-scope.yaml" # Deploys a namespace scoped controller to the current context namespace. kubectl apply -f "https://github.com/skupperproject/skupper/releases/download/$SKUPPER_VERSION/skupper-namespace-scope.yaml" ``` -------------------------------- ### Consume Backend Service in West Skupper Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Creates a listener in the 'west' Skupper site for the 'backend' service on port '8080'. This command enables the frontend application in 'west' to discover and route traffic to the backend service exposed in 'east' through the Skupper network. ```skupper skupper listener create backend 8080 -n west ``` -------------------------------- ### Run Skupper Playbook Skipping Teardown Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Executes the Skupper Hello World Ansible playbook, overriding the `skip_teardown` variable to prevent the cleanup of test resources after execution. ```bash ansible-playbook hello_world_test.yml -i hello-world/inventory/ -e skip_teardown=true ``` -------------------------------- ### Ansible Host Variables for East Kubernetes Cluster Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Specifies Ansible variables unique to the 'east' Kubernetes cluster, including kubeconfig path and namespace name. ```yaml # Kubeconfig path for east site kubeconfig_2: "{{ ansible_env.HOME }}/.kube/config" kubeconfig: "{{ kubeconfig_2 }}" # Namespace configuration namespace_name: hello-world-east ``` -------------------------------- ### Copy West Site Link Configuration to East Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command copies the generated link configuration YAML file from the 'west' site's runtime directory to the 'east' site's local definition directory. This link file is essential for establishing connectivity between the two Skupper sites. ```shell cp ${HOME}/.local/share/skupper/namespaces/west/runtime/links/link-go-west-127.0.0.1.yaml ./east/link-go-west.yaml ``` -------------------------------- ### Port-Forward Frontend Service for Local Testing using kubectl Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Establishes a local port-forward from 'localhost:8080' to the 'frontend' deployment's port '8080' in the 'west' namespace. This allows you to access the frontend application from your local machine and test the end-to-end connectivity through the Skupper network. ```kubectl kubectl -n west port-forward deployment/frontend 8080:8080 ``` -------------------------------- ### Test Basic Connectivity with TCP/TLS Clients Source: https://github.com/skupperproject/skupper/blob/main/doc/tls/README.md Demonstrates how to use common command-line tools like `nc`, `curl`, and `openssl` to test TCP and TLS connectivity to Skupper router link endpoints. These tests help differentiate general network issues from specific TLS certificate problems by observing the router's response. ```bash echo "hello" | nc ``` ```bash curl --insecure https://: ``` ```bash openssl s_client -showcerts -connect : ``` -------------------------------- ### Accessing Skupper Network Console HTTP API Source: https://github.com/skupperproject/skupper/blob/main/cmd/network-observer/README.md The Skupper Network Console HTTP API is defined by an OpenAPI 3.0 specification. This snippet provides instructions on how to view and interact with the API documentation, either by importing the specification into a Swagger editor or by accessing the Swagger UI locally. ```APIDOC The Skupper Network Console HTTP API is described in an OpenAPI 3.0 specification file located in the `spec` directory. To view the API, either import this document into an online Swagger editor (e.g., https://editor-next.swagger.io/) from URL: `https://raw.githubusercontent.com/skupperproject/skupper/v2/cmd/network-observer/spec/openapi.yaml` Or, start the collector locally and access the Swagger UI at: `http://localhost:8080/swagger/` ``` -------------------------------- ### Apply Skupper Link Custom Resource in East Site using kubectl Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Applies the generated Skupper link Custom Resource file ('linktowest.yaml') to the 'east' namespace. This command instructs Kubernetes to create the link resource, which Skupper then uses to establish connectivity between the 'west' and 'east' sites. ```kubectl kubectl apply -n east -f ~/linktowest.yaml ``` -------------------------------- ### Generate Skupper Link Custom Resource in West Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Generates a YAML file containing a Skupper link Custom Resource and its associated certificate from the 'west' Skupper site. This provides an alternative, declarative method for linking sites compared to token redemption. ```skupper skupper link generate -n west > ~/linktowest.yaml ``` -------------------------------- ### Configure Nginx Ingress for Skupper Network Observer Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/README.md This `values.yaml` snippet demonstrates how to enable and configure an Nginx Ingress controller for the Skupper Network Observer. It sets up host rules, path types, and references a user-provided TLS secret for secure external access to the service. ```yaml ingress: enabled: true className: "nginx" annotations: nginx.ingress.kubernetes.io/backend-protocol: "https" hosts: - host: skupper-net-01.mycluster.local paths: - path: / pathType: Prefix tls: - secretName: skupper-net-01-tls hosts: - skupper-net-01.mycluster.local ``` -------------------------------- ### Skupper Tests Repository Directory Structure Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Overview of the `tests/` directory, detailing the location of end-to-end tests and their specific scenarios, such as basic functionality, network performance, Redis integration, and high availability. ```plaintext tests/ ├── e2e/ ├── scenarios/ # End-to-end tests directory │ ├── hello-world/ # Basic Skupper functionality test │ ├── attached-connector/ # Network performance test with attached connectors │ ├── redis/ # Redis test │ ├── ha/ # High availability test using Skupper └── README.md # This file ``` -------------------------------- ### Directory Structure for Custom Skupper Site CA Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/PROVIDED_CERTIFICATES.md This snippet illustrates the required directory structure for providing your own Skupper site CA certificates. Placing `ca.crt`, `tls.crt`, and `tls.key` within `${HOME}/.local/share/skupper/namespaces/default/input/issuers/skupper-site-ca` allows Skupper to use them for signing server and client certificates during site linking. ```shell ${HOME}/.local/share/skupper/namespaces/default/input/issuers/ └── skupper-site-ca ├── ca.crt ├── tls.crt └── tls.key ``` -------------------------------- ### Execute Skupper iPerf3 E2E Test Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/attached-connector/README.md Commands to run the main Ansible playbook for the iPerf3 attached connector test, including options for specifying a custom kubeconfig path and skipping resource teardown for debugging purposes. ```bash # Basic execution ansible-playbook test.yml -i inventory/hosts.yml # With specific kubeconfig (overrides inventory settings) ansible-playbook test.yml -i inventory/hosts.yml -e "kubeconfig=/path/to/kubeconfig" # Skip teardown (keeps resources for debugging) ansible-playbook test.yml -i inventory/hosts.yml -e "skip_teardown=true" ``` -------------------------------- ### Define Skupper Link Resource for East Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This YAML snippet defines a Link Custom Resource for the 'east' site, enabling it to connect to the 'west' site. It includes a Secret for TLS credentials and specifies the endpoints and cost for the link, ensuring secure and routed communication. ```yaml --- apiVersion: v1 data: ca.crt: ___redacted___ connect.json: ___redacted___ tls.crt: ___redacted___ tls.key: ___redacted___ kind: Secret metadata: name: link-go-west --- apiVersion: skupper.io/v2alpha1 kind: Link metadata: name: link-go-west spec: cost: 1 endpoints: - host: 127.0.0.1 name: inter-router port: "55671" - host: 127.0.0.1 name: edge port: "45671" tlsCredentials: link-go-west ``` -------------------------------- ### Reload Skupper Site Configuration Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command reloads the configuration for an existing Skupper site, specifically the 'west' site. It reprocesses all source Custom Resources (CRs) from the namespace path and restarts related components, preserving Certificate Authorities (CAs) to maintain existing links. ```shell system reload -n west ``` -------------------------------- ### Define Skupper West Site Custom Resource Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This YAML snippet defines a Skupper `Site` custom resource named 'west'. This resource represents a Skupper site and is a fundamental component for establishing inter-site communication. ```yaml apiVersion: skupper.io/v2alpha1 kind: Site metadata: name: west ``` -------------------------------- ### Remove Skupper Site using Skupper CLI Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/README.md This command demonstrates how to stop and remove a Skupper site using the `skupper` command-line tool. It allows specifying a target namespace; if omitted, the default namespace is used. ```shell skupper system stop -n [namespace] ``` -------------------------------- ### Access Skupper Console via OpenShift Route Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/templates/NOTES.txt Instructions to retrieve the host for the Skupper network observer console when exposed via an OpenShift Route and access it. ```Shell export ROUTE_HOST=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.host}" route {{ include "network-observer.fullname" . }}) echo "https://$ROUTE_HOST" ``` -------------------------------- ### Directory Structure for Custom Server and Client Certificates Source: https://github.com/skupperproject/skupper/blob/main/cmd/bootstrap/PROVIDED_CERTIFICATES.md This snippet shows the expected directory structure for custom server and client certificates, based on the `RouterAccess.spec.tlsCredentials` or `RouterAccess.name` field. For a `RouterAccess` named `my-router-access`, the server certificates go into `my-router-access/` and client certificates into `client-my-router-access/` within the `input/certs/` path. ```shell ${HOME}/.local/share/skupper/namespaces/default/input/certs/ ├── client-my-router-access │ ├── ca.crt │ ├── tls.crt │ └── tls.key └── my-router-access ├── ca.crt ├── tls.crt └── tls.key ``` -------------------------------- ### Apply Skupper Link Configuration to Private Site Source: https://github.com/skupperproject/skupper/blob/main/doc/tls/README.md This `kubectl` command applies the previously generated `link.yaml` file to the private Skupper site. This action establishes the connection between the public and private Skupper sites, enabling secure communication. ```kubectl kubectl apply -f link.yaml ``` -------------------------------- ### Ansible Inventory Host Definition for Skupper Test Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/hello-world/README.md Defines the 'west' and 'east' hosts in the Ansible inventory, which represent the two Kubernetes clusters used in the Skupper Hello World test. ```yaml --- all: hosts: west: east: ``` -------------------------------- ### Configure Makefile to Include New E2E Test in CI Source: https://github.com/skupperproject/skupper/blob/main/tests/README.md Instructions on how to modify the `Makefile` to include a newly created E2E test in the `ci-tests` target, allowing it to be run as part of the continuous integration pipeline. ```bash # Run a subset of tests (comma-separated list) for CI ci-tests: TESTS=hello-world,attached-connector,YOUR_TEST ``` -------------------------------- ### Run Ansible Playbook with Teardown Skipped Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/attached-connector/README.md This command executes the Ansible playbook `test.yml` using the specified inventory file `inventory/hosts.yml`. The `-e "skip_teardown=true"` flag ensures that created resources are not removed after the test completes, allowing for post-test examination and debugging. ```bash ansible-playbook test.yml -i inventory/hosts.yml -e "skip_teardown=true" ``` -------------------------------- ### Access Skupper Console via ClusterIP with Port Forwarding Source: https://github.com/skupperproject/skupper/blob/main/charts/network-observer/templates/NOTES.txt Command to temporarily expose the Skupper network observer application externally using kubectl port-forward when it's exposed as a ClusterIP service. ```Shell kubectl --namespace {{ .Release.Namespace }} port-forward service/{{ include "network-observer.fullname" . }} 8443:{{ .Values.service.port }} ``` -------------------------------- ### Expose Backend Service in East Skupper Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Exposes the 'backend' service running on port '8080' within the 'east' Skupper site. This makes the backend service accessible to other linked Skupper sites, allowing the frontend to consume it remotely. ```skupper skupper connector create backend 8080 -n east ``` -------------------------------- ### Redeem Skupper Access Token in East Site Source: https://github.com/skupperproject/skupper/blob/main/cmd/skupper/README.md Redeems the previously issued access token ('my-token.yaml') in the Skupper site in the 'east' namespace. This action establishes a secure, bidirectional link between the 'west' and 'east' Skupper sites, enabling cross-namespace service communication. ```skupper skupper token redeem ~/my-token.yaml -n east ``` -------------------------------- ### Check Skupper Site Status Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/attached-connector/README.md These commands check the current status of Skupper sites in different namespaces (`e2e-iperf3-hub`, `e2e-iperf3-client`, `e2e-iperf3-workload`). This helps verify if Skupper is running and connected correctly in each site, which is crucial for troubleshooting connectivity issues. ```bash skupper status -n e2e-iperf3-hub skupper status -n e2e-iperf3-client skupper status -n e2e-iperf3-workload ``` -------------------------------- ### Ansible Role Variables for `ansible-run_curl` Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/collections/ansible_collections/e2e/tests/roles/run_curl/README.md This section details the configurable variables for the `ansible-run_curl` role, including both required and optional parameters. These variables control the Kubernetes namespace, the container image used for the curl pod, the target address for the HTTP request, and retry logic for both pod deployment and curl command execution. ```APIDOC Role Variables: Required: namespace_prefix: Type: string Description: Prefix for the namespace name namespace_name: Type: string Description: Base name of the namespace run_curl_image: Type: string Description: Container image to use for the curl pod (e.g., quay.io/skupper/lanyard) run_curl_address: Type: string Description: URL or endpoint to curl (e.g., backend:8080/api/hello) namespace: Type: string Description: Auto-generated full namespace name (namespace_prefix-namespace_name) Optional: pod_retries: Type: integer Default: 10 Description: Number of retries for pod deployment pod_delay: Type: integer Default: 10 Description: Delay in seconds between pod deployment retries curl_retries: Type: integer Default: 5 Description: Number of retries for curl command curl_delay: Type: integer Default: 5 Description: Delay in seconds between curl command retries ``` -------------------------------- ### Global Ansible Variables for Skupper HA Test Source: https://github.com/skupperproject/skupper/blob/main/tests/e2e/scenarios/ha/README.md Defines global configuration parameters used across the Skupper HA test playbook, including connection type, user, debug mode, Locust runtime duration, namespace prefix, and a flag for namespace cleanup. ```YAML ansible_connection: local ansible_user: "{{ lookup('env', 'USER') }}" debug: false locust_runtime: "2m" namespace_prefix: "e2e" generate_namespaces_namespace_label: "ha" remove_namespaces: true ```