Skip to main content

Validation Rules

Purpose: For platform engineers, provides all schema constraints, business rules, and provider-specific checks.

Validation Layers

opencenter cluster validate runs three layers of checks in order:

  1. Schema validation — JSON Schema constraints
  2. Business rules — cross-field logic and dependency checks
  3. Provider-specific rules — cloud provider requirements

Validation stops at the first layer that produces errors.

Schema Rules

These are enforced by the JSON Schema (schema_version: "2.0"):

RuleConstraint
schema_versionMust be "2.0"
opencenter.meta.cluster_nameRequired, lowercase alphanumeric + hyphens
opencenter.meta.organizationRequired, non-empty string
opencenter.infrastructure.providerRequired, one of: openstack, vmware, aws, kind, baremetal
opencenter.cluster.kubernetes_versionRequired, semver format (vX.Y.Z)
Node countsInteger, minimum 1
CIDR fieldsValid CIDR notation

v1 configurations are rejected with a message directing users to migrate.

Business Rules

Cross-field validations that the schema alone cannot express:

RuleDescription
Control plane count must be oddRequired for etcd quorum (1, 3, 5)
Pod CIDR must not overlap service CIDRPrevents routing conflicts
Service versions must exist in baseEnabled services must have a matching base definition
SOPS key must exist if secrets backend is sopsKey file path must resolve to an existing file
SSH key must exist for setup/bootstrapRequired for Git authentication
Cluster name uniqueness per orgNo two clusters with the same name in one org

Provider-Specific Rules

OpenStack

RuleCheck
Auth URL reachable--check-connectivity flag
Flavor exists--check-provider flag
Network/subnet exists--check-provider flag
Floating IP pool available--check-provider flag
Security groups configurable--check-provider flag

VMware

RuleCheck
vCenter reachable--check-connectivity flag
Datacenter exists--check-provider flag
Datastore has sufficient capacity--check-provider flag
Configured VM inventory is coherent--check-provider flag

Baremetal

RuleCheck
Bastion reachable--check-connectivity flag
Static node inventory valid--check-provider flag
Control-plane and worker counts match--check-provider flag

AWS

Planned Provider

AWS provider support is planned for a future release and is not available in the documented GA provider set. The validation rules below are draft specifications for the planned implementation. Documented GA providers are: OpenStack, VMware, Baremetal, and Kind.

RuleCheck
Credentials valid--check-connectivity flag
VPC/subnet exists--check-provider flag
Instance type available in region--check-provider flag

GCP

Planned Provider

GCP provider support is planned for a future release and is not available in the documented GA provider set. Documented GA providers are: OpenStack, VMware, Baremetal, and Kind.

No validation rules defined yet. GCP-specific rules will be added when the provider is implemented.

Azure

Planned Provider

Azure provider support is planned for a future release and is not available in the documented GA provider set. Documented GA providers are: OpenStack, VMware, Baremetal, and Kind.

No validation rules defined yet. Azure-specific rules will be added when the provider is implemented.

Kind

RuleCheck
Docker daemon runningAlways checked
Sufficient local resourcesWarning only

Output Formats

Text output (default) groups results by validation layer:

Schema Validation: PASS (12 checks)
Business Rules: FAIL (1 error, 2 warnings)
✗ Control plane count (2) must be odd for etcd quorum
⚠ Pod CIDR overlaps with default Docker bridge network
⚠ SSH key expires in 12 days — consider rotating

JSON output (--json) returns a structured object for CI/CD:

{
"valid": false,
"errors": [
{"layer": "business", "rule": "odd-control-plane", "message": "Control plane count (2) must be odd"}
],
"warnings": [
{"layer": "business", "rule": "cidr-overlap", "message": "Pod CIDR overlaps with Docker bridge"}
]
}

Running Validation

# Basic validation
opencenter cluster validate my-cluster

# Full validation with provider checks
opencenter cluster validate my-cluster --check-connectivity --check-provider

# CI/CD pipeline
opencenter cluster validate my-cluster --json