Skip to content

Commit bf1c0e1

Browse files
committed
Let's be a bit more patient.
1 parent feb8792 commit bf1c0e1

File tree

3 files changed

+63
-5
lines changed

3 files changed

+63
-5
lines changed

charts/eoapi/profiles/experimental.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ mockOidcServer:
385385
replicaCount: 1
386386
image:
387387
repository: ghcr.io/alukach/mock-oidc-server
388-
tag: latest
388+
tag: "latest"
389389
pullPolicy: IfNotPresent
390390
port: 8888
391391
clientId: "test-client"
@@ -407,7 +407,15 @@ mockOidcServer:
407407
tolerations: []
408408
affinity: {}
409409
imagePullSecrets: []
410-
extraEnv: []
410+
extraEnv:
411+
- name: MOCK_OIDC_HOST
412+
value: "0.0.0.0"
413+
- name: MOCK_OIDC_ISSUER
414+
value: "http://localhost:8080/mock-oidc"
415+
- name: MOCK_OIDC_REFRESH_TTL
416+
value: "3600"
417+
- name: MOCK_OIDC_ACCESS_TTL
418+
value: "300"
411419

412420
######################
413421
# SERVICE

charts/eoapi/templates/mock-oidc/deployment.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,30 @@ spec:
4141
- name: http
4242
containerPort: {{ .Values.mockOidcServer.port | default 8888 }}
4343
protocol: TCP
44-
livenessProbe:
44+
startupProbe:
4545
httpGet:
4646
path: /.well-known/openid-configuration
4747
port: http
4848
initialDelaySeconds: 10
49+
periodSeconds: 5
50+
failureThreshold: 12
51+
timeoutSeconds: 3
52+
livenessProbe:
53+
httpGet:
54+
path: /.well-known/openid-configuration
55+
port: http
56+
initialDelaySeconds: 30
4957
periodSeconds: 10
58+
failureThreshold: 3
59+
timeoutSeconds: 3
5060
readinessProbe:
5161
httpGet:
5262
path: /.well-known/openid-configuration
5363
port: http
5464
initialDelaySeconds: 5
5565
periodSeconds: 5
66+
failureThreshold: 3
67+
timeoutSeconds: 3
5668
{{- if .Values.mockOidcServer.resources }}
5769
resources:
5870
{{- toYaml .Values.mockOidcServer.resources | nindent 10 }}

scripts/deployment.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,48 @@ stac-auth-proxy:
9898
initContainers:
9999
- name: wait-for-mock-oidc
100100
image: busybox:1.35
101-
command: ['sh', '-c', 'until nc -z ${RELEASE_NAME}-mock-oidc-server.${NAMESPACE}.svc.cluster.local 8080; do echo waiting for mock-oidc; sleep 2; done']
101+
command: ['sh', '-c']
102+
args:
103+
- |
104+
echo "Waiting for mock OIDC server to be ready..."
105+
timeout=300
106+
elapsed=0
107+
while [ \$elapsed -lt \$timeout ]; do
108+
if nc -z ${RELEASE_NAME}-mock-oidc-server.${NAMESPACE}.svc.cluster.local 8080; then
109+
echo "Mock OIDC server port is open, checking health endpoint..."
110+
if wget -q --spider --timeout=5 "http://${RELEASE_NAME}-mock-oidc-server.${NAMESPACE}.svc.cluster.local:8080/.well-known/openid-configuration" 2>/dev/null; then
111+
echo "Mock OIDC server is ready!"
112+
exit 0
113+
else
114+
echo "Mock OIDC port open but health check failed, retrying..."
115+
fi
116+
else
117+
echo "Mock OIDC server not ready, waiting..."
118+
fi
119+
sleep 5
120+
elapsed=\$((elapsed + 5))
121+
done
122+
echo "Timeout waiting for mock OIDC server after \${timeout}s"
123+
exit 1
102124
- name: wait-for-stac
103125
image: busybox:1.35
104-
command: ['sh', '-c', 'until nc -z ${RELEASE_NAME}-stac.${NAMESPACE}.svc.cluster.local 8080; do echo waiting for stac service; sleep 2; done']
126+
command: ['sh', '-c']
127+
args:
128+
- |
129+
echo "Waiting for STAC service to be ready..."
130+
timeout=300
131+
elapsed=0
132+
while [ \$elapsed -lt \$timeout ]; do
133+
if nc -z ${RELEASE_NAME}-stac.${NAMESPACE}.svc.cluster.local 8080; then
134+
echo "STAC service is ready!"
135+
exit 0
136+
fi
137+
echo "STAC service not ready, waiting..."
138+
sleep 3
139+
elapsed=\$((elapsed + 3))
140+
done
141+
echo "Timeout waiting for STAC service after \${timeout}s"
142+
exit 1
105143
EOF
106144
helm_cmd="$helm_cmd -f $temp_values"
107145
# Configure STAC service to run without root path when behind auth proxy

0 commit comments

Comments
 (0)