-
Notifications
You must be signed in to change notification settings - Fork 1
Update repo to KCD Sofia demo #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5c31be3
2312dfd
d1035f2
95283fc
534847d
2e80a0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,5 @@ extends: default | |
| rules: | ||
| line-length: disable | ||
| document-start: disable | ||
| indentation: | ||
| indent-sequences: consistent | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ spec: | |
| - "FreeStorageSpace" | ||
| - "ReadIOPS" | ||
| - "WriteIOPS" | ||
| period: 300 | ||
| period: 60 | ||
| target: "status.performanceMetrics" | ||
| credentials: | ||
| - name: aws-creds | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 |
||
|
|
@@ -59,15 +59,21 @@ spec: | |
| 6. When scaling needed: ONLY modify the instanceClass or allocatedStorage fields in spec.forProvider | ||
| 7. PRESERVE all other existing spec fields unchanged - do not recreate the entire spec | ||
| 4. Make scaling decisions based on these thresholds: | ||
| - High CPU (>80%): Consider increasing instance class | ||
| - High CPU (>50%): Consider increasing instance class | ||
| - High Memory usage (FreeableMemory <20% of total): Consider memory-optimized instance | ||
| - High IOPS (>80% of provisioned): Consider increasing storage or instance class | ||
| - High connections (>80% of max): Consider increasing instance class | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 |
||
| SCALING LOGIC: | ||
| - For high CPU/Memory/IOPS: Upgrade instance class (e.g., db.t3.micro → db.t3.small → db.t3.medium) | ||
| - For high CPU/Memory/IOPS: Upgrade instance class (e.g., db.t3.micro → db.t3.small → db.t3.medium → db.t3.large) | ||
| - For low utilization: Downgrade instance class (e.g., db.t3.large → db.t3.medium → db.t3.small → db.t3.micro) | ||
| - For storage issues: Increase allocatedStorage by 20GB increments | ||
| - Only scale up, never scale down automatically for safety | ||
| - Scale up when resources are constrained, scale down when consistently over-provisioned | ||
| - DOWNSCALING SAFETY: Only scale down if ALL metrics show low utilization for sustained period: | ||
| * CPU < 20% for extended time | ||
| * Memory usage < 40% | ||
| * Connections < 30% of capacity | ||
| * No recent scaling events (check annotations for last scaling time) | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶 |
||
| CRITICAL UPDATE APPROACH: | ||
| - PRESERVE the entire existing resource structure from <composed> section | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [yamllint] reported by reviewdog 🐶
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| apiVersion: aws.upbound.io/v1beta1 | ||
| kind: ProviderConfig | ||
| metadata: | ||
| name: default | ||
| spec: | ||
| credentials: | ||
| source: Secret | ||
| secretRef: | ||
| namespace: crossplane-system | ||
| name: aws-creds | ||
| key: credentials |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| #!/bin/bash | ||
| # Demo-optimized load test for fast autoscaling trigger | ||
|
|
||
| DB_ENDPOINT="rds-metrics-database-ai-scale.cxal1lomznba.us-west-2.rds.amazonaws.com" | ||
| DB_USER="masteruser" | ||
| DB_PASS="YzZiCjT6vitMxClxBmE7OH8IScb" | ||
| XR_NAME="rds-metrics-database-ai-scale" | ||
|
|
||
| echo "🚀 Starting DEMO load test (optimized for speed)..." | ||
|
|
||
| # Maximum intensity load - 20 processes with high benchmark values | ||
| for i in {1..20}; do | ||
| mysql --host=$DB_ENDPOINT --user=$DB_USER --password=$DB_PASS \ | ||
| --default-auth=mysql_native_password \ | ||
| --execute="SELECT BENCHMARK(3000000000, MD5('demo_intensive_$i'));" & | ||
| done | ||
|
|
||
| # Additional CPU-intensive operations | ||
| for i in {1..10}; do | ||
| mysql --host=$DB_ENDPOINT --user=$DB_USER --password=$DB_PASS \ | ||
| --execute=" | ||
| SELECT BENCHMARK(1000000000, SHA2(CONCAT('demo_', RAND()), 256)); | ||
| SELECT BENCHMARK(1000000000, MD5(CONCAT(CONNECTION_ID(), '_$i'))); | ||
| " & | ||
| done | ||
|
|
||
| echo "⏱️ Load test running... Expected timeline:" | ||
| echo " - 30-60 seconds: CPU should hit 50%+" | ||
| echo " - 1-2 minutes: CloudWatch metrics update" | ||
| echo " - 2-3 minutes: Claude analysis and scaling decision" | ||
| echo " - 5-10 minutes: Instance scaling completion" | ||
|
|
||
| # Real-time monitoring | ||
| for i in {1..15}; do | ||
| echo "" | ||
| echo "=== Demo Check $i ($(date +%H:%M:%S)) ===" | ||
|
|
||
| # Current metrics | ||
| CPU=$(kubectl get xsqlinstance $XR_NAME -o jsonpath='{.status.performanceMetrics.metrics.CPUUtilization.value}' | ||
| 2>/dev/null || echo "collecting...") | ||
| echo "🔥 CPU: ${CPU}% (threshold: 50%)" | ||
|
|
||
| # Instance class | ||
| CLASS=$(kubectl get instance.rds -l crossplane.io/composite=$XR_NAME -o | ||
| jsonpath='{.items[0].spec.forProvider.instanceClass}' 2>/dev/null || echo "unknown") | ||
| echo "💾 Instance: $CLASS" | ||
|
|
||
| # Claude decision | ||
| REASONING=$(kubectl get xsqlinstance $XR_NAME -o jsonpath='{.status.claudeDecision.reasoning}' 2>/dev/null || echo "analyzing...") | ||
| echo "🤖 Claude: ${REASONING:0:80}..." | ||
|
|
||
| # Check if scaling happened | ||
| if [[ "$CLASS" != "db.t3.micro" ]]; then | ||
| echo "🎉 SCALING SUCCESSFUL! Instance upgraded to $CLASS" | ||
| break | ||
| fi | ||
|
|
||
| sleep 20 | ||
| done | ||
|
|
||
| echo "" | ||
| echo "🛑 Stopping load test..." | ||
| pkill -f "mysql.*BENCHMARK" | ||
| pkill -f "mysql.*SHA2" | ||
|
|
||
| echo "✅ Demo complete!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
| # simple-demo-scaling-monitor.sh | ||
|
|
||
| XR_NAME="rds-metrics-database-ai-scale" | ||
| CONTEXT="kind-up-configuration-aws-database-ai" | ||
|
|
||
| while true; do | ||
| echo "=== $(date '+%Y-%m-%d %H:%M:%S') ===" | ||
| echo "$ kubectl get xsqlinstance $XR_NAME -o yaml | yq '.metadata.annotations | | ||
| del(.[\"kubectl.kubernetes.io/last-applied-configuration\"])'" | ||
|
|
||
| kubectl --context $CONTEXT get xsqlinstance $XR_NAME -o yaml | yq '.metadata.annotations | | ||
| del(.["kubectl.kubernetes.io/last-applied-configuration"])' | ||
|
|
||
| echo "" | ||
| sleep 45 | ||
| done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[yamllint] reported by reviewdog 🐶
[error] trailing spaces (trailing-spaces)
configuration-aws-database-ai/apis/composition-intelligent.yaml
Line 112 in 534847d