Skip to content

Commit 22c3529

Browse files
committed
add configurable env vars for deployment
1 parent 07fbbb2 commit 22c3529

File tree

3 files changed

+173
-1
lines changed

3 files changed

+173
-1
lines changed

helm/templates/deployment.yaml

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

helm/values.schema.yaml

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

151+
config:
152+
type: object
153+
required: ["upstreamUrl", "oidc"]
154+
properties:
155+
upstreamUrl:
156+
type: string
157+
format: uri
158+
description: "STAC API URL"
159+
waitForUpstream:
160+
type: boolean
161+
description: "Wait for upstream API to become available"
162+
default: true
163+
healthzPrefix:
164+
type: string
165+
description: "Path prefix for health check endpoints"
166+
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:
182+
type: boolean
183+
description: "Default access policy for endpoints"
184+
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:
203+
type: ["string", "null"]
204+
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
233+
151234
required:
152235
- service

helm/values.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,44 @@ containerSecurityContext:
4444

4545
nodeSelector: {}
4646
tolerations: []
47-
affinity: {}
47+
affinity: {}
48+
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
83+
84+
# Additional environment variables
85+
extraEnv: []
86+
# - name: CUSTOM_VAR
87+
# value: "custom-value"

0 commit comments

Comments
 (0)