Skip to content

Commit 339132a

Browse files
committed
switch from nested config in values, to an env key that passes env directly
1 parent ef43010 commit 339132a

File tree

4 files changed

+78
-166
lines changed

4 files changed

+78
-166
lines changed

helm/README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Basic installation with minimal configuration:
2424

2525
```bash
2626
helm install stac-auth-proxy oci://ghcr.io/developmentseed/stac-auth-proxy/charts/stac-auth-proxy \
27-
--set config.upstreamUrl=https://your-stac-api.com/stac \
28-
--set config.oidc.discoveryUrl=https://your-auth-server/.well-known/openid-configuration \
27+
--set env.UPSTREAM_URL=https://your-stac-api.com/stac \
28+
--set env.OIDC_DISCOVERY_URL=https://your-auth-server/.well-known/openid-configuration \
2929
--set ingress.host=stac-proxy.your-domain.com
3030
```
3131

@@ -34,13 +34,12 @@ helm install stac-auth-proxy oci://ghcr.io/developmentseed/stac-auth-proxy/chart
3434
Create a `values.yaml` file:
3535

3636
```yaml
37-
config:
38-
upstreamUrl: "https://your-stac-api.com/stac"
39-
oidc:
40-
discoveryUrl: "https://your-auth-server/.well-known/openid-configuration"
41-
discoveryInternalUrl: "http://auth-server-internal/.well-known/openid-configuration"
42-
defaultPublic: false
43-
healthzPrefix: "/healthz"
37+
env:
38+
UPSTREAM_URL: "https://your-stac-api.com/stac"
39+
OIDC_DISCOVERY_URL: "https://your-auth-server/.well-known/openid-configuration"
40+
OIDC_DISCOVERY_INTERNAL_URL: "http://auth-server-internal/.well-known/openid-configuration"
41+
DEFAULT_PUBLIC: "false"
42+
HEALTHZ_PREFIX: "/healthz"
4443

4544
ingress:
4645
enabled: true
@@ -82,17 +81,14 @@ serviceAccount:
8281
8382
| Parameter | Description |
8483
|-----------|-------------|
85-
| `config.upstreamUrl` | URL of the STAC API to proxy |
86-
| `config.oidc.discoveryUrl` | OpenID Connect discovery document URL |
84+
| `env.UPSTREAM_URL` | URL of the STAC API to proxy |
85+
| `env.OIDC_DISCOVERY_URL` | OpenID Connect discovery document URL |
8786

8887
### Optional Values
8988

9089
| Parameter | Description | Default |
9190
|-----------|-------------|---------|
92-
| `config.waitForUpstream` | Wait for upstream API to become available | `true` |
93-
| `config.healthzPrefix` | Path prefix for health check endpoints | `/healthz` |
94-
| `config.defaultPublic` | Default access policy for endpoints | `false` |
95-
| `config.oidc.discoveryInternalUrl` | Internal network OIDC discovery URL | `""` |
91+
| `env` | Environment variables passed to the container. See [STAC Auth Proxy documentation](https://github.com/developmentseed/stac-auth-proxy#configuration) for details | `{}` |
9692
| `ingress.enabled` | Enable ingress | `true` |
9793
| `ingress.className` | Ingress class name | `nginx` |
9894
| `ingress.host` | Hostname for the ingress | `""` |

helm/templates/deployment.yaml

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,54 +30,11 @@ spec:
3030
resources:
3131
{{- toYaml .Values.resources | nindent 12 }}
3232
env:
33-
- name: UPSTREAM_URL
34-
value: {{ required "A valid upstream URL is required" .Values.config.upstreamUrl | quote }}
35-
- name: OIDC_DISCOVERY_URL
36-
value: {{ required "An OIDC discovery URL is required" .Values.config.oidc.discoveryUrl | quote }}
37-
38-
# Optional OIDC internal URL
39-
{{- if .Values.config.oidc.discoveryInternalUrl }}
40-
- name: OIDC_DISCOVERY_INTERNAL_URL
41-
value: {{ .Values.config.oidc.discoveryInternalUrl | quote }}
42-
{{- end }}
43-
44-
# Core configuration
45-
- name: WAIT_FOR_UPSTREAM
46-
value: {{ .Values.config.waitForUpstream | quote }}
47-
- name: HEALTHZ_PREFIX
48-
value: {{ .Values.config.healthzPrefix | quote }}
49-
50-
# Access control configuration
51-
- name: DEFAULT_PUBLIC
52-
value: {{ .Values.config.defaultPublic | quote }}
53-
{{- if .Values.config.privateEndpoints }}
54-
- name: PRIVATE_ENDPOINTS
55-
value: {{ .Values.config.privateEndpoints | toJson | quote }}
56-
{{- end }}
57-
{{- if .Values.config.publicEndpoints }}
58-
- name: PUBLIC_ENDPOINTS
59-
value: {{ .Values.config.publicEndpoints | toJson | quote }}
60-
{{- end }}
61-
62-
# OpenAPI configuration
63-
{{- if .Values.config.openapiSpecEndpoint }}
64-
- name: OPENAPI_SPEC_ENDPOINT
65-
value: {{ .Values.config.openapiSpecEndpoint | quote }}
66-
{{- end }}
67-
68-
# Filtering configuration
69-
{{- if .Values.config.itemsFilter.class }}
70-
- name: ITEMS_FILTER_CLS
71-
value: {{ .Values.config.itemsFilter.class | quote }}
72-
- name: ITEMS_FILTER_ARGS
73-
value: {{ .Values.config.itemsFilter.args | toJson | quote }}
74-
- name: ITEMS_FILTER_KWARGS
75-
value: {{ .Values.config.itemsFilter.kwargs | toJson | quote }}
76-
{{- end }}
77-
78-
{{- with .Values.config.extraEnv }}
79-
{{- toYaml . | nindent 12 }}
33+
{{- range $key, $value := .Values.env }}
34+
- name: {{ $key }}
35+
value: {{ $value | toJson | quote }}
8036
{{- end }}
37+
8138
{{- with .Values.nodeSelector }}
8239
nodeSelector:
8340
{{- toYaml . | nindent 8 }}

helm/values.schema.yaml

Lines changed: 33 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -148,88 +148,55 @@ properties:
148148
additionalProperties: true
149149
description: "Pod affinity rules"
150150

151-
config:
151+
env:
152152
type: object
153-
required: ["upstreamUrl", "oidc"]
153+
required: ["UPSTREAM_URL", "OIDC_DISCOVERY_URL"]
154154
properties:
155-
upstreamUrl:
155+
UPSTREAM_URL:
156156
type: string
157157
format: uri
158158
description: "STAC API URL"
159-
waitForUpstream:
159+
OIDC_DISCOVERY_URL:
160+
type: string
161+
format: uri
162+
description: "OpenID Connect discovery document URL"
163+
OIDC_DISCOVERY_INTERNAL_URL:
164+
type: string
165+
format: uri
166+
description: "Internal network OpenID Connect discovery document URL"
167+
WAIT_FOR_UPSTREAM:
160168
type: boolean
161169
description: "Wait for upstream API to become available"
162170
default: true
163-
healthzPrefix:
171+
HEALTHZ_PREFIX:
164172
type: string
165173
description: "Path prefix for health check endpoints"
166174
default: "/healthz"
167-
168-
oidc:
169-
type: object
170-
required: ["discoveryUrl"]
171-
properties:
172-
discoveryUrl:
173-
type: string
174-
format: uri
175-
description: "OpenID Connect discovery document URL"
176-
discoveryInternalUrl:
177-
type: string
178-
format: uri
179-
description: "Internal network OpenID Connect discovery document URL"
180-
181-
defaultPublic:
175+
DEFAULT_PUBLIC:
182176
type: boolean
183177
description: "Default access policy for endpoints"
184178
default: false
185-
186-
privateEndpoints:
187-
type: object
188-
additionalProperties:
189-
type: array
190-
items:
191-
type: string
192-
description: "Endpoints requiring authentication"
193-
194-
publicEndpoints:
195-
type: object
196-
additionalProperties:
197-
type: array
198-
items:
199-
type: string
200-
description: "Public endpoints when defaultPublic is false"
201-
202-
openapiSpecEndpoint:
179+
PRIVATE_ENDPOINTS:
180+
type: string
181+
description: "JSON string of endpoints requiring authentication"
182+
PUBLIC_ENDPOINTS:
183+
type: string
184+
description: "JSON string of public endpoints when DEFAULT_PUBLIC is false"
185+
OPENAPI_SPEC_ENDPOINT:
203186
type: ["string", "null"]
204187
description: "Path of OpenAPI specification"
205-
206-
itemsFilter:
207-
type: object
208-
properties:
209-
class:
210-
type: ["string", "null"]
211-
description: "CQL2 expression generator class"
212-
args:
213-
type: array
214-
description: "Positional arguments for filter class"
215-
items:
216-
type: string
217-
kwargs:
218-
type: object
219-
description: "Keyword arguments for filter class"
220-
additionalProperties: true
221-
222-
extraEnv:
223-
type: array
224-
description: "Additional environment variables"
225-
items:
226-
type: object
227-
required: ["name", "value"]
228-
properties:
229-
name:
230-
type: string
231-
value:
232-
type: string
188+
ITEMS_FILTER_CLS:
189+
type: ["string", "null"]
190+
description: "CQL2 expression generator class"
191+
ITEMS_FILTER_ARGS:
192+
type: string
193+
description: "JSON string of positional arguments for filter class"
194+
default: "[]"
195+
ITEMS_FILTER_KWARGS:
196+
type: string
197+
description: "JSON string of keyword arguments for filter class"
198+
default: "{}"
199+
233200

234201
serviceAccount:
235202
type: object

helm/values.yaml

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,45 +46,37 @@ nodeSelector: {}
4646
tolerations: []
4747
affinity: {}
4848

49-
# Application configuration
50-
config:
51-
# Core Configuration
52-
upstreamUrl: "" # Required: STAC API URL
53-
waitForUpstream: true # Optional: wait for upstream API
54-
healthzPrefix: "/healthz" # Optional: health check prefix
55-
56-
# Authentication Configuration
57-
oidc:
58-
discoveryUrl: "" # Required: OpenID Connect discovery URL
59-
discoveryInternalUrl: "" # Optional: internal network OIDC URL
60-
61-
# Access Control
62-
defaultPublic: false # Optional: default access policy
63-
privateEndpoints: # Optional: endpoints requiring auth
64-
"^/collections$": ["POST"]
65-
"^/collections/([^/]+)$": ["PUT", "PATCH", "DELETE"]
66-
"^/collections/([^/]+)/items$": ["POST"]
67-
"^/collections/([^/]+)/items/([^/]+)$": ["PUT", "PATCH", "DELETE"]
68-
"^/collections/([^/]+)/bulk_items$": ["POST"]
69-
publicEndpoints: # Optional: public endpoints
70-
"^/api.html$": ["GET"]
71-
"^/api$": ["GET"]
72-
"^/docs/oauth2-redirect": ["GET"]
73-
"^/healthz": ["GET"]
74-
75-
# OpenAPI Configuration
76-
openapiSpecEndpoint: null # Optional: OpenAPI spec path
77-
78-
# Filtering Configuration
79-
itemsFilter:
80-
class: null # Optional: CQL2 expression generator class
81-
args: [] # Optional: positional arguments
82-
kwargs: {} # Optional: keyword arguments
49+
# Environment variables for the application
50+
env:
51+
# Required configuration
52+
UPSTREAM_URL: "" # STAC API URL
53+
OIDC_DISCOVERY_URL: "" # OpenID Connect discovery URL
54+
55+
# Optional configuration
56+
WAIT_FOR_UPSTREAM: true
57+
HEALTHZ_PREFIX: "/healthz"
58+
OIDC_DISCOVERY_INTERNAL_URL: ""
59+
DEFAULT_PUBLIC: false
60+
PRIVATE_ENDPOINTS: |
61+
{
62+
"^/collections$": ["POST"],
63+
"^/collections/([^/]+)$": ["PUT", "PATCH", "DELETE"],
64+
"^/collections/([^/]+)/items$": ["POST"],
65+
"^/collections/([^/]+)/items/([^/]+)$": ["PUT", "PATCH", "DELETE"],
66+
"^/collections/([^/]+)/bulk_items$": ["POST"]
67+
}
68+
PUBLIC_ENDPOINTS: |
69+
{
70+
"^/api.html$": ["GET"],
71+
"^/api$": ["GET"],
72+
"^/docs/oauth2-redirect": ["GET"],
73+
"^/healthz": ["GET"]
74+
}
75+
OPENAPI_SPEC_ENDPOINT: null
76+
ITEMS_FILTER_CLS: null
77+
ITEMS_FILTER_ARGS: "[]"
78+
ITEMS_FILTER_KWARGS: "{}"
8379

84-
# Additional environment variables
85-
extraEnv: []
86-
# - name: CUSTOM_VAR
87-
# value: "custom-value"
8880

8981
serviceAccount:
9082
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)