Skip to content

Commit d490e11

Browse files
Implement STAC Auth Proxy integration with EOAPI-K8S for service-specific ingress control
- Added documentation for STAC Auth Proxy integration - Configured service-specific ingress settings in values.yaml - Updated ingress template to conditionally include STAC service paths - Provided deployment guide and network flow diagram - Included testing and troubleshooting sections for configuration verification
1 parent 00060e4 commit d490e11

File tree

4 files changed

+127
-1501
lines changed

4 files changed

+127
-1501
lines changed

PR.md

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

docs/stac-auth-proxy.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# STAC Auth Proxy Integration with EOAPI-K8S
2+
3+
## Solution Overview
4+
5+
We have implemented support for STAC Auth Proxy integration with EOAPI-K8S through service-specific ingress control. This feature allows the STAC service to be accessible only internally while other services remain externally available.
6+
7+
## Implementation Details
8+
9+
### 1. Service-Specific Ingress Control
10+
11+
Each service can now independently control its ingress settings via the values.yaml configuration:
12+
13+
```yaml
14+
stac:
15+
enabled: true
16+
ingress:
17+
enabled: false # Disable external ingress for STAC only
18+
19+
# Other services remain externally accessible
20+
raster:
21+
enabled: true
22+
ingress:
23+
enabled: true
24+
```
25+
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+
47+
## Deployment Guide
48+
49+
### 1. Configure EOAPI-K8S
50+
51+
```yaml
52+
# values.yaml for eoapi-k8s
53+
stac:
54+
enabled: true
55+
ingress:
56+
enabled: false # No external ingress for STAC
57+
58+
# Other services remain externally accessible
59+
raster:
60+
enabled: true
61+
vector:
62+
enabled: true
63+
multidim:
64+
enabled: true
65+
```
66+
67+
### 2. Deploy STAC Auth Proxy
68+
69+
Deploy the stac-auth-proxy Helm chart in the same namespace:
70+
71+
```yaml
72+
# values.yaml for stac-auth-proxy
73+
backend:
74+
service: stac # Internal K8s service name
75+
port: 8080 # Service port
76+
77+
auth:
78+
# Configure authentication settings
79+
provider: oauth2
80+
# ... other auth settings
81+
```
82+
83+
### 3. Network Flow
84+
85+
```mermaid
86+
graph LR
87+
A[External Request] --> B[STAC Auth Proxy]
88+
B -->|Authentication| C[Internal STAC Service]
89+
D[External Request] -->|Direct Access| E[Raster/Vector/Other Services]
90+
```
91+
92+
## Testing
93+
94+
Verify the configuration:
95+
96+
```bash
97+
# Check that STAC paths are excluded
98+
helm template eoapi --set stac.ingress.enabled=false,stac.enabled=true -f values.yaml
99+
100+
# Verify other services remain accessible
101+
kubectl get ingress
102+
kubectl get services
103+
```
104+
105+
Expected behavior:
106+
- STAC service accessible only within the cluster
107+
- Other services (raster, vector, etc.) accessible via their ingress paths
108+
- Auth proxy successfully routing authenticated requests to STAC
109+
110+
## Troubleshooting
111+
112+
1. **STAC Service Not Accessible Internally**
113+
- Verify service is running: `kubectl get services`
114+
- Check service port matches auth proxy configuration
115+
- Verify network policies allow proxy-to-STAC communication
116+
117+
2. **Other Services Affected**
118+
- Confirm ingress configuration for other services
119+
- Check ingress controller logs
120+
- Verify service-specific settings in values.yaml
121+
122+
## Additional Notes
123+
124+
- The solution leverages Kubernetes service discovery for internal communication
125+
- No changes required to the STAC service itself
126+
- Zero downtime deployment possible
127+
- Existing deployments without auth proxy remain compatible

helm-chart/eoapi/templates/services/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ The `_common.tpl` file provides limited helper functions for truly common elemen
4040

4141
For database environment variables, we leverage the existing `eoapi.postgresqlEnv` helper from the main `_helpers.tpl` file.
4242

43-
## Refactoring Benefits
44-
45-
1. **Improved Readability**: Service configurations are explicit and clearly visible
46-
2. **Better Maintainability**: Changes to one service don't affect others
47-
3. **Enhanced Flexibility**: Each service can evolve independently
48-
4. **Easier Debugging**: Errors are isolated to specific service files
49-
5. **Safer Changes**: Template modifications can be tested on individual services
50-
5143
## Usage
5244

5345
No changes to `values.yaml` structure were required. The chart maintains full backward compatibility with existing deployments.

0 commit comments

Comments
 (0)