lifecycle-agent

module
v0.0.0-...-35da50e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0

README

Lifecycle Agent Operator

Go Report Card Go Reference License Apache

Overview

The Lifecycle Agent (LCA) Operator provides local, on-cluster lifecycle management for Single Node OpenShift (SNO) clusters. It performs image-based upgrades by pivoting between OSTree stateroots, enabling fast, reliable major-version upgrades with automatic rollback on failure. A seed image captured from a reference SNO is used to build the target stateroot, and OADP/Velero backup-restore preserves application and platform state across the upgrade.

Key Features

  • Image-based upgrades via OSTree stateroot pivoting
  • Seed image generation from a running SNO cluster
  • OADP-based backup/restore of cluster and application state
  • IP configuration management during upgrades
  • Automatic rollback on upgrade failure or timeout
  • Container image pre-caching to reduce upgrade downtime
  • USB image scaffolding through lca-cli create-usb, which currently creates a nonbootable partitioned .img for the image-based install workflow

Custom Resource Definitions

All CRDs are cluster-scoped singletons under lca.openshift.io/v1:

CRD Singleton Name Description
ImageBasedUpgrade upgrade Manages the upgrade lifecycle through stages
SeedGenerator seedimage Triggers seed image creation from a running SNO
IPConfig ipconfig Manages IP configuration changes during upgrades

Upgrade Lifecycle

The ImageBasedUpgrade controller implements a stage-based state machine:

Idle → Prep → Upgrade → Rollback

  • Idle — Default state; cleanup of previous upgrade artifacts
  • Prep — Pulls the seed image, sets up a new OSTree stateroot, and optionally pre-caches container images
  • Upgrade — Takes OADP backups, pivots to the new stateroot, restores backups, and reconfigures the cluster
  • Rollback — Reverts to the previous stateroot if the upgrade fails or is manually triggered

Getting Started

Prerequisites
  • Go 1.26.3 or newer (see go.mod)
  • Access to an OpenShift SNO cluster
  • oc or kubectl configured with cluster-admin privileges
Build
make build       # Build the operator binary (bin/manager)
make cli-build   # Build the on-node CLI binary (bin/lca-cli)
Deploy
make install deploy IMG=<image>   # Install CRDs and deploy the operator
make bundle-run                   # Deploy via OLM
Test & Lint
make unittest    # Run unit tests with coverage
make ci-job      # Full CI pipeline (generate, fmt, vet, lint, test)

Documentation

Contributing

See DEVELOPING.md for development setup, testing, and contribution guidelines.

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

Directories

Path Synopsis
api
backupcontent/v1
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
imagebasedupgrade/v1
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
ipconfig/v1
Package v1 contains API Schema definitions for the lca.openshift.io v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
Package v1 contains API Schema definitions for the lca.openshift.io v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
seedgenerator/v1
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
Package v1 contains API Schema definitions for the lca v1 API group +kubebuilder:object:generate=true +groupName=lca.openshift.io
Code generated by MockGen.
Code generated by MockGen.
internal
backuprestore
This file previously contained the OADP/Velero restore implementation.
This file previously contained the OADP/Velero restore implementation.
backuprestore/mocks
Code generated by MockGen.
Code generated by MockGen.
clusterconfig/mocks
Code generated by MockGen.
Code generated by MockGen.
extramanifest
nolint
nolint
extramanifest/mocks
Code generated by MockGen.
Code generated by MockGen.
generated
Code generated for package generated by go-bindata DO NOT EDIT.
Code generated for package generated by go-bindata DO NOT EDIT.
ibistatus
Package ibistatus provides the shared machine-readable result record and the durable write-back + powered-on halt helpers for the post-pivot reconfigure phase of a USB-based IBI.
Package ibistatus provides the shared machine-readable result record and the durable write-back + powered-on halt helpers for the post-pivot reconfigure phase of a USB-based IBI.
imagemgmt
Code generated by MockGen.
Code generated by MockGen.
networkpolicies
Package networkpolicies handles the creation and management of NetworkPolicies.
Package networkpolicies handles the creation and management of NetworkPolicies.
ostreeclient
Code generated by MockGen.
Code generated by MockGen.
reboot
Code generated by MockGen.
Code generated by MockGen.
reconfigure
Package reconfigure holds the durable handoff the self-contained post-pivot writes for the reconfigure result-writer (CNF-27173).
Package reconfigure holds the durable handoff the self-contained post-pivot writes for the reconfigure result-writer (CNF-27173).
cmd
createusb
Package createusb implements the manifest schema and build-time validation for the `lca-cli create-usb` subcommand (USB-based IBI).
Package createusb implements the manifest schema and build-time validation for the `lca-cli create-usb` subcommand (USB-based IBI).
localimages
Package localimages imports container images from a mounted OCI image layout directly into a target containers-storage store, under their canonical name-by-digest, with no registry and no registries.conf reference rewriting.
Package localimages imports container images from a mounted OCI image layout directly into a target containers-storage store, under their canonical name-by-digest, with no registry and no registries.conf reference rewriting.
ops
Code generated by MockGen.
Code generated by MockGen.
ostreeclient
Code generated by MockGen.
Code generated by MockGen.
lca-cli command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL