Skip to content

Commit 6fcfe8e

Browse files
committed
feat(#785): allow other namespaces
Updated helm-chart and scripts to allow to deploy ainari in other namespaces than the default namespace. Signed-off-by: Tobias Anker <tobias.anker@kitsunemimi.moe>
1 parent 409c289 commit 6fcfe8e

11 files changed

Lines changed: 61 additions & 49 deletions

File tree

.secrets.baseline

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"filename": "deploy/k8s/ainari/templates/dashboard/dashboard-certificate.yaml",
148148
"hashed_secret": "387096ca171f7ddf839bfa51b70c17c1c790d2d2",
149149
"is_verified": false,
150-
"line_number": 6
150+
"line_number": 20
151151
}
152152
],
153153
"deploy/k8s/ainari/templates/dashboard/dashboard-deployment.yaml": [
@@ -156,7 +156,7 @@
156156
"filename": "deploy/k8s/ainari/templates/dashboard/dashboard-deployment.yaml",
157157
"hashed_secret": "387096ca171f7ddf839bfa51b70c17c1c790d2d2",
158158
"is_verified": false,
159-
"line_number": 65
159+
"line_number": 79
160160
}
161161
],
162162
"deploy/k8s/ainari/templates/hanami/hanami-certificate.yaml": [
@@ -165,7 +165,7 @@
165165
"filename": "deploy/k8s/ainari/templates/hanami/hanami-certificate.yaml",
166166
"hashed_secret": "a1b78300299f72872366d7a0c32a5f19512c9d32",
167167
"is_verified": false,
168-
"line_number": 6
168+
"line_number": 20
169169
}
170170
],
171171
"deploy/k8s/ainari/templates/hanami/hanami-deployment.yaml": [
@@ -174,7 +174,7 @@
174174
"filename": "deploy/k8s/ainari/templates/hanami/hanami-deployment.yaml",
175175
"hashed_secret": "a1b78300299f72872366d7a0c32a5f19512c9d32",
176176
"is_verified": false,
177-
"line_number": 82
177+
"line_number": 96
178178
}
179179
],
180180
"deploy/k8s/ainari/templates/internal-api-key-secret.yaml": [
@@ -183,7 +183,7 @@
183183
"filename": "deploy/k8s/ainari/templates/internal-api-key-secret.yaml",
184184
"hashed_secret": "4bd5d8c8ea23b9df9875444c45a4c044026409b6",
185185
"is_verified": false,
186-
"line_number": 7
186+
"line_number": 21
187187
}
188188
],
189189
"deploy/k8s/ainari/templates/miko/miko-certificate.yaml": [
@@ -192,7 +192,7 @@
192192
"filename": "deploy/k8s/ainari/templates/miko/miko-certificate.yaml",
193193
"hashed_secret": "298bddaea9b4590f81a8c8c5629e7a6417415c64",
194194
"is_verified": false,
195-
"line_number": 6
195+
"line_number": 20
196196
}
197197
],
198198
"deploy/k8s/ainari/templates/miko/miko-deployment.yaml": [
@@ -201,14 +201,14 @@
201201
"filename": "deploy/k8s/ainari/templates/miko/miko-deployment.yaml",
202202
"hashed_secret": "a8fd869cf678cfd350b2aa8fb2bc4e030c75e11d",
203203
"is_verified": false,
204-
"line_number": 66
204+
"line_number": 80
205205
},
206206
{
207207
"type": "Secret Keyword",
208208
"filename": "deploy/k8s/ainari/templates/miko/miko-deployment.yaml",
209209
"hashed_secret": "298bddaea9b4590f81a8c8c5629e7a6417415c64",
210210
"is_verified": false,
211-
"line_number": 72
211+
"line_number": 86
212212
}
213213
],
214214
"deploy/k8s/ainari/templates/omamori/omamori-certificate.yaml": [
@@ -217,7 +217,7 @@
217217
"filename": "deploy/k8s/ainari/templates/omamori/omamori-certificate.yaml",
218218
"hashed_secret": "b42d97659f427e4287f30f0cd8bdc2ac5d3b10b5",
219219
"is_verified": false,
220-
"line_number": 6
220+
"line_number": 20
221221
}
222222
],
223223
"deploy/k8s/ainari/templates/omamori/omamori-config.yaml": [
@@ -226,7 +226,7 @@
226226
"filename": "deploy/k8s/ainari/templates/omamori/omamori-config.yaml",
227227
"hashed_secret": "88066d49d453bb7bb3cefca34e9d5d9b08a0dca8",
228228
"is_verified": false,
229-
"line_number": 5
229+
"line_number": 19
230230
}
231231
],
232232
"deploy/k8s/ainari/templates/omamori/omamori-deployment.yaml": [
@@ -235,16 +235,16 @@
235235
"filename": "deploy/k8s/ainari/templates/omamori/omamori-deployment.yaml",
236236
"hashed_secret": "b42d97659f427e4287f30f0cd8bdc2ac5d3b10b5",
237237
"is_verified": false,
238-
"line_number": 77
238+
"line_number": 91
239239
}
240240
],
241-
"deploy/k8s/ainari/templates/onsen/onsen-deployment.yaml": [
241+
"deploy/k8s/ainari/templates/onsen/onsen-statefulset.yaml": [
242242
{
243243
"type": "Secret Keyword",
244-
"filename": "deploy/k8s/ainari/templates/onsen/onsen-deployment.yaml",
244+
"filename": "deploy/k8s/ainari/templates/onsen/onsen-statefulset.yaml",
245245
"hashed_secret": "a191d9cb43e3f682b350dcdc74b2167ff78ed3b4",
246246
"is_verified": false,
247-
"line_number": 80
247+
"line_number": 94
248248
}
249249
],
250250
"deploy/k8s/ainari/templates/ryokan/ryokan-certificate.yaml": [
@@ -253,7 +253,7 @@
253253
"filename": "deploy/k8s/ainari/templates/ryokan/ryokan-certificate.yaml",
254254
"hashed_secret": "04f5ffaec2d0437e26b1e224de6915e15247989f",
255255
"is_verified": false,
256-
"line_number": 6
256+
"line_number": 20
257257
}
258258
],
259259
"deploy/k8s/ainari/templates/ryokan/ryokan-deployment.yaml": [
@@ -262,14 +262,14 @@
262262
"filename": "deploy/k8s/ainari/templates/ryokan/ryokan-deployment.yaml",
263263
"hashed_secret": "04f5ffaec2d0437e26b1e224de6915e15247989f",
264264
"is_verified": false,
265-
"line_number": 94
265+
"line_number": 108
266266
},
267267
{
268268
"type": "Secret Keyword",
269269
"filename": "deploy/k8s/ainari/templates/ryokan/ryokan-deployment.yaml",
270270
"hashed_secret": "8ecbfb09891f75ade7c286346fe355113e680af7",
271271
"is_verified": false,
272-
"line_number": 100
272+
"line_number": 114
273273
}
274274
],
275275
"deploy/k8s/ainari/templates/sakura/sakura-certificate.yaml": [
@@ -278,23 +278,23 @@
278278
"filename": "deploy/k8s/ainari/templates/sakura/sakura-certificate.yaml",
279279
"hashed_secret": "1db3a3e51c405b71091fd7885f714805187b5785",
280280
"is_verified": false,
281-
"line_number": 6
281+
"line_number": 20
282282
}
283283
],
284-
"deploy/k8s/ainari/templates/sakura/sakura-deployment.yaml": [
284+
"deploy/k8s/ainari/templates/sakura/sakura-statefulset.yaml": [
285285
{
286286
"type": "Secret Keyword",
287-
"filename": "deploy/k8s/ainari/templates/sakura/sakura-deployment.yaml",
287+
"filename": "deploy/k8s/ainari/templates/sakura/sakura-statefulset.yaml",
288288
"hashed_secret": "1db3a3e51c405b71091fd7885f714805187b5785",
289289
"is_verified": false,
290-
"line_number": 90
290+
"line_number": 130
291291
},
292292
{
293293
"type": "Secret Keyword",
294-
"filename": "deploy/k8s/ainari/templates/sakura/sakura-deployment.yaml",
294+
"filename": "deploy/k8s/ainari/templates/sakura/sakura-statefulset.yaml",
295295
"hashed_secret": "845e1c68668309b563d8a17950b9529de8b3616e",
296296
"is_verified": false,
297-
"line_number": 96
297+
"line_number": 136
298298
}
299299
],
300300
"deploy/k8s/ainari/templates/torii/torii-certificate.yaml": [
@@ -303,7 +303,7 @@
303303
"filename": "deploy/k8s/ainari/templates/torii/torii-certificate.yaml",
304304
"hashed_secret": "88f7f6dda5e81f2e7958ef4d21771d2c66f2351a",
305305
"is_verified": false,
306-
"line_number": 6
306+
"line_number": 20
307307
}
308308
],
309309
"deploy/k8s/ainari/templates/torii/torii-deployment.yaml": [
@@ -312,7 +312,7 @@
312312
"filename": "deploy/k8s/ainari/templates/torii/torii-deployment.yaml",
313313
"hashed_secret": "88f7f6dda5e81f2e7958ef4d21771d2c66f2351a",
314314
"is_verified": false,
315-
"line_number": 77
315+
"line_number": 91
316316
}
317317
],
318318
"deploy/k8s/wg_gen.py": [
@@ -321,21 +321,21 @@
321321
"filename": "deploy/k8s/wg_gen.py",
322322
"hashed_secret": "a191d9cb43e3f682b350dcdc74b2167ff78ed3b4",
323323
"is_verified": false,
324-
"line_number": 36
324+
"line_number": 37
325325
},
326326
{
327327
"type": "Secret Keyword",
328328
"filename": "deploy/k8s/wg_gen.py",
329329
"hashed_secret": "8ecbfb09891f75ade7c286346fe355113e680af7",
330330
"is_verified": false,
331-
"line_number": 41
331+
"line_number": 42
332332
},
333333
{
334334
"type": "Secret Keyword",
335335
"filename": "deploy/k8s/wg_gen.py",
336336
"hashed_secret": "845e1c68668309b563d8a17950b9529de8b3616e",
337337
"is_verified": false,
338-
"line_number": 42
338+
"line_number": 43
339339
}
340340
],
341341
"docs/deployer/config/omamori_config.md": [
@@ -604,5 +604,5 @@
604604
}
605605
]
606606
},
607-
"generated_at": "2025-12-20T19:40:52Z"
607+
"generated_at": "2026-01-04T15:26:24Z"
608608
}

