Skip to content

Commit d074852

Browse files
committed
Refactor autoscalling and observability.
1 parent 501a83f commit d074852

File tree

20 files changed

+1895
-601
lines changed

20 files changed

+1895
-601
lines changed

.github/workflows/helm-tests.yml

Lines changed: 15 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ jobs:
2222
with:
2323
version: ${{ env.HELM_VERSION }}
2424

25-
- name: Run Helm unit tests
26-
run: make tests
25+
- name: Install helm unittest plugin
26+
run: helm plugin install https://github.com/helm-unittest/helm-unittest
2727

28-
integration:
29-
name: Integration Tests (K3s)
28+
- run: |
29+
cd charts
30+
helm unittest eoapi -f 'tests/*.yaml' -v eoapi/test-helm-values.yaml
31+
# Run autoscaling-specific unit tests
32+
helm unittest eoapi -f 'tests/autoscaling_tests.yaml'
33+
34+
k3s-integration-tests:
3035
if: github.event.pull_request.head.repo.full_name == github.repository
3136
permissions:
3237
contents: 'read'
@@ -49,86 +54,29 @@ jobs:
4954

5055
- name: Deploy eoAPI
5156
id: deploy
52-
continue-on-error: true
5357
run: |
5458
echo "=== Starting eoAPI deployment ==="
5559
export RELEASE_NAME="$RELEASE_NAME"
60+
export NAMESPACE="default"
5661
export PGO_VERSION="${{ env.PGO_VERSION }}"
5762
export GITHUB_SHA="${{ github.sha }}"
5863
./scripts/deploy.sh --ci
5964
60-
- name: Check deployment status
61-
id: check
62-
if: steps.deploy.outcome == 'success'
63-
run: |
64-
echo "=== Checking deployment status ==="
65-
export RELEASE_NAME="$RELEASE_NAME"
66-
./scripts/test.sh check-deployment --debug
67-
68-
- name: Debug pgstac jobs if deployment failed
69-
if: steps.deploy.outcome == 'failure'
70-
continue-on-error: true
71-
run: |
72-
echo "=== Debugging pgstac job failures ==="
73-
74-
# Check pgstac-migrate job
75-
echo "===== pgstac-migrate Job Status ====="
76-
kubectl get jobs -l app.kubernetes.io/name=pgstac-migrate -o wide || echo "No pgstac-migrate jobs found"
77-
78-
MIGRATE_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-migrate -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
79-
if [ -n "$MIGRATE_PODS" ]; then
80-
for POD in $MIGRATE_PODS; do
81-
echo "--- Logs from migrate pod $POD ---"
82-
kubectl logs "$POD" --tail=100 || true
83-
echo "--- Description of migrate pod $POD ---"
84-
kubectl describe pod "$POD"
85-
done
86-
fi
87-
88-
# Check pgstac-load-samples job
89-
echo "===== pgstac-load-samples Job Status ====="
90-
kubectl get jobs -l app.kubernetes.io/name=pgstac-load-samples -o wide || echo "No pgstac-load-samples jobs found"
91-
92-
SAMPLES_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-load-samples -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
93-
if [ -n "$SAMPLES_PODS" ]; then
94-
for POD in $SAMPLES_PODS; do
95-
echo "--- Logs from samples pod $POD ---"
96-
kubectl logs "$POD" --tail=100 || true
97-
echo "--- Description of samples pod $POD ---"
98-
kubectl describe pod "$POD"
99-
done
100-
fi
101-
102-
# Check database status
103-
echo "===== Database Pod Status ====="
104-
kubectl get pods -l postgres-operator.crunchydata.com/cluster -o wide
105-
kubectl get postgrescluster -o wide
106-
107-
# Check ConfigMaps
108-
echo "===== Relevant ConfigMaps ====="
109-
kubectl get configmaps | grep -E "initdb|pgstac" || echo "No relevant configmaps found"
110-
111-
# Check for any related events
112-
echo "===== Related Kubernetes Events ====="
113-
kubectl get events | grep -E "pgstac|initdb" || echo "No relevant events found"
114-
115-
exit 1
116-
11765
- name: Run integration tests
118-
if: steps.deploy.outcome == 'success'
11966
run: |
12067
echo "=== Running integration tests ==="
12168
export RELEASE_NAME="$RELEASE_NAME"
69+
export NAMESPACE="default"
12270
./scripts/test.sh integration --debug
12371
124-
- name: Debug deployment status
125-
if: always()
72+
- name: Debug failed deployment
73+
if: failure()
12674
run: |
127-
echo "=== Final Deployment Status ==="
75+
echo "=== Deployment failed - collecting debug information ==="
12876
kubectl get pods -o wide
12977
kubectl get jobs -o wide
13078
kubectl get services -o wide
131-
kubectl get ingress
79+
kubectl get events --sort-by='.lastTimestamp' | tail -20 || true
13280
13381
13482
- name: Cleanup

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Added code formatting and linting with pre-commit hooks [#283](https://github.com/developmentseed/eoapi-k8s/pull/283)
1414
- Added values.schema.json validation [#296](https://github.com/developmentseed/eoapi-k8s/pull/296)
1515

16+
### Changed
17+
18+
- Excluded renovate.json from CHANGELOG.md edits [#301](https://github.com/developmentseed/eoapi-k8s/pull/301)
19+
- Refactores eoapi-support into core eoapi chart [#262](https://github.com/developmentseed/eoapi-k8s/pull/262)
20+
21+
1622
## [0.7.8] - 2025-09-10
1723

1824
### Added

charts/eoapi-support/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

charts/eoapi-support/.helmignore

Lines changed: 0 additions & 30 deletions
This file was deleted.

charts/eoapi-support/values.yaml

Lines changed: 0 additions & 174 deletions
This file was deleted.

charts/eoapi/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,27 @@ dependencies:
5353
version: 5.7.4
5454
repository: "https://devseed.com/eoapi-k8s/"
5555
condition: postgrescluster.enabled
56+
57+
# Optional monitoring components for metrics collection and autoscaling
58+
# These are disabled by default to keep deployments lightweight
59+
# Enable via: monitoring.prometheus.enabled=true, monitoring.metricsServer.enabled=true
60+
- name: metrics-server
61+
version: 7.2.8
62+
repository: https://charts.bitnami.com/bitnami
63+
condition: monitoring.metricsServer.enabled
64+
65+
- name: prometheus
66+
version: 25.3.1
67+
repository: https://prometheus-community.github.io/helm-charts
68+
condition: monitoring.prometheus.enabled
69+
70+
- name: prometheus-adapter
71+
version: 4.7.1
72+
repository: https://prometheus-community.github.io/helm-charts
73+
condition: monitoring.prometheusAdapter.enabled
74+
75+
# Observability components - Grafana dashboards and visualization
76+
- name: grafana
77+
version: 7.3.3
78+
repository: https://grafana.github.io/helm-charts
79+
condition: observability.grafana.enabled

charts/eoapi/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ A Helm chart for deploying Earth Observation APIs with integrated STAC, raster,
1313
- Built-in STAC Browser interface
1414
- Flexible database configuration
1515
- Unified ingress system
16+
- Autoscaling
17+
- Integrated observability (Prometheus & Grafana)
1618

1719
## TL;DR
1820

0 commit comments

Comments
 (0)