Skip to content

Commit

Permalink
fix horizontal pod autoscaling rules (#140)
Browse files Browse the repository at this point in the history
* fix horizontal pod autoscaling rules

---------

Co-authored-by: ranchodeluxe <[email protected]>
  • Loading branch information
ranchodeluxe and ranchodeluxe authored Sep 4, 2024
1 parent 8c1f812 commit a7119de
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
4 changes: 4 additions & 0 deletions docs/autoscaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ with the `release` name we installed the chart with below `<release-name>-grafan
kubectl get svc -n eoapi-support
```

3. Login and you should be default be able to see the eoapi-k8s grafana dashboard

![](./images/gfdashboard.png)

### Install or Upgrade Autoscaling Changes to `eoapi` Chart

1. If you haven't already decide which services (`vector` || `raster` || `stac`) you want to enable `autoscaling` on change your values yaml for these and redeploy
Expand Down
Binary file added docs/images/gfdashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions docs/loadtesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export INGRESS_ENDPOINT=$(kubectl -n ingress-nginx get svc/ingress-nginx-contro
# k8s-eoapi-ingressn-404721dbb4-e6dec70321c3eddd.elb.us-west-2.amazonaws.com
```

*

2. Then run some naive load testing against some static read-only endpoints in a couple different terminals

```sh
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/eoapi-support/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: eoapi-support

appVersion: "0.1.5"
version: "0.1.5"
appVersion: "0.1.6"
version: "0.1.6"

dependencies:
# Prometheus for collection of metrics.
Expand Down
5 changes: 5 additions & 0 deletions helm-chart/eoapi-support/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,8 @@ grafana:

dashboardsConfigMaps:
default: "eoapi-dashboards"


metrics-server:
apiService:
create: true
4 changes: 2 additions & 2 deletions helm-chart/eoapi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ kubeVersion: ">=1.23.0-0"
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.4.8"
version: "0.4.9"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.3.14"
appVersion: "0.3.15"

dependencies:
- name: postgrescluster
Expand Down
3 changes: 2 additions & 1 deletion helm-chart/eoapi/templates/services/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ spec:
target:
type: Utilization
averageUtilization: {{ index $v "autoscaling" "targets" "cpu" }}
{{- else if or (eq (index $v "autoscaling" "type") "requestRate") (eq (index $v "autoscaling" "type") "both") }}
{{- end }}
{{- if or (eq (index $v "autoscaling" "type") "requestRate") (eq (index $v "autoscaling" "type") "both") }}
# NOTE: 'Object' are custom metrics using third-party plugins such as prometheus + prometheus-adapter
# SEE: ../../../docs/autoscaling.md
- type: Object
Expand Down
6 changes: 3 additions & 3 deletions helm-chart/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ raster:
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#quantities
# so when the average unit among these pods is <requestRate>/1000 then scale
# you can watch the actual/target in real time using `kubectl get hpa/<name>`
requestRate: 1000000m
requestRate: 100000m
image:
name: ghcr.io/stac-utils/titiler-pgstac
tag: uvicorn-1.2.0
Expand Down Expand Up @@ -254,7 +254,7 @@ stac:
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#quantities
# so when the average unit among these pods is <requestRate>/1000 then scale
# you can watch the actual/target in real time using `kubectl get hpa/<name>`
requestRate: 15000000m
requestRate: 100000m
image:
name: ghcr.io/stac-utils/stac-fastapi-pgstac
tag: 2.4.9
Expand Down Expand Up @@ -303,7 +303,7 @@ vector:
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#quantities
# so when the average unit among these pods is <requestRate>/1000 then scale
# you can watch the actual/target in real time using `kubectl get hpa/<name>`
requestRate: 1000000m
requestRate: 100000m
image:
name: ghcr.io/developmentseed/tipg
tag: uvicorn-0.6.1
Expand Down

0 comments on commit a7119de

Please sign in to comment.