deploy/k8s/ainari/templates/hanami/hanami-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ data:
3131
file_path = "/etc/ainari/hanami/hanami_db"
3232
3333
[miko]
34-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
34+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3535
3636
kind: ConfigMap

deploy/k8s/ainari/templates/miko/miko-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ data:
3535
3636
[endpoints.hanami]
3737
public_address = "https://{{ .Values.hanami.api.domain }}:443"
38-
internal_address = "https://hanami-tls-service.default.svc.cluster.local:8443"
38+
internal_address = "https://hanami-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3939
4040
[endpoints.ryokan]
4141
public_address = "https://{{ .Values.ryokan.api.domain }}:443"
42-
internal_address = "https://ryokan-tls-service.default.svc.cluster.local:8443"
42+
internal_address = "https://ryokan-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
4343
4444
[endpoints.torii]
4545
public_address = "https://{{ .Values.torii.api.domain }}:443"
46-
internal_address = "https://torii-tls-service.default.svc.cluster.local:8443"
46+
internal_address = "https://torii-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
4747
4848
[endpoints.omamori]
4949
public_address = "https://{{ .Values.omamori.api.domain }}:443"
50-
internal_address = "https://omamori-tls-service.default.svc.cluster.local:8443"
50+
internal_address = "https://omamori-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
5151
5252
kind: ConfigMap

