Skip to main content

Components Overview

Components are the fundamental building blocks of the Klarity ImageFactory ecosystem. They represent modular, versioned scripts or playbooks that execute during the image lifecycle to install software, apply configurations, or validate the final state of the machine. By leveraging a component-based architecture, ImageFactory ensures that image definitions remain consistent, reusable, and easy to maintain across different cloud providers and operating systems.

Component Types

ImageFactory distinguishes between two primary categories of components based on their scope and management:

System Components

System components are predefined modules provided by Nordcloud and managed by ImageFactory administrators. These components are shared across all customers and cover common requirements such as cloud agents, monitoring tools, and security hardening. They are rigorously tested and maintained to ensure compatibility with supported distributions.

Custom Components

Custom components are customer-specific scripts created to meet unique organizational requirements. These are private to the customer's environment and can be used to install proprietary software, join domains, or apply internal security policies. Custom components provide the flexibility needed to tailor images to specific application workloads.

Execution Stages

Components are assigned to specific stages of the image lifecycle, determining when they are executed:

  1. BUILD Stage: These components run during the image creation phase. They are responsible for the actual installation and configuration of the operating system and software. Most components, such as package installations and hardening scripts, belong to this stage.
  2. TEST Stage: These components execute after the image has been built but before it is finalized. Their purpose is to validate that the build was successful and that the system meets the required specifications. If a TEST stage component fails, the entire image build is marked as failed.

Script Provisioners

ImageFactory supports three distinct provisioners for executing component content:

ProvisionerDescriptionTarget OS
SHELLStandard Bash scripts for Linux environments.Linux
POWERSHELLPowerShell scripts for Windows environments.Windows
ANSIBLEAnsible playbooks for complex, idempotent configurations.Linux & Windows

Versioning and Immutability

Every component in ImageFactory is versioned. When the content of a component is updated, a new version is created as an immutable artifact. This ensures that existing templates pinned to a specific version remain unaffected by changes, providing a reliable audit trail and reproducible builds.

The latest version is a dynamic reference that always points to the most recently added version of the component. While convenient for development, it is often recommended to pin production templates to specific version strings to prevent unexpected changes during automated builds.

Compatibility and Selection

Components specify which cloud providers (AWS, Azure, GCP, VMware) and operating system types (Linux, Windows) they support. Additionally, components can be configured to exclude specific distributions if they are known to be incompatible.

When creating or editing an image template, users select components by their unique ID. During this selection process, the user can choose to either follow the "latest" version or pin the component to a specific, immutable version. This granular control allows for a phased rollout of component updates across different image families.

Component Lifecycle Management

The lifecycle of a component involves several states, from initial creation to version updates. Administrators and authorized users can manage these through the ImageFactory API or UI. For system components, the release process typically involves merging changes to a central repository, which triggers an automated upload of the new "latest" version and the creation of a versioned package.