Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,128 changes: 3,128 additions & 0 deletions docs-cms/memos/MEMO-036-kubernetes-operator-development.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions docusaurus/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,105 @@ Quick access to recently updated documentation. Changes listed in reverse chrono

## Recent Changes

### 2025-10-17
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog date '2025-10-17' is in the future (October 2025). This should likely be '2024-10-17' or the current date.

Suggested change
### 2025-10-17
### 2024-10-17

Copilot uses AI. Check for mistakes.

#### Prism Kubernetes Operator - Polish Pass, KEDA Integration, and Installation Guide (NEW)
**Links**: [prism-operator](https://github.com/jrepp/prism-data-layer/tree/main/prism-operator), [CHANGELOG.md](https://github.com/jrepp/prism-data-layer/blob/main/prism-operator/CHANGELOG.md), [QUICK_START.md](https://github.com/jrepp/prism-data-layer/blob/main/prism-operator/QUICK_START.md), [KEDA_INSTALL_GUIDE.md](https://github.com/jrepp/prism-data-layer/blob/main/prism-operator/KEDA_INSTALL_GUIDE.md)

**Summary**: Completed comprehensive polish pass on Kubernetes operator and added full KEDA integration with optional installer:

**Polish Pass Improvements**:
- **KEDA Error Handling**: Fixed graceful degradation when KEDA CRDs not installed
- Added `isKEDANotInstalledError()` helper function detecting missing KEDA CRDs
- Changed log level from ERROR to INFO for missing KEDA scenarios
- Applied handling to all KEDA reconciliation paths (Get, Create, Delete)
- Operator deploys patterns successfully without autoscaling when KEDA unavailable
- **Enhanced Status Tracking**: Comprehensive PrismPattern status updates
- Three-phase lifecycle: `Pending` → `Progressing` → `Running`
- Replica count tracking (`replicas`, `availableReplicas`)
- Kubernetes Conditions with detailed messages including replica counts
- ObservedGeneration tracking
- Better deployment not found handling
- **Improved Logging**: All reconciliation steps logged appropriately
- KEDA missing CRDs: INFO level (not ERROR)
- Status updates: DEBUG/INFO with details
- Better error context in messages

**KEDA Integration** (Complete):
- **Optional KEDA Installer**: `scripts/install-keda.sh` with full lifecycle management
- Multiple installation methods: Helm (default) or YAML manifests
- Version control (default: 2.12.1) and namespace customization
- Automatic verification of CRDs, deployments, and readiness
- Graceful upgrade support detecting existing installations
- Clean uninstall with CRD cleanup
- Status checking with version and pod information
- **Operator KEDA Support**: Full event-driven autoscaling integration
- KEDA scheme registration in manager (kedav1alpha1.AddToScheme)
- Support for 60+ KEDA scalers (Kafka lag, RabbitMQ queue depth, AWS SQS, etc.)
- ScaledObject creation and lifecycle management
- CPU trigger example for simple testing
- Automatic cleanup when switching between HPA and KEDA
- **Makefile Targets**: Organized installation and management
- `local-install-metrics`: Install metrics-server only (HPA support)
- `local-install-keda`: Install KEDA only (event-driven autoscaling)
- `local-install-deps`: Install both metrics-server + KEDA
- `local-uninstall-keda`: Uninstall KEDA
- `local-keda-status`: Show KEDA installation status
- Docker Desktop TLS patch for metrics-server compatibility

**Documentation**:
- **CHANGELOG.md**: Complete project changelog with versioning
- Unreleased features (KEDA, status updates, graceful degradation)
- Initial release (v0.1.0) summary
- Known limitations and migration guidance
- **QUICK_START.md**: 5-minute getting started guide
- Installation steps (CRDs, dependencies, operator)
- Example patterns (basic, HPA, KEDA)
- Status tracking and verification
- Autoscaling options comparison (HPA vs KEDA)
- Cleanup procedures
- Complete Makefile command reference
- Production-ready example pattern
- Troubleshooting guide
- Architecture diagram
- **KEDA_INSTALL_GUIDE.md**: Comprehensive KEDA installation guide
- Quick start commands
- Installation script usage (all options)
- What gets installed (operator, metrics server, admission controller, CRDs)
- Using KEDA with Prism operator (examples)
- Verification steps
- Troubleshooting (KEDA not found, operator issues, ScaledObject problems)
- Docker Desktop specific notes
- Advanced configuration (custom versions, namespaces, Helm values)
- Supported scalers (60+ with link to KEDA docs)
- Production considerations (HA, resource limits, monitoring)

**Test Results**:
- ✅ Basic reconciliation: PrismPattern, Deployment, Service created successfully
- ✅ Status updates: Phase correctly set (Pending → Progressing → Running)
- ✅ KEDA graceful degradation: No errors when KEDA not installed
- ✅ KEDA integration: ScaledObject created successfully with CPU trigger
- ✅ Cleanup path: Cascade deletion works correctly (owner references)
- ✅ KEDA installation: Installed via YAML method in <60 seconds
- ✅ All resources verified: prismpattern, deployment, service, scaledobject

**Key Innovation**: KEDA integration is truly optional - operator gracefully handles absence of KEDA CRDs with informative logging instead of errors. Installation script provides production-ready KEDA deployment with comprehensive verification and lifecycle management. Status tracking provides Kubernetes-native observability with three-phase lifecycle and detailed conditions.

**Impact**: Prism operator now supports both HPA (CPU/memory) and KEDA (event-driven) autoscaling with seamless switching. KEDA installer enables Docker Desktop developers to test event-driven autoscaling locally without complex setup. Graceful degradation ensures patterns deploy successfully regardless of autoscaling availability. Enhanced status tracking provides operational visibility matching Kubernetes best practices. Documentation provides clear path from 5-minute quick start to production deployment.

**Files Modified**:
- `prism-operator/Makefile` - Split metrics-server and KEDA targets
- `prism-operator/cmd/manager/main.go` - Added KEDA scheme registration
- `prism-operator/controllers/prismpattern_controller.go` - Enhanced status updates
- `prism-operator/pkg/autoscaling/keda.go` - Fixed graceful degradation
- `prism-operator/scripts/install-keda.sh` - **NEW** full KEDA installer
- `prism-operator/CHANGELOG.md` - **NEW** project changelog
- `prism-operator/QUICK_START.md` - **NEW** getting started guide
- `prism-operator/KEDA_INSTALL_GUIDE.md` - **NEW** KEDA installation guide
- `prism-operator/config/samples/test-keda-simple.yaml` - **NEW** KEDA test example

---

### 2025-01-16

#### ADR-058: Proxy Drain-on-Shutdown for Graceful Termination (NEW)
Expand Down
116 changes: 116 additions & 0 deletions prism-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Changelog

All notable changes to the Prism Kubernetes Operator will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- **KEDA Integration**: Full support for KEDA (Kubernetes Event-Driven Autoscaling)
- Optional KEDA installer script (`scripts/install-keda.sh`)
- Automatic KEDA scheme registration in operator
- Support for 60+ KEDA scalers (Kafka, RabbitMQ, NATS, AWS SQS, etc.)
- Example patterns with KEDA configuration
- Makefile targets for KEDA management (`local-install-keda`, `local-uninstall-keda`, `local-keda-status`)

- **Enhanced Status Tracking**: Comprehensive PrismPattern status updates
- Three-phase lifecycle: `Pending` → `Progressing` → `Running`
- Replica count tracking (`replicas`, `availableReplicas`)
- Kubernetes Conditions with detailed messages
- ObservedGeneration tracking

- **Graceful Degradation**: Operator handles missing dependencies elegantly
- Informative logging when KEDA CRDs are not installed (INFO level, not ERROR)
- Patterns deploy successfully without autoscaling when KEDA is unavailable
- Comprehensive error detection using both type assertions and string matching

- **Installation Script**: Production-ready KEDA installer
- Multiple installation methods: Helm (default) or YAML manifests
- Version control and namespace customization
- Automatic verification of CRDs and deployments
- Graceful upgrade support
- Clean uninstall with CRD cleanup

- **Documentation**:
- `QUICK_START.md` - Get started in 5 minutes
- `KEDA_INSTALL_GUIDE.md` - Comprehensive KEDA installation and usage guide
- `TEST_REPORT.md` - Detailed test results and verification
- Example patterns for HPA and KEDA autoscaling

- **Makefile Improvements**:
- Split metrics-server and KEDA installation into separate targets
- Added Docker Desktop TLS patch for metrics-server
- Added KEDA management targets
- Improved target organization and documentation

### Fixed
- **KEDA Error Handling**: Fixed errors when KEDA CRDs are not installed
- Added `isKEDANotInstalledError()` helper function to detect missing KEDA CRDs
- Applied graceful handling to all KEDA reconciliation paths (Get, Create, Delete)
- Changed log level from ERROR to INFO for missing KEDA CRDs
- Prevents reconciliation failures when KEDA is not needed

- **Status Update Robustness**: Improved error handling in status updates
- Handle deployment not found gracefully (early in reconciliation)
- Better phase detection logic
- Improved condition messages with replica counts
- Added verbose logging for troubleshooting

### Changed
- **Operator Startup**: Added KEDA scheme registration to manager initialization
- Imports `kedav1alpha1` package
- Registers KEDA scheme in init function
- Enables KEDA CRD operations when KEDA is installed

- **Controller Logging**: Enhanced logging throughout reconciliation loop
- All major reconciliation steps now logged at INFO level
- Status updates logged at DEBUG/INFO with details
- Better error context in log messages

- **Autoscaling Architecture**: Improved separation of concerns
- HPA and KEDA reconcilers cleanly separated
- Automatic cleanup when switching scaler types
- Independent installation of autoscaling dependencies

## [0.1.0] - 2025-10-17

### Added
- Initial release of Prism Kubernetes Operator
- PrismPattern CRD for managing pattern deployments
- HPA (Horizontal Pod Autoscaler) support for CPU/memory-based scaling
- Automatic Deployment and Service creation from PrismPattern
- Owner references for cascade deletion
- Docker Desktop Kubernetes compatibility
- Comprehensive test coverage on local Docker Desktop cluster
- Basic Makefile with development targets
- go.mod with controller-runtime v0.16.3

### Known Limitations
- PrismStack CRD not yet implemented (DeepCopy methods incomplete)
- KEDA AuthenticationRef support incomplete (type mismatch with v2.12 API)
- No container image published yet (run from source only)
- No Helm chart yet (manual kubectl apply required)

## Release Notes

### Breaking Changes
None - this is the initial release.

### Migration Guide
N/A - initial release.

### Deprecations
None.

### Security
- All resources created with proper owner references
- RBAC manifests included in CRD definitions
- No secrets or credentials stored in operator

## Links
- [Quick Start Guide](QUICK_START.md)
- [KEDA Installation Guide](KEDA_INSTALL_GUIDE.md)
- [Test Report](TEST_REPORT.md)
- [Examples](config/samples/)
Loading
Loading