deploy/k8s/ainari/templates/miko/miko-nginx-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ data:
9696
{
9797
listen 80;
9898
server_tokens off;
99-
server_name miko-tls-service.default.svc.cluster.local";
99+
server_name miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local";
100100
return 301 https://$host$request_uri;
101101
}
102102
103103
server
104104
{
105105
server_tokens off;
106-
server_name miko-tls-service.default.svc.cluster.local";
106+
server_name miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local";
107107
108108
listen 8443 ssl;
109109
listen [::]:8443 ssl;
@@ -155,7 +155,7 @@ data:
155155
156156
proxy_pass http://127.0.0.1:11417/;
157157
proxy_read_timeout 180;
158-
proxy_redirect http://127.0.0.1:11417 https://miko-tls-service.default.svc.cluster.local";
158+
proxy_redirect http://127.0.0.1:11417 https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local";
159159
}
160160
}
161161
}

deploy/k8s/ainari/templates/omamori/omamori-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ data:
3131
file_path = "/etc/ainari/omamori/omamori_db"
3232
3333
[miko]
34-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
34+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3535
3636
[simple_crypto]
3737
key_b64 = "q9vN4CjOQm5wKzyzjZtS7t4oQp8oQK1JvU5xgq8vFzE="

deploy/k8s/ainari/templates/onsen/onsen-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ data:
2626
location = "/tmp/onsen"
2727
2828
[miko]
29-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
29+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3030
3131
kind: ConfigMap

