Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Ephemeral OpenShift clusters in Konflux CI using the Cluster-as-a-Service operator

October 28, 2024
Alex Misstear Ali Mobrem
Related topics:
Automation and managementCI/CDContainersDeveloper ProductivityHelmKubernetesOperators
Related products:
Red Hat OpenShiftRed Hat OpenShift Service on AWS

Share:

    At Red Hat our engineers leverage the capabilities of Konflux-CI to orchestrate and execute integration tests against their applications, services and products. An integral part of testing these offerings involves installing them on a Red Hat OpenShift cluster.

    What is Konflux?

    Konflux is a continuous integration/continuous delivery (CI/CD) service that simplifies the adoption of the processes, technologies, and expertise that Red Hat uses to build, test, and release production software. Delivering a secure software supply chain is the primary mission of Konflux. It provides default pipeline definitions and automated security checks to generate Supply chain Levels for Software Artifacts (SLSA) Level 3 build images from application code across a variety of programming languages. Build images are composed into Snapshots and passed to integration test pipelines on their journey towards being released.

    Challenges

    In regards to testing, many of Red Hat's development teams require administrative access to a Red Hat OpenShift cluster to verify their operator lifecycle manager (OLM) operators. Due to limited cluster access, engineers typically get stuck trying to onboard their tests. They also commonly lack accounts or permissions necessary to host the platform. Support tickets usually ensue and the onboarding experience turns into a multi-day ordeal. To resolve this common inefficiency, we started looking at ways to quickly provide OpenShift clusters to the CI workflows used by our engineers and their teams on demand. We wanted to provide this as a service to satisfy the majority of the testing requirements shared across teams. The necessary cloud or infra credentials would ideally be provided by administrators of Konflux but protected with guardrails.

    What provides such a service? Enter the Cluster-as-a-Service Operator (CaaS).

    CaaS Operator

    The CaaS Operator allows us to:

    • Grant our unprivileged users access to request instances of a cluster template using Kubernetes custom resources.
    • Leverage Argo CD and Helm charts to manage and deploy the clusters.
    • Configure quotas to restrict the number of active template instances globally and per namespace.
    • Provide a self-service option for users to use our templates but bring their own credentials for provisioning cluster instances and infrastructure.

    We began developing our cluster template Helm Charts with HyperShift in mind and deferred provisioning with Hive to our backlog. Our first chart, hypershift-aws-template, uses hooks to trigger and wait for Jobs which either create or destroy the ephemeral cluster. We use the HyperShift command-line interface (CLI) since it’s capable of provisioning the Amazon Web Services (AWS) infrastructure, identity access management (IAM), and cluster resources all from a single binary. The chart is quite generic so feel free to try it out. Review the Git repository documentation for instructions about prerequisites and execution.

    The chart is referenced from a ClusterTemplate in our cluster-as-a-service component. Browse our repo for examples showing how Red Hat configures the CaaS operator as well as Konflux generally. Our manifests are built with Kustomize and deployments are managed with Argo CD as provided by the Red Hat OpenShift GitOps operator.

    Ephemeral clusters

    In our infrastructure, we operate our HyperShift management clusters with a publicly routable API server (to satisfy the requirements for communication between nodes and the control plane). Auto scaling is enabled on the HyperShift management cluster so compute resources are dynamically added as more control planes for the ephemeral cluster are provisioned. ROSA with hosted control planes (HCP) makes for a great (development or production) option for this cluster since our template already requires access to an AWS account and it’s recommended to use control planes and worker nodes within the same cloud provider.

    Konflux uses Tekton Pipelines for CI workloads. We developed a series of convenient StepActions our users can mix and match in their Pipelines/PipelineRuns as needed. They can be used to (among other things):

    • Pick a version of OpenShift to provision.
    • Provision an ephemeral HyperShift cluster.
    • Retrieve the credentials for an ephemeral cluster.

    Take a look at a sample cluster provisioning pipeline or a simple Operator deployment test to see how it all comes together for the user.

    One of these StepActions creates a ClusterTemplateInstance on the management cluster which kick starts the provisioning process. From there the step waits for the cluster to become available. The entire process typically takes 10-20 minutes. Out-of-band deletion of the ClusterTemplateInstance triggers deletion of the cluster but we’ve also configured automatic deletion of the ClusterTemplateInstance via the ClusterTemplate spec. This provides additional assurances that there shouldn’t be orphaned cluster resources uncontrollably increasing our cloud expenses.

    Future plans

    We’re just getting started with providing this service on top of Konflux. Our users are already appreciating its low barrier for entry and multiarch (amd64, arm64) support from HyperShift out of the gate. Additional enhancements to our cluster templates are already being planned, so follow our activity on GitHub for the latest updates.

    Related Posts

    • The present and future of CI/CD with GitOps on Red Hat OpenShift

    • GitOps: Stop, collaborate and deploy

    • Why should developers care about GitOps?

    • How to apply machine learning to GitOps

    Recent Posts

    • Assessing AI for OpenShift operations: Advanced configurations

    • OpenShift Lightspeed: Assessing AI for OpenShift operations

    • OpenShift Data Foundation and HashiCorp Vault securing data

    • Axolotl meets LLM Compressor: Fast, sparse, open

    • What’s new for developers in Red Hat OpenShift 4.19

    What’s up next?

    Learn how to navigate the complex world of modern container-based software development and distribution with Getting GitOps: A Practical Platform with OpenShift, Argo CD, and Tekton.

    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    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

    Red Hat legal and privacy links

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

    Report a website issue