This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Certman Operator is a Kubernetes operator that automates provisioning and management of TLS certificates from Let's Encrypt for OpenShift Dedicated clusters. It works with Hive to watch ClusterDeployment resources and manages CertificateRequest custom resources.
# Default build and test
make # Runs go-check, go-test, go-build
# Individual commands
make go-build # Build the operator binary
make go-test # Run unit tests with envtest
make go-check # Run golangci-lint static analysis
make test # Run unit tests (alias for go-test)
make lint # Run linting and YAML validation# Generate code and manifests
make generate # Generate CRDs, code, and manifests
make op-generate # Generate CRDs only
make go-generate # Generate Go code only
# Validation
make validate # Ensure code generation is up-to-date
make generate-check # Check if generated files are current
# Local testing
hack/test/local_test.sh # Automated local testing with minikube
# Run operator locally (requires proper secrets and config)
WATCH_NAMESPACE="certman-operator" OPERATOR_NAME="certman-operator" go run main.go# Build container images
make docker-build # Build operator image
make docker-push # Build and push operator image
# For macOS developers (cross-compile)
make go-mac-build # Build for Linux on macOS- ClusterDeployment Controller (
controllers/clusterdeployment/): Watches Hive's ClusterDeployment CRDs and creates CertificateRequest resources when clusters are installed - CertificateRequest Controller (
controllers/certificaterequest/): Manages the Let's Encrypt certificate lifecycle using DNS-01 challenges - API Types (
api/v1alpha1/): CertificateRequest CRD definition
pkg/leclient/: Let's Encrypt ACME client implementationpkg/clients/: Cloud provider clients (AWS Route53, GCP, Azure DNS)pkg/localmetrics/: Prometheus metrics for certificate operationspkg/acmeclient/: ACME protocol client wrapper
- Hive: Required for ClusterDeployment CRDs and cluster management
- Let's Encrypt: Certificate authority for TLS certificates
- Cloud DNS: AWS Route53, GCP DNS, or Azure DNS for DNS-01 challenges
- Watches ClusterDeployment resources with
Installed: true - Creates CertificateRequest for each certificate bundle in the cluster spec
- Performs Let's Encrypt DNS-01 challenge via cloud DNS providers
- Stores issued certificates in secrets for Hive to sync to target clusters
- Monitors certificate expiry and renews 45 days before expiration
lets-encrypt-account: Let's Encrypt account private key and URLaws/gcp: Cloud provider credentials for DNS challenge (platform-dependent)
certman-operator: Containsdefault_notification_email_addressfor Let's Encrypt notifications
WATCH_NAMESPACE: Namespace to watch for resourcesOPERATOR_NAME: Name of the operator instanceEXTRA_RECORD: Additional SAN record for control plane certificates
- Uses envtest for Kubernetes API testing
- Test targets defined in
TESTTARGETSvariable - Coverage reporting available via
make coverage
hack/test/local_test.shprovides automated minikube-based testing- Creates test cluster, installs dependencies, builds/deploys operator
- Uses spoofed ClusterDeployment to trigger certificate generation
- Requires proper Let's Encrypt account secrets
- Can be deployed to staging clusters for integration testing
- See README manual deployment section for fleet testing procedures