This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Kubernetes/OpenShift configuration management repository for Red Hat's Managed OpenShift Services (OpenShift Dedicated and ROSA). It maintains static configuration that gets deployed to managed clusters through Red Hat's Hive cluster management system using a GitOps approach.
# Generate all templates for all environments
make
# Generate templates for specific environment
make integration # or 'stage', 'production'
# Run in container (recommended for consistency)
make container-build
# Generate ACM policies
make policies
# Validate all configurations
make validate# Validate configurations using OpenShift CLI
oc apply --dry-run=client -f /path/to/config.yaml
# Run backplane rules enforcement
python scripts/enforce-backplane-rules.py
# Check links in documentation
make check-links/deploy: Source of truth containing 100+ component directories with raw YAML configurations/hack: Generated Hive templates for different environments (integration/stage/production)/scripts: Python build automation scripts for template generation and validation/resources: Shared resource templates and Prometheus rules/source: HTML templates for OAuth branding customization
Every directory in /deploy requires a config.yaml file with structure:
deploymentMode: "SelectorSyncSet" # or "Policy"
selectorSyncSet:
matchExpressions:
- key: api.openshift.com/product
operator: NotIn # or In
values: ["rosa"] # Product targeting
resourceApplyMode: "Sync" # or "Upsert"Raw configs (/deploy) → Template Generation → Environment templates (/hack) → Hive Deployment
- Uses Python with
oyamllibrary for YAML processing - Converts raw configurations into Hive SelectorSyncSet templates
- Supports environment-specific customization (integration/stage/production)
- Generates both deployment templates and ACM policies from same source
- OpenShift Dedicated (OSD): Standard managed OpenShift
- ROSA: Red Hat OpenShift Service on AWS with specific configurations
- FedRAMP: Government compliance configurations
- Hypershift: Hosted control plane support
Configurations use selector-based targeting:
api.openshift.com/product: Product type (rosa, osd)hive.openshift.io/cluster-platform: Cloud platform (aws, gcp, azure)api.openshift.com/fedramp: FedRAMP compliance level
- Sync: Full synchronization - removes resources not in template
- Upsert: Only creates/updates resources, never removes
- Modify configurations in
/deploydirectories - Update config.yaml if changing deployment targeting
- Run
make validateto check configuration syntax - Run
maketo generate templates and verify build - Test in integration environment before promoting to production
- Follow team ownership patterns defined in OWNERS files
- All builds run in containers for consistency
- Every
/deploysubdirectory must have aconfig.yamlfile - Template generation is automatic via GitHub Actions on push
- Configurations must pass OpenShift CLI validation
- Changes affecting production require team review per OWNERS files
- Never manually modify files with path
hack/00-osd-managed-cluster-config*.yaml.tmplordeploy/acm-policies/50-GENERATED-*.yaml, as they're generated withmake generate.
- Python 3.9 with
oyamllibrary - OpenShift CLI (oc) for validation
- Container runtime (Docker/Podman)
- Red Hat PolicyGenerator for ACM policy creation