Instructions for AI agents working on the OpenShift/Hive project.
OpenShift Hive is an operator which runs as a service on top of Kubernetes/OpenShift. The Hive service can be used to provision and perform initial configuration of OpenShift clusters.
Hive uses the OpenShift installer for cluster provisioning.
- AWS
- Azure
- Google Cloud Platform (GCP)
- IBM Cloud
- Nutanix
- OpenStack
- vSphere
- Bare Metal
The project uses make for automation. All commands should be run from the repository root.
make update # updates generated code
make build # compiles the project binaries
make clean # cleans up build artifacts
make all # runs vendor, update, test, and build in sequence
# Dependency management
make vendor # updates vendor directory
make modcheck # checks for dependency mismatches between root and submodules
make modfix # fixes dependency mismatches automaticallymake test # runs unit tests (excludes e2e tests)
make verify # verifies generated code and formattingNote: make test runs unit tests for ./pkg/..., ./cmd/..., ./contrib/..., and submodules. E2E tests are excluded and must be run separately using make test-e2e, make test-e2e-pool, etc.
apis/: API definitions (separate Go submodule)hive/v1/: Hive v1 APIs (ClusterDeployment, SyncSet, etc.)hiveinternal/v1alpha1/: Internal APIshivecontracts/v1alpha1/: Contract APIs
cmd/: Binary entry pointspkg/: Package source codeconfig/: Kubernetes YAML manifests for deploying the operatordocs/: Developer and user documentationhack/: Developer tools and scriptstest/e2e/: End-to-end tests
cmd/manager/: Main entry point for Hive controllerscmd/operator/: Main entry point for Hive operator (deploys and manages other components)cmd/hiveadmission/: Admission webhook server for CR validation
pkg/controller/: Operator controllers (see Controllers section below)pkg/install/: Installation logic and OpenShift installer integrationpkg/installmanager/: Manages cluster installation process (runs openshift-install)pkg/operator/: Hive operator logic for deploying and managing componentspkg/clusterresource/: Builds cluster resources and install configspkg/imageset/: Manages ClusterImageSet and installer image resolutionpkg/creds/: Manages cloud provider credentials for cluster provisioningpkg/resource/: Utilities for applying resources to remote clusterspkg/remoteclient/: Client for connecting to and managing remote clusterspkg/{awsclient,azureclient,gcpclient,ibmclient}/: Cloud provider-specific client implementationspkg/manageddns/: Managed DNS functionalitypkg/util/: Utility functionspkg/version/: Logic for operator version
pkg/controller/argocdregister: Ensures provisioned clusters are added to the ArgoCD cluster registrypkg/controller/awsprivatelink: Manages AWS PrivateLink configurations for clusterspkg/controller/clusterclaim: Manages ClusterClaim resources for requesting clusters from poolspkg/controller/clusterdeployment: Core controller that reconciles ClusterDeployments, orchestrating cluster provisioning and lifecyclepkg/controller/clusterdeprovision: Handles cluster deprovisioning and cleanuppkg/controller/clusterpool: Manages ClusterPools for pre-provisioning clusterspkg/controller/clusterpoolnamespace: Manages namespaces for cluster poolspkg/controller/clusterprovision: Manages ClusterProvision resources and install jobspkg/controller/clusterrelocate: Handles cluster relocation between Hive instancespkg/controller/clusterstate: Syncs cluster state from remote clusters to ClusterDeployment statuspkg/controller/clustersync: Applies SyncSets and SelectorSyncSets to provisioned clusterspkg/controller/clusterversion: Manages cluster version updatespkg/controller/controlplanecerts: Manages control plane certificatespkg/controller/dnsendpoint: Manages DNS endpoints for clusterspkg/controller/dnszone: Manages DNS zones for cluster domainspkg/controller/fakeclusterinstall: Manages FakeClusterInstall resources for testing agent-based installationspkg/controller/hibernation: Handles cluster hibernation and resumptionpkg/controller/machinepool: Manages MachinePools for worker nodespkg/controller/metrics: Calculates and publishes Prometheus metricspkg/controller/privatelink: Manages PrivateLink configurations acr oss cloud providerspkg/controller/remoteingress: Manages ingress configurations for remote clusterspkg/controller/syncidentityprovider: Syncs identity providers to provisioned clusterspkg/controller/unreachable: Handles unreachable cluster scenariospkg/controller/velerobackup: Manages Velero backups for clusters
All commits should follow a standard format to ensure clarity and traceability.
- Title format:
<Subsystem>: <Title> - Include a footer annotation when AI tools were used to generate or significantly assist
HIVE-2980: How to refresh ClusterPool cloud creds
Add doc content describing different ways to rotate a ClusterPool's
cloud credentials.
Add a script, `hack/refresh-clusterpool-creds.sh` to nondisruptively
update the (currently AWS; other platforms TODO) cloud credentials for
all existing ClusterDeployments associated with a given ClusterPool.
- Accepts two args: the clusterpool namespace and name.
- Discovers the current AWS creds Secret from the clusterpool.
- Discovers all existing ClusterDeployments associated with the
clusterpool.
- Discovers the AWS creds Secret for each CD.
- Patches that Secret with the `.data` of the clusterpool's Secret.
Assisted-by: <AI Model Name>