Skip to content

Commit 10cb103

Browse files
committed
foo
1 parent dad8abf commit 10cb103

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

charts/eoapi/profiles/experimental.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,14 @@ stac-auth-proxy:
370370
enabled: true
371371
service:
372372
port: 8080
373-
# Wait for mock-oidc to be ready in testing scenarios
373+
# Wait for dependencies to be ready before starting stac-auth-proxy
374374
initContainers:
375375
- name: wait-for-mock-oidc
376376
image: busybox:1.35
377377
command: ['sh', '-c', 'until nc -z eoapi-mock-oidc-server.eoapi.svc.cluster.local 8080; do echo waiting for mock-oidc; sleep 2; done']
378+
- name: wait-for-stac
379+
image: busybox:1.35
380+
command: ['sh', '-c', 'until nc -z eoapi-stac.eoapi.svc.cluster.local 8080; do echo waiting for stac service; sleep 2; done']
378381
env:
379382
UPSTREAM_URL: "http://eoapi-stac:8080"
380383
# For testing one could deploy a mock OIDC server (https://github.com/alukach/mock-oidc-server)

charts/eoapi/templates/core/stac-auth-proxy-patch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ spec:
4646
fi
4747
echo "Patching deployment with initContainers..."
4848
INIT_CONTAINERS_JSON='{{ index .Values "stac-auth-proxy" "initContainers" | toJson }}'
49+
# Replace hardcoded service names and namespace with actual release name and namespace
50+
# Replace eoapi-stac.eoapi with $RELEASE_NAME-stac.$NAMESPACE
51+
# Replace eoapi-mock-oidc-server.eoapi with $RELEASE_NAME-mock-oidc-server.$NAMESPACE
52+
RELEASE_NAME="{{ .Release.Name }}"
53+
NAMESPACE_VAL="{{ .Release.Namespace }}"
54+
INIT_CONTAINERS_JSON=$(echo "$INIT_CONTAINERS_JSON" | sed "s/eoapi-stac\.eoapi/${RELEASE_NAME}-stac.${NAMESPACE_VAL}/g" | sed "s/eoapi-mock-oidc-server\.eoapi/${RELEASE_NAME}-mock-oidc-server.${NAMESPACE_VAL}/g")
4955
kubectl patch deployment "$DEPLOYMENT_NAME" -n "$NAMESPACE" --type='json' -p="[{\"op\":\"add\",\"path\":\"/spec/template/spec/initContainers\",\"value\":$INIT_CONTAINERS_JSON}]"
5056
echo "Waiting for rollout..."
5157
kubectl rollout status deployment/"$DEPLOYMENT_NAME" -n "$NAMESPACE" --timeout=300s

scripts/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,13 @@ deploy_eoapi() {
393393

394394
# Set UPSTREAM_URL and OIDC_DISCOVERY_URL dynamically for stac-auth-proxy when experimental profile is used
395395
# The experimental profile enables stac-auth-proxy, so we need to set the correct service names
396+
# Also configure STAC service to run without root path when behind auth proxy
396397
HELM_CMD="$HELM_CMD --set stac-auth-proxy.env.UPSTREAM_URL=http://$RELEASE_NAME-stac:8080"
397398
HELM_CMD="$HELM_CMD --set stac-auth-proxy.env.OIDC_DISCOVERY_URL=http://$RELEASE_NAME-mock-oidc-server.$NAMESPACE.svc.cluster.local:8080/.well-known/openid-configuration"
399+
# Note: initContainer service names are dynamically replaced by the stac-auth-proxy-patch job
400+
# Configure STAC service to run without root path when behind auth proxy
401+
# Empty string makes STAC service run at root path (no --root-path argument)
402+
HELM_CMD="$HELM_CMD --set 'stac.overrideRootPath='"
398403

399404
HELM_CMD="$HELM_CMD --set eoapi-notifier.enabled=true"
400405
HELM_CMD="$HELM_CMD --set eoapi-notifier.config.sources[0].config.connection.existingSecret.name=$RELEASE_NAME-pguser-eoapi"

scripts/deployment.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,14 @@ run_deployment() {
8686

8787
# Set UPSTREAM_URL and OIDC_DISCOVERY_URL dynamically for stac-auth-proxy when experimental profile is used
8888
# The experimental profile enables stac-auth-proxy, so we need to set the correct service names
89+
# Also configure STAC service to run without root path when behind auth proxy
8990
if [[ "$use_experimental" == "true" ]]; then
9091
helm_cmd="$helm_cmd --set stac-auth-proxy.env.UPSTREAM_URL=http://$RELEASE_NAME-stac:8080"
9192
helm_cmd="$helm_cmd --set stac-auth-proxy.env.OIDC_DISCOVERY_URL=http://$RELEASE_NAME-mock-oidc-server.$NAMESPACE.svc.cluster.local:8080/.well-known/openid-configuration"
93+
# Note: initContainer service names are dynamically replaced by the stac-auth-proxy-patch job
94+
# Configure STAC service to run without root path when behind auth proxy
95+
# Empty string makes STAC service run at root path (no --root-path argument)
96+
helm_cmd="$helm_cmd --set 'stac.overrideRootPath='"
9297
fi
9398

9499
if is_ci; then

0 commit comments

Comments
 (0)