How aws-controllers-k8s/rds-controller works
Main Components
a. Controller Components:
• ACK RDS Controller (core component)
• Custom Resource Definitions (CRDs)
• Resource Managers
• Kubernetes API Server Interface
• AWS RDS API Interface
b. Resource Types (Custom Resources):
• DBInstance
• DBCluster
• DBParameterGroup
• DBClusterParameterGroup
• DBSnapshot
• DBClusterSnapshot
• DBSubnetGroup
• DBProxy
• GlobalCluster
┌─────────────────────────────────────────────────────┐
• Kubernetes Cluster │
• ┌─────────────────┐ ┌──────────────────┐ │
• K8s API │ │ ACK Controller │ │
• Server │◄─────►│ (RDS) │ │
• ┘ └────────┬─────────┘ │
• ▲ │ │
• ▼ │
• ┌────────┴────────┐ ┌──────────────────┐ │
• Custom │ │ Resource │ │
• Resources │ │ Managers │ │
• ┘ └────────┬─────────┘ │
• ┼─────────────┘
• ▼
• ┌──────────────────────┐
• AWS RDS API │
• ┘
Key Interactions to Highlight
a. Control Flow:
• Custom Resource creation/modification in Kubernetes
• Controller reconciliation loop
• AWS API calls
• Status updates back to Kubernetes
b. Resource Management:
• Resource creation/deletion/updates
• Parameter group management
• Snapshot operations
• Database proxy configuration
Important Details
• Reconciliation loop flow
• Error handling paths
• Resource dependencies
• Authentication flows (AWS IAM integration)
• Custom resource validation
• Status and condition updates
Implementation Notes
• The controller's role as a bridge between Kubernetes and AWS RDS
• The custom resource definitions as the primary interface
• The resource manager pattern used for different RDS resource types
• The eventual consistency model
• The separation of concerns between different components