deploy/k8s/ainari/templates/ryokan/ryokan-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ data:
3434
file_path = "/etc/ainari/ryokan/ryokan_db"
3535
3636
[miko]
37-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
37+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3838
3939
kind: ConfigMap

deploy/k8s/ainari/templates/sakura/sakura-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ data:
2020
debug = true
2121
log_path = ""
2222
skip_tls_verification = true
23-
address = "https://sakura-tls-service.default.svc.cluster.local:8443"
23+
address = "https://sakura-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
2424
2525
[processing]
2626
max_number_of_threads = {{ .Values.sakura.processing.max_number_of_threads }}
@@ -38,6 +38,6 @@ data:
3838
file_path = "/etc/ainari/sakura/sakura_db"
3939
4040
[miko]
41-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
41+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
4242
4343
kind: ConfigMap

deploy/k8s/ainari/templates/torii/torii-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ data:
3131
file_path = "/etc/ainari/torii/torii_db"
3232
3333
[miko]
34-
address = "https://miko-tls-service.default.svc.cluster.local:8443"
34+
address = "https://miko-tls-service.{{ .Release.Namespace }}.svc.cluster.local:8443"
3535
3636
[ports]
3737
min_port = {{ .Values.torii.port_range.start }}

deploy/k8s/wg_gen.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
- pip install jinja2
1212
1313
Usage:
14-
python wg_k8s_gen.py
15-
(edit the CONFIG section below for endpoints, clients, namespace, etc.)
14+
python wg_k8s_gen.py --namespace $NAMESPACE
15+
(edit the CONFIG section below for endpoints, clients, etc.)
1616
"""
1717

18+
import argparse
1819
import subprocess
1920
import sys
2021
from jinja2 import Template
@@ -23,7 +24,7 @@
2324
# CONFIG (edit as needed)
2425
# ----------------------------
2526
NAMESPACE = "default"
26-
SERVER_ENDPOINT = "wg-onsen.default.svc.cluster.local:51820" # used in client Peer Endpoint
27+
SERVER_ENDPOINT = f"wg-onsen.{NAMESPACE}.svc.cluster.local:51820" # used in client Peer Endpoint
2728
NETWORK = "10.10.0."
2829
NETWORK_MASK = "/24"
2930

@@ -121,6 +122,13 @@ def k8s_create_secret_from_string(secret_name: str, key_name: str, content: str,
121122
# Main flow
122123
# ----------------------------
123124
def main():
125+
parser = argparse.ArgumentParser()
126+
parser.add_argument('--namespace', dest='namespace', type=str)
127+
args = parser.parse_args()
128+
129+
NAMESPACE = args.namespace
130+
SERVER_ENDPOINT = f"wg-onsen.{NAMESPACE}.svc.cluster.local:51820"
131+
124132
# 1) Generate server keypair
125133
print("Generating server keypair...")
126134
server_priv, server_pub = gen_keypair()

0 commit comments

Comments
 (0)