Skip to content

Commit b7b0cf9

Browse files
v0.7.1: Improve upgrade process and ingress configuration (#228)
* Refactor ingress configurations and remove deprecated settings for improved clarity and compatibility * Update PostgreSQL secret references to use custom cluster name and add tests for cluster name fallback * Add upgrade job for database permissions and update schema for previous version * Add upgrade guide and important notice for database permission changes * Update changelog and upgrade documentation for version 0.7.1 enhancements * Update configuration documentation to enhance clarity and detail for required values, database options, and service settings * Update changelog and chart version for v0.7.1 release, including breaking changes and new features * Update docs/unified-ingress.md Co-authored-by: Jonas <[email protected]> --------- Co-authored-by: Jonas <[email protected]>
1 parent af5ab47 commit b7b0cf9

21 files changed

+612
-229
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [v0.7.1] - Unreleased
8+
## [v0.7.1] - 2025-05-16
99

1010
### Breaking Changes
1111
- Remove hard-coded cert-manager configuration from ingress template [#227](https://github.com/developmentseed/eoapi-k8s/pull/227)
12+
- Remove `pathType` and `pathSuffix` configurations in favor of controller-specific defaults [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
13+
14+
### Added
15+
- Add upgrade job to handle database permissions for migrations from pre-0.7.0 versions [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
16+
- Add separate ingress configuration for STAC browser [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
17+
- Support custom cluster naming via `postgrescluster.name` [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
1218

1319
### Changed
20+
- Improve Nginx and Traefik support with controller-specific rewrites [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
21+
- Increase bootstrap job retry limit to 3 attempts [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
22+
- Enhance secret handling with custom PostgreSQL cluster names [#228](https://github.com/developmentseed/eoapi-k8s/pull/228)
1423
- Simplify TLS configuration to allow user-controlled certificate management [#227](https://github.com/developmentseed/eoapi-k8s/pull/227)
1524
- Update documentation with comprehensive cert-manager setup guide [#227](https://github.com/developmentseed/eoapi-k8s/pull/227)
1625

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ For cloud-based deployments, refer to our detailed setup guides:
104104
* [Autoscaling and Monitoring](./docs/autoscaling.md)
105105
* [Health Checks](./docs/health.md)
106106
* [Unified Ingress Configuration](./docs/unified-ingress.md)
107+
* [Upgrade Guide](./docs/upgrade.md)
108+
109+
> **Important Notice**: If you're upgrading from a version prior to 0.7.0, please read the [upgrade guide](./docs/upgrade.md) for important database permission changes.
107110
108111
## Contributing
109112

docs/configuration.md

Lines changed: 145 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,172 @@
22

33
## Required Values
44

5-
The required values to pass to `helm install` or `helm template` commands can be found by showing what is validated:
5+
The required values to pass to `helm install` or `helm template` commands can be found in our schema validation:
66

77
```bash
8-
$ head -n 9 <eoapi-k8s-repo>/values.schema.json
98
{
10-
"$schema": "http://json-schema.org/schema#",
11-
"type": "object",
129
"required": [
1310
"service",
1411
"gitSha"
15-
],
12+
]
13+
}
1614
```
1715

18-
Most of the required fields have common-sense defaults.
19-
The table below and the `values.yaml` comments should explain what the options and defaults are:
16+
Most fields have sensible defaults. Here are the core configuration options:
2017

21-
| **Values Key** | **Description** | **Default** | **Choices** |
22-
|:-------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------|:------------|:------------------------|
23-
| `service.port` | the port that all vector/raster/stac services run on<br>used in `kind: Service` and `kind: Ingress` | 8080 | your favorite port |
24-
| `gitSha` | sha attached to a `kind: Deployment` key `metadata.labels` | gitshaABC123 | your favorite sha |
18+
| **Values Key** | **Description** | **Default** | **Choices** |
19+
|:--------------|:----------------|:------------|:------------|
20+
| `service.port` | Port for all services (vector/raster/stac) | 8080 | any valid port |
21+
| `gitSha` | SHA for deployment tracking | gitshaABC123 | any valid SHA |
22+
| `previousVersion` | Previous version during upgrades | "" | semantic version |
2523

24+
## Database Configuration
2625

27-
---
26+
### PostgreSQL Cluster (Default)
2827

29-
## Default Configuration
28+
Using Crunchydata's PostgreSQL Operator (`postgresql.type: "postgrescluster"`):
3029

31-
Running `helm install` from https://devseed.com/eoapi-k8s/ should spin up similar infrastructure in EKS or GKE:
30+
| **Values Key** | **Description** | **Default** | **Choices** |
31+
|:--------------|:----------------|:------------|:------------|
32+
| `postgrescluster.enabled` | Enable PostgreSQL cluster | true | true/false |
33+
| `postgrescluster.name` | Cluster name | Release name | any valid k8s name |
34+
| `postgrescluster.postgresVersion` | PostgreSQL version | 16 | supported versions |
35+
| `postgrescluster.postGISVersion` | PostGIS version | "3.4" | supported versions |
3236

33-
In EKS or GKE you'll by default get:
37+
### External Database
3438

35-
* a HA PostgreSQL database deployment and service via [Crunchdata's Postgresl Operator](https://access.crunchydata.com/documentation/postgres-operator)
36-
* the same vector and raster data fixtures used for testing loaded into the DB
37-
* a load balancer and nginx-compatible ingress with the following path rewrites:
38-
* a `/stac` service for `stac_fastapi.pgstac`
39-
* a `/raster` service for `titler.pgstac`
40-
* a `/vector` service for `tipg.pgstac`
39+
For external databases, set `postgresql.type` to either:
4140

42-
Here's a simplified high-level diagram to grok:
43-
![](./images/default_architecture.png)
41+
1. Using plaintext credentials (`external-plaintext`):
42+
```yaml
43+
postgresql:
44+
type: "external-plaintext"
45+
external:
46+
host: "your-host"
47+
port: "5432"
48+
database: "eoapi"
49+
credentials:
50+
username: "eoapi"
51+
password: "your-password"
52+
```
4453
45-
---
54+
2. Using Kubernetes secrets (`external-secret`):
55+
```yaml
56+
postgresql:
57+
type: "external-secret"
58+
external:
59+
existingSecret:
60+
name: "your-secret"
61+
keys:
62+
username: "username"
63+
password: "password"
64+
host: "your-host" # can also be in secret
65+
port: "5432" # can also be in secret
66+
database: "eoapi" # can also be in secret
67+
```
4668

47-
## Additional Options
69+
## Ingress Configuration
70+
71+
Unified ingress configuration supporting both NGINX and Traefik:
72+
73+
| **Values Key** | **Description** | **Default** | **Choices** |
74+
|:--------------|:----------------|:------------|:------------|
75+
| `ingress.enabled` | Enable ingress | true | true/false |
76+
| `ingress.className` | Ingress controller | "nginx" | "nginx", "traefik" |
77+
| `ingress.host` | Ingress hostname | "" | valid hostname |
78+
| `ingress.rootPath` | Doc server root path | "" | valid path |
79+
80+
See [Unified Ingress Configuration](./unified-ingress.md) for detailed setup.
81+
82+
## Service Configuration
83+
84+
Each service (stac, raster, vector, multidim) supports:
85+
86+
| **Values Key** | **Description** | **Default** | **Choices** |
87+
|:--------------|:----------------|:------------|:------------|
88+
| `{service}.enabled` | Enable the service | varies | true/false |
89+
| `{service}.image.name` | Container image | varies | valid image |
90+
| `{service}.image.tag` | Image tag | varies | valid tag |
91+
| `{service}.autoscaling.enabled` | Enable HPA | false | true/false |
92+
| `{service}.autoscaling.type` | Scaling metric | "requestRate" | "cpu", "requestRate", "both" |
93+
94+
Example service configuration:
95+
```yaml
96+
raster:
97+
enabled: true
98+
autoscaling:
99+
enabled: true
100+
minReplicas: 2
101+
maxReplicas: 10
102+
type: "requestRate"
103+
targets:
104+
cpu: 75
105+
requestRate: "100000m"
106+
```
48107

49-
---
108+
## STAC Browser
50109

51-
### Key `autoscaling`
110+
| **Values Key** | **Description** | **Default** | **Choices** |
111+
|:--------------|:----------------|:------------|:------------|
112+
| `browser.enabled` | Enable STAC browser | true | true/false |
113+
| `browser.replicaCount` | Number of replicas | 1 | integer > 0 |
114+
| `browser.ingress.enabled` | Enable browser ingress | true | true/false |
52115

53-
#### `autoscaling.type`
116+
## Deployment Architecture
54117

55-
| **Values Key** | **Description** | **Default** | **Choices** |
56-
|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|:-----------|:--------------|
57-
| `autoscaling.type` | a simple example of a default metric (`cpu`) and custom metric (`requestRate`) to scale by. If selecting `both` the metric that results in the "highest amount of change" wins. See [k8s documentation](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#scaling-on-multiple-metrics) for more info | requestRate | requestRate<br>cpu<br>both<br> |
118+
When using default settings, the deployment looks like this:
119+
![](./images/default_architecture.png)
120+
121+
The deployment includes:
122+
- HA PostgreSQL database (via PostgreSQL Operator)
123+
- Sample data fixtures
124+
- Load balancer with path-based routing:
125+
- `/stac` → STAC API
126+
- `/raster` → Titiler
127+
- `/vector` → TiPG
128+
- `/browser` → STAC Browser
129+
- `/` → Documentation
130+
131+
## Advanced Configuration
132+
133+
### Autoscaling Behavior
134+
135+
Fine-tune scaling behavior:
136+
137+
```yaml
138+
autoscaling:
139+
behaviour:
140+
scaleDown:
141+
stabilizationWindowSeconds: 60
142+
scaleUp:
143+
stabilizationWindowSeconds: 0
144+
```
58145

59-
#### `autoscaling.behaviour.[scaleDown||scaleUp]`
146+
See [Kubernetes HPA documentation](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior) for details.
60147

61-
These are normal k8s autoscaling pass throughs. They are stablization windows in seconds to for scaling up or down to prevent flapping from happening. Read more about [the options on the k8s documentation](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior)
148+
### Resource Requirements
149+
150+
Each service can have custom resource limits:
151+
152+
```yaml
153+
settings:
154+
resources:
155+
limits:
156+
cpu: "768m"
157+
memory: "1024Mi"
158+
requests:
159+
cpu: "256m"
160+
memory: "512Mi"
161+
```
162+
163+
### Additional Service Settings
164+
165+
Each service also supports:
166+
```yaml
167+
settings:
168+
labels: {} # Additional pod labels
169+
extraEnvFrom: [] # Additional environment variables from references
170+
extraVolumeMounts: [] # Additional volume mounts
171+
extraVolumes: [] # Additional volumes
172+
envVars: {} # Environment variables
173+
```

docs/stac-auth-proxy.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,6 @@ raster:
2323
enabled: true
2424
```
2525
26-
### 2. Template Changes
27-
28-
The ingress template now checks service-specific settings:
29-
30-
```yaml
31-
{{- if and .Values.stac.enabled (or (not (hasKey .Values.stac "ingress")) .Values.stac.ingress.enabled) }}
32-
- pathType: {{ .Values.ingress.pathType }}
33-
path: /stac{{ .Values.ingress.pathSuffix }}
34-
backend:
35-
service:
36-
name: stac
37-
port:
38-
number: {{ .Values.service.port }}
39-
{{- end }}
40-
```
41-
42-
This ensures:
43-
- Service paths are only included if the service and its ingress are enabled
44-
- Backward compatibility is maintained (ingress enabled by default)
45-
- Clean separation of service configurations
46-
4726
## Deployment Guide
4827
4928
### 1. Configure EOAPI-K8S

0 commit comments

Comments
 (0)