An OpenShift Console plugin that provides a user-friendly interface for building custom RPM packages directly within your OpenShift cluster. Users can upload source files or specify Git repositories, configure dependencies, select target operating systems, and monitor build progress - all through the OpenShift Console.
- Source Flexibility: Build RPMs from uploaded files or Git repositories
- Multi-OS Support: Target multiple operating systems (Fedora, RHEL, CentOS, openSUSE, Ubuntu)
- Architecture Support: Build for different architectures (x86_64, aarch64, i386, armv7hl)
- Dependency Management: Specify custom package dependencies
- Custom Spec Files: Use your own RPM spec files or auto-generate them
- Build Monitoring: Real-time build status and progress tracking
- Build History: View and manage previous builds
This plugin integrates with OpenShift Pipelines (Tekton) to execute RPM builds using a dedicated pipeline that:
- Prepares Build Environment: Sets up the appropriate base container image with RPM build tools
- Fetches Sources: Downloads from Git repositories or extracts uploaded files
- Installs Dependencies: Installs specified package dependencies
- Generates Spec File: Creates RPM spec files or uses provided custom ones
- Builds RPM: Executes the RPM build process
- Publishes Artifacts: Makes built RPMs available for download
The architecture is inspired by the konflux-ci/rpmbuild-pipeline project and implements similar concepts adapted for OpenShift Console integration.
- OpenShift 4.12+ with Console dynamic plugins enabled
- OpenShift Pipelines (Tekton) installed
- Appropriate RBAC permissions for creating pipelines and managing resources
First, deploy the RPM build pipeline and required RBAC:
# Create namespace and RBAC
kubectl apply -f k8s/rbac.yaml
# Deploy Tekton pipeline
kubectl apply -f k8s/tekton-pipeline.yamlBuild the plugin:
npm install
npm run buildCreate a container image:
docker build -t your-registry/rpm-builder-plugin:latest .
docker push your-registry/rpm-builder-plugin:latestDeploy using the Helm chart:
helm install rpm-builder-plugin ./charts/openshift-console-plugin \
--set plugin.image=your-registry/rpm-builder-plugin:latest \
--set plugin.imagePullPolicy=AlwaysEnable the plugin in the OpenShift Console:
oc patch consoles.operator.openshift.io cluster \
--patch '{"spec":{"plugins":["rpm-builder-plugin"]}}' \
--type=mergeOr through the Console:
- Navigate to Administration → Cluster Settings → Configuration
- Click on Console (console.operator.openshift.io)
- Go to the Console plugins tab
- Enable "RPM Builder"
-
Navigate to RPM Builder: In the OpenShift Console, go to the "Builds" section and click "RPM Builder"
-
Configure Package Information:
- Enter package name and version
- Provide a description (optional)
-
Set Up Sources:
- File Upload: Drag and drop source files or browse to upload
- Git Repository: Provide repository URL and branch
-
Select Target System:
- Choose target operating system
- Select architecture
-
Configure Dependencies (optional):
- Add required package dependencies
- Specify additional build flags
-
Custom Spec File (optional):
- Provide your own RPM spec file
- Use placeholders like
%{name},%{version}for automatic substitution
-
Start Build: Click "Start Build" to initiate the RPM build process
-
Monitor Progress: Track build status in real-time and view build history
- Fedora: 39, 40
- Red Hat Enterprise Linux: 8, 9
- CentOS Stream: 8, 9
- openSUSE Leap
- Ubuntu LTS: 20.04, 22.04
- x86_64 (64-bit Intel/AMD)
- aarch64 (ARM 64-bit)
- i386 (32-bit Intel/AMD)
- armv7hl (ARM 32-bit)
The plugin can be configured using the following environment variables:
RPM_BUILDER_NAMESPACE: Namespace for RPM build resources (default:rpm-builder)RPM_PIPELINE_NAME: Name of the Tekton pipeline (default:rpm-build-pipeline)MAX_FILE_SIZE: Maximum file upload size in bytes (default:100MB)
You can customize the base images used for different operating systems by modifying the Tekton pipeline parameters:
# In tekton-pipeline.yaml, modify the image references:
image: registry.fedoraproject.org/fedora:39 # For Fedora 39
image: registry.access.redhat.com/ubi8/ubi:latest # For RHEL 8-
Prerequisites:
npm install
-
Start Development Server:
npm run start
-
Start Console Bridge (in another terminal):
./start-console.sh
Run the test suite:
npm run test
npm run test-cypressnpm run buildThe plugin includes a service layer (rpmBuildService) that provides:
createBuildJob(config: RPMBuildConfig): Start a new buildgetBuildJobStatus(buildId: string): Get build statuslistBuildJobs(): List all buildscancelBuildJob(buildId: string): Cancel a running buildgetBuildLogs(buildId: string): Retrieve build logs
interface RPMBuildConfig {
name: string;
version: string;
description: string;
sourceType: 'upload' | 'git';
gitRepository?: string;
gitBranch?: string;
files?: FileData[];
targetOS: string;
architecture: string;
dependencies: string[];
buildOptions: string[];
specFile?: string;
}-
Build Fails to Start:
- Check that Tekton Pipelines is installed
- Verify RBAC permissions
- Ensure the
rpm-buildernamespace exists
-
File Upload Issues:
- Check file size limits
- Verify ConfigMap creation permissions
- Ensure files are valid source code
-
Build Failures:
- Review build logs in the Console
- Check spec file syntax
- Verify all dependencies are available
Enable debug logging:
kubectl set env deployment/rpm-builder-plugin LOG_LEVEL=debugView pipeline logs:
# List pipeline runs
kubectl get pipelinerun -n rpm-builder
# Get logs for a specific run
kubectl logs -f -n rpm-builder <pipelinerun-name>- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- konflux-ci/rpmbuild-pipeline - Reference RPM build pipeline architecture
- OpenShift Console Plugin Template - Base template for OpenShift Console plugins
- OpenShift Pipelines - Tekton integration for OpenShift