Skip to content

Commit 3527665

Browse files
committed
Clean up hydra configuration needed for upgrade
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent eee29ee commit 3527665

2 files changed

Lines changed: 20 additions & 14 deletions

File tree

k8s/cloud/base/ory_auth/hydra/hydra_config.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,7 @@ data:
99
serve:
1010
cookies:
1111
same_site_mode: Strict
12-
tls:
13-
enabled: true
14-
cert:
15-
path: /certs/server.crt
16-
key:
17-
path: /certs/server.key
18-
urls:
19-
self:
20-
issuer: https://hydra.plc.svc.cluster.local:4444
21-
public: https://hydra.plc.svc.cluster.local:4444
22-
admin: https://hydra.plc.svc.cluster.local:4445
12+
2313
oidc:
2414
subject_identifiers:
2515
supported_types:

k8s/cloud/base/ory_auth/hydra/hydra_deployment.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ spec:
3434
envFrom:
3535
- configMapRef:
3636
name: pl-db-config
37+
- configMapRef:
38+
name: pl-ory-service-config
3739
env:
3840
- name: PL_POSTGRES_USERNAME
3941
valueFrom:
@@ -86,6 +88,8 @@ spec:
8688
envFrom:
8789
- configMapRef:
8890
name: pl-db-config
91+
- configMapRef:
92+
name: pl-ory-service-config
8993
- configMapRef:
9094
name: pl-domain-config
9195
env:
@@ -112,6 +116,12 @@ spec:
112116
- name: DSN
113117
# yamllint disable-line rule:line-length
114118
value: postgres://$(PL_POSTGRES_USERNAME):$(PL_POSTGRES_PASSWORD)@$(PL_POSTGRES_HOSTNAME):$(PL_POSTGRES_PORT)/$(PL_POSTGRES_DB)?sslmode=disable&max_conns=20&max_idle_conns=4
119+
- name: SERVE_TLS_ENABLED
120+
value: "true"
121+
- name: SERVE_TLS_CERT_PATH
122+
value: /certs/server.crt
123+
- name: SERVE_TLS_KEY_PATH
124+
value: /certs/server.key
115125
- name: PL_WORK_DOMAIN
116126
value: work.$(PL_DOMAIN_NAME)
117127
- name: PL_OAUTH_DOMAIN
@@ -128,6 +138,10 @@ spec:
128138
value: $(HYDRA_URL)
129139
- name: URLS_SELF_ISSUER
130140
value: $(HYDRA_URL)
141+
# admin is not exposed to Pixie clients. Requests to this endpoint originate
142+
# from Pixie services.
143+
- name: URLS_SELF_ADMIN
144+
value: $(PL_HYDRA_ADMIN_HOST)
131145
ports:
132146
- containerPort: 4444
133147
- containerPort: 4445
@@ -152,7 +166,7 @@ spec:
152166
image: docker.io/ddelnano/hydra:v2.3.0-alpine-go1.23@sha256:371daf5cc7477ae607d1011440da784c366b74c7cc8acea2322826b82c789fe1
153167
command: ['sh', '-c', 'set -x;
154168
echo "Waiting for hydra to be ready";
155-
URL="https://localhost:4445/health/ready";
169+
URL="${PL_HYDRA_ADMIN_HOST}/health/ready";
156170
until [
157171
$(wget --no-check-certificate --spider --quiet --server-response ${URL} 2>&1 |
158172
awk ''NR==1{print $2}'') -eq 200
@@ -161,7 +175,7 @@ spec:
161175
sleep 2;
162176
done;
163177

164-
count=$(hydra list oauth2-clients -e https://localhost:4445 --skip-tls-verify --format json | jq ".items | length");
178+
count=$(hydra list oauth2-clients -e ${PL_HYDRA_ADMIN_HOST} --skip-tls-verify --format json | jq ".items | length");
165179
success=$?;
166180
if [ $success -ne 0 ]; then
167181
echo "Error checking for existing client";
@@ -175,7 +189,7 @@ spec:
175189

176190
echo "Creating OAuth2 client";
177191
hydra create oauth2-client
178-
--endpoint https://localhost:4445
192+
--endpoint ${PL_HYDRA_ADMIN_HOST}
179193
--secret "${HYDRA_CLIENT_SECRET}"
180194
--format json
181195
--skip-tls-verify
@@ -198,6 +212,8 @@ spec:
198212
envFrom:
199213
- configMapRef:
200214
name: pl-domain-config
215+
- configMapRef:
216+
name: pl-ory-service-config
201217
env:
202218
- name: HYDRA_CLIENT_SECRET
203219
valueFrom:

0 commit comments

Comments
 (0)