The image factory produces the node template that every cluster in every site boots from. If the factory is manual or inconsistent, every cluster inherits drift from its template.
This page collects the pipeline shape, versioning strategy, validation gates, and operating model for a Packer-based image factory with vSphere.
Pipeline Shape
graph LR
TRIGGER[Git Tag / Schedule] --> BUILD[Packer Build]
BUILD --> VALIDATE[Boot + Validate]
VALIDATE --> HARDEN[Apply Baselines]
HARDEN --> TEMPLATE[Convert To Template]
TEMPLATE --> TEST[Test Instance]
TEST --> PROMOTE[Promote Template]
PROMOTE --> CLEANUP[Cleanup Temp Resources]
Show Mermaid source
graph LR
TRIGGER[Git Tag / Schedule] --> BUILD[Packer Build]
BUILD --> VALIDATE[Boot + Validate]
VALIDATE --> HARDEN[Apply Baselines]
HARDEN --> TEMPLATE[Convert To Template]
TEMPLATE --> TEST[Test Instance]
TEST --> PROMOTE[Promote Template]
PROMOTE --> CLEANUP[Cleanup Temp Resources]
Template Versioning
Date-based versioning works for node templates because consumers (cluster autoscaler, Terraform modules) select images by a version string, not by semantic compatibility:
ubuntu-2204-v2026.06.01
ubuntu-2404-v2026.05.15
The version is the build date. If a build fails validation, the previous version remains current. Rollback is selecting the previous date tag.
A current marker (e.g., folder or tag) is updated on each successful promotion. Consumers reference current and get the latest verified template.
Build Image Source
The base image for Packer builds is a minimal OS ISO, not a previous template build. This avoids accumulating configuration drift across template generations.
Each build:
- Mounts the OS ISO via vSphere.
- Runs automated OS installation (autoinstall or kickstart).
- Applies baseline configuration (agents, security policies, kernel parameters).
- Hardens the image (remove unused packages, apply STIG or CIS baseline).
- Converts to a vSphere template.
- Boots a test instance from the template.
- Runs validation checks against the test instance.
- Promotes the template to production folders.
Validation Gates
A build that fails any gate does not become a template:
| Gate | Check |
|---|---|
| Boot | VM boots and is reachable via SSH within timeout |
| Kernel | Expected kernel version and parameters |
| Networking | Correct interface names, DNS resolution, NTP sync |
| Agents | Required agents installed and running (VMTools, monitoring, security) |
| Storage | iSCSI initiator configured and can reach targets |
| Containerd | Installed and responds to ctr version |
| CIS/STIG | Baseline security checks pass |
| Cleanup | No build artifacts, SSH host keys rotated |
Cross-Site Distribution
If the image factory serves multiple vSphere sites, each site should have a local copy of the template:
- Build in the central vSphere instance.
- Clone the template to each site’s vSphere.
- Verify the cloned template boots and passes validation in each site.
- Update the site-local
currentpointer.
Site-local templates protect against vSphere link latency and provide a fallback if the central vSphere is unavailable.
Operating Model
| Activity | Cadence |
|---|---|
| OS patch release | Build within 5 business days |
| CVSS 9+ kernel fix | Build within 24 hours |
| Agent version update | Build on request |
| Template refresh (no changes) | Monthly |
| Rollback drill | Quarterly |
| Site template validation | Weekly |
Acceptance Criteria
- Every cluster node boots from a versioned, validated template.
- Template versions are traceable to a pipeline run and a Git commit.
- CIS/STIG baseline checks pass on every build.
- Site-local templates are independently validated.
- Rollback is selecting the previous date tag and rerunning the site distribution step.