Skip to content

Commit 25d9fa9

Browse files
committed
Feedback from PR review.
1 parent 9f2ea13 commit 25d9fa9

File tree

3 files changed

+20
-38
lines changed

3 files changed

+20
-38
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Install Python dependencies
5757
run: |
58-
pip install pytest pytest-timeout requests
58+
pip install pytest pytest-timeout requests psycopg2-binary
5959
6060
- name: Start K3s cluster
6161
uses: jupyterhub/action-k3s-helm@v4
@@ -114,11 +114,6 @@ jobs:
114114
echo "=== Post-deployment validation ==="
115115
./scripts/test.sh check-deployment
116116
117-
- name: Install Python dependencies
118-
run: |
119-
python -m pip install --upgrade pip
120-
pip install pytest requests psycopg2-binary
121-
122117
- name: Run integration tests
123118
run: |
124119
export RELEASE_NAME="$RELEASE_NAME"

.github/workflows/tests/test_autoscaling.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@
1111

1212

1313
def get_namespace():
14-
"""Get the target namespace from environment or default."""
1514
return os.environ.get("NAMESPACE", "eoapi")
1615

1716

1817
def get_release_name():
19-
"""Get the release name from environment or default."""
2018
return os.environ.get("RELEASE_NAME", "eoapi")
2119

2220

2321
def get_base_url():
24-
"""Get the base URL for API endpoints."""
25-
# Try to detect ingress or use port-forward
2622
namespace = get_namespace()
2723

2824
# Check if we have an ingress
@@ -49,12 +45,10 @@ def get_base_url():
4945
except requests.RequestException:
5046
pass
5147

52-
# Fallback to localhost (assuming port-forward)
5348
return "http://localhost:8080"
5449

5550

5651
def kubectl_get(resource, namespace=None, label_selector=None, output="json"):
57-
"""Execute kubectl get command with optional parameters."""
5852
cmd = ["kubectl", "get", resource]
5953

6054
if namespace:
@@ -71,7 +65,6 @@ def kubectl_get(resource, namespace=None, label_selector=None, output="json"):
7165

7266

7367
def get_pod_metrics(namespace, service_name):
74-
"""Get current CPU and memory metrics for service pods."""
7568
release_name = get_release_name()
7669
result = subprocess.run(
7770
[
@@ -105,7 +98,6 @@ def get_pod_metrics(namespace, service_name):
10598

10699

107100
def get_hpa_status(namespace, hpa_name):
108-
"""Get current HPA status and metrics."""
109101
result = kubectl_get("hpa", namespace=namespace, output="json")
110102
if result.returncode != 0:
111103
return None
@@ -119,7 +111,6 @@ def get_hpa_status(namespace, hpa_name):
119111

120112

121113
def get_pod_count(namespace, service_name):
122-
"""Get current number of running pods for a service."""
123114
release_name = get_release_name()
124115
result = kubectl_get(
125116
"pods",

docs/examples/values-autoscaling.yaml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
# Example values for eoAPI with core monitoring and autoscaling enabled
2+
#
3+
# To use this configuration:
4+
#
5+
# 1. Update the ingress.host to your actual domain
6+
# 2. Adjust scaling targets based on your load testing results
7+
# 3. Monitor resource usage and adjust requests/limits accordingly
8+
# 4. Consider enabling TLS for production deployments
9+
#
10+
# IMPORTANT: This configuration enables monitoring components that are
11+
# disabled by default. This is required for autoscaling to work.
12+
#
13+
# For observability and dashboards, install the separate eoapi-observability chart:
14+
# helm install eoapi-obs eoapi/eoapi-observability --namespace eoapi
15+
#
16+
# Load testing recommendations:
17+
# - Test each service endpoint individually
18+
# - Monitor HPA metrics: kubectl get hpa -n eoapi -w
19+
# - Check custom metrics: kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1"
20+
# - Review Prometheus targets to ensure metrics collection is working
221

322
gitSha: "latest"
423

@@ -187,26 +206,3 @@ pgstacBootstrap:
187206
limits:
188207
cpu: "1024m"
189208
memory: "2048Mi"
190-
191-
######################
192-
# ADDITIONAL NOTES
193-
######################
194-
#
195-
# To use this configuration:
196-
#
197-
# 1. Update the ingress.host to your actual domain
198-
# 2. Adjust scaling targets based on your load testing results
199-
# 3. Monitor resource usage and adjust requests/limits accordingly
200-
# 4. Consider enabling TLS for production deployments
201-
#
202-
# IMPORTANT: This configuration enables monitoring components that are
203-
# disabled by default. This is required for autoscaling to work.
204-
#
205-
# For observability and dashboards, install the separate eoapi-observability chart:
206-
# helm install eoapi-obs eoapi/eoapi-observability --namespace eoapi
207-
#
208-
# Load testing recommendations:
209-
# - Test each service endpoint individually
210-
# - Monitor HPA metrics: kubectl get hpa -n eoapi -w
211-
# - Check custom metrics: kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1"
212-
# - Review Prometheus targets to ensure metrics collection is working

0 commit comments

Comments
 (0)