lifecycle-agent

module
v0.0.0-...-7e6bf87 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 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

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:

IdlePrepUpgradeRollback

  • 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.24+
  • 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
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/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.
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.
cmd
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