Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Use Skupper to connect multiple Kubernetes clusters

April 20, 2021
Praveen Kumar
Related topics:
ContainersKubernetesMicroservices
Related products:
Red Hat OpenShift

    Skupper is a Layer 7 service interconnect that enables multicloud communication across Kubernetes clusters. There are a few reasons you might need to communicate between a local cluster and a remote one in development:

    • A service is deployed on the remote cluster, and you want to consume it with a local cluster.
    • A workload is high resource-consuming, and it is not feasible to deploy it on the local cluster given the available resources.
    • An existing stage/test database service is deployed on a remote cluster, and your workload needs to connect to it.

    One of the best things about Skupper is that users don’t need to have admin privileges for the cluster to deploy it. See the article Skupper.io: Let your services communicate across Kubernetes clusters for more information about the open source project.

    This article will show you how to use Skupper to connect a remote cluster service with a local cluster using Red Hat CodeReady Containers and the Developer Sandbox for Red Hat OpenShift. For a more detailed overview, refer to the Skupper getting started guide.

    About the example

    In this example, I am using Red Hat CodeReady Containers (CRC) for my local cluster. CodeReady Containers is a developer tool that lets you create local Kubernetes clusters on Red Hat OpenShift 4. I have another cluster from the Developer Sandbox for Red Hat OpenShift that I can access from anywhere.

    Step 1: Install the Skupper command-line tool

    First, install the Skupper command-line tool on your Linux system.

    Note: If you are using a different platform, refer to the instructions in the getting started guide.

    $ curl -fL https://github.com/skupperproject/skupper/releases/download/0.3.2/skupper-cli-0.3.2-linux-amd64.tgz | tar -xzf -
    
    $ sudo mv skupper /usr/local/bin
    
    $ which skupper 
    /usr/local/bin/skupper
    
    $ skupper --version
    skupper version 0.3.2
    

    Step 2: Configure access to multiple namespaces

    As the getting started guide describes, the skupper command uses the kubeconfig file and the current context to select the namespace where it operates. You must use a distinct kubeconfig or context for each namespace, so it’s best to use different console terminals, tabs, or sessions.

    Start a console session for each namespace and log in to your clusters.

    CodeReady Containers console:

    $ export KUBECONFIG=$HOME/.kube/config-crc
    
    $ oc login -u developer -p developer https://api.crc.testing:6443
    Login successful.
    
    $ oc config get-contexts
    CURRENT   NAME                              CLUSTER                AUTHINFO    NAMESPACE
    *         /api-crc-testing:6443/developer   api-crc-testing:6443   developer
    

    Developer Sandbox console:

    $ export KUBECONFIG=$HOME/.kube/config-devsandbox
    
    $ oc login --token=<token> --server=https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443
    Logged into "https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443" as "prkumar" using the token provided.
    You have access to the following projects and can switch between them with ' project <projectname>':
    * prkumar-code
    prkumar-dev
    prkumar-stage
    
    $ oc config get-contexts
    CURRENT   NAME                                                                 CLUSTER                                         AUTHINFO   NAMESPACE
    *         prkumar-code/api-sandbox-m2-ll9k-p1-openshiftapps-com:6443/prkumar   api-sandbox-m2-ll9k-p1-openshiftapps-com:6443   prkumar    prkumar-code
    

    Next, create a new project on CodeReady Containers. For this demo's purposes, we’ll use prkumar-code as the default context for the Developer Sandbox side because we don’t have permission to create a new project.

    CodeReady Containers console:

    $ oc new-project demo
    Now using project "demo" on server "https://api.crc.testing:6443".
    

    Step 3: Install the Skupper router in each namespace

    Run the skupper init command to install the router in each namespace.

    CodeReady Containers console:

    $ skupper init --cluster-local
    Skupper is now installed in namespace 'demo'.  Use 'skupper status' to get more information.

    Developer Sandbox console:

    $ skupper init
    Skupper is now installed in namespace 'prkumar-code'.  Use 'skupper status' to get more information.

    Now, check if the route is successfully installed.

    CodeReady Containers console:

    $ skupper status
    Skupper is enabled for namespace "prkumar-code" in interior mode. It is not connected to any other sites. It has no exposed services.
    

    Step 4: Connect your namespaces

    Generate the connection token.

    Developer Sandbox console:

    $ skupper connection-token $HOME/secret.yaml
    Connection token written to /home/prkumar/secret.yaml
    

    Then, use the token to connect to your CRC cluster.

    CodeReady Containers console:

    $ skupper connect $HOME/secret.yaml
    Skupper configured to connect to skupper-inter-router-prkumar-code.apps.sandbox-m2.ll9k.p1.openshiftapps.com:443 (name=conn1)

    Step 5: Expose your front-end and back-end services

    Here we will use a back-end and a front-end service, as mentioned in the getting started guide. First, we will deploy the back-end service on the Developer Sandbox and the front-end service to CRC. Then, we’ll connect the back end with the front end.

    CodeReady Containers console:

    $ oc  create deployment hello-world-frontend --image quay.io/skupper/hello-world-frontend
    deployment.apps/hello-world-frontend created
    

    Developer Sandbox console:

    $ oc create deployment hello-world-backend --image quay.io/skupper/hello-world-backend
    deployment.apps/hello-world-backend created
    

    Use the skipper expose command to expose the back-end service so it will be available on your CRC cluster.

    Developer Sandbox console:

    $ skupper expose deployment hello-world-backend --port 8080 --protocol http

    As you can see, once you expose a service using Skupper, it is visible to the CRC cluster.

    CodeReady Containers console:

    $ oc get svc
    NAME                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)               AGE
    
    hello-world-backend   ClusterIP   10.217.5.209   <none>        8080/TCP              96s
    

    Finally, test your front-end application to verify it can communicate with the back-end service.

    CodeReady Containers console:

    $ oc expose deployment hello-world-frontend --port 8080
    service/hello-world-frontend exposed
    
    $ oc expose svc hello-world-frontend
    route.route.openshift.io/hello-world-frontend exposed
    
    $ curl hello-world-frontend-demo.apps-crc.testing
    I am the frontend.  The backend says 'Hello from hello-world-backend-7dfb45b98d-j8q8t (2)'.
    

    Conclusion

    As we saw in this article, Skupper comes in handy when two clusters need to be connected, and CodeReady Containers provides a great local experience for OpenShift. Happy Skuppering!

    Last updated: February 5, 2024

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.