Skip to content

Commit 9620996

Browse files
committed
Lothlorien example w/ YAML
1 parent 5fd84d4 commit 9620996

File tree

3 files changed

+69
-43
lines changed

3 files changed

+69
-43
lines changed

examples/2regions-hrr/meshrr-lothlorien.yaml

Lines changed: 62 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: meshrr-lothlorien-conf
6+
data:
7+
meshrr.conf.yml: |+
8+
encrypted_root_pw: NOLOGIN
9+
asn: "65000"
10+
mode: ipv4rr
11+
bgpgroups:
12+
- name: MESHRR-MESH
13+
type: mesh
14+
source:
15+
sourcetype: dns
16+
hostname: meshrr-lothlorien
17+
- name: MESHRR-CLIENTS
18+
type: subtractive
19+
prefixes:
20+
- 0.0.0.0/0
21+
- name: MESHRR-UPSTREAM
22+
type: mesh
23+
source:
24+
sourcetype: dns
25+
hostname: meshrr-core
26+
max_peers: 2
27+
---
228
apiVersion: metallb.io/v1beta1
329
kind: IPAddressPool
430
metadata:
@@ -121,6 +147,15 @@ spec:
121147
emptyDir: {}
122148
- name: ssh-id
123149
emptyDir: {}
150+
- name: meshrr-conf
151+
configMap:
152+
defaultMode: 256
153+
items:
154+
- key: meshrr.conf.yml
155+
mode: 256
156+
path: meshrr.conf.yml
157+
name: meshrr-lothlorien-conf
158+
optional: false
124159
- configMap:
125160
defaultMode: 256
126161
items:
@@ -140,7 +175,11 @@ spec:
140175
mountPath: /secret/ssh/
141176
- name: config
142177
mountPath: /config/
143-
- mountPath: /opt/meshrr/overrides/juniper.conf.j2
178+
- name: meshrr-conf
179+
mountPath: /opt/meshrr/conf/meshrr.conf.yml
180+
readOnly: true
181+
subPath: meshrr.conf.yml
182+
- mountPath: /opt/meshrr/conf/juniper.conf.j2
144183
name: override-config
145184
readOnly: true
146185
subPath: juniper.conf.j2
@@ -154,17 +193,6 @@ spec:
154193
secretKeyRef:
155194
name: crpd-license
156195
key: crpd-license
157-
- name: AUTONOMOUS_SYSTEM
158-
value: '65000'
159-
- name: ENCRYPTED_ROOT_PW
160-
value: >-
161-
$6$4XN/d$QdZrrRZNL2MtGXqKuZ/mr1S5tH46eyBKTKeWGVugxfqCGjKKqH2LhP8yNoqfYwVNvc0xsd0JSl6s9epsSPB7M1
162-
- name: MESH_SERVICE_NAME
163-
value: meshrr-lothlorien
164-
- name: UPSTREAM_SERVICE_NAME
165-
value: meshrr-core
166-
- name: MESHRR_CLIENTRANGE
167-
value: 0/0
168196
containers:
169197
- name: crpd
170198
image: localhost/juniper/crpd:23.2R1.13
@@ -212,17 +240,15 @@ spec:
212240
volumeMounts:
213241
- name: ssh-id
214242
mountPath: /secret/ssh/
243+
- name: meshrr-conf
244+
mountPath: /opt/meshrr/conf/meshrr.conf.yml
245+
readOnly: true
246+
subPath: meshrr.conf.yml
215247
env:
216248
- name: POD_IP
217249
valueFrom:
218250
fieldRef:
219251
fieldPath: status.podIP
220-
- name: MESH_SERVICE_NAME
221-
value: meshrr-lothlorien
222-
- name: UPSTREAM_SERVICE_NAME
223-
value: meshrr-core
224-
- name: MESHRR_CLIENTRANGE
225-
value: 0/0
226252
affinity:
227253
nodeAffinity:
228254
requiredDuringSchedulingIgnoredDuringExecution:
@@ -269,6 +295,15 @@ spec:
269295
emptyDir: {}
270296
- name: ssh-id
271297
emptyDir: {}
298+
- name: meshrr-conf
299+
configMap:
300+
defaultMode: 256
301+
items:
302+
- key: meshrr.conf.yml
303+
mode: 256
304+
path: meshrr.conf.yml
305+
name: meshrr-lothlorien-conf
306+
optional: false
272307
- configMap:
273308
defaultMode: 256
274309
items:
@@ -288,7 +323,11 @@ spec:
288323
mountPath: /secret/ssh/
289324
- name: config
290325
mountPath: /config/
291-
- mountPath: /opt/meshrr/overrides/juniper.conf.j2
326+
- name: meshrr-conf
327+
mountPath: /opt/meshrr/conf/meshrr.conf.yml
328+
readOnly: true
329+
subPath: meshrr.conf.yml
330+
- mountPath: /opt/meshrr/conf/juniper.conf.j2
292331
name: override-config
293332
readOnly: true
294333
subPath: juniper.conf.j2
@@ -302,17 +341,6 @@ spec:
302341
secretKeyRef:
303342
name: crpd-license
304343
key: crpd-license
305-
- name: AUTONOMOUS_SYSTEM
306-
value: '65000'
307-
- name: ENCRYPTED_ROOT_PW
308-
value: >-
309-
$6$4XN/d$QdZrrRZNL2MtGXqKuZ/mr1S5tH46eyBKTKeWGVugxfqCGjKKqH2LhP8yNoqfYwVNvc0xsd0JSl6s9epsSPB7M1
310-
- name: MESH_SERVICE_NAME
311-
value: meshrr-lothlorien
312-
- name: UPSTREAM_SERVICE_NAME
313-
value: meshrr-core
314-
- name: MESHRR_CLIENTRANGE
315-
value: 0/0
316344
containers:
317345
- name: crpd
318346
image: localhost/juniper/crpd:23.2R1.13
@@ -360,17 +388,15 @@ spec:
360388
volumeMounts:
361389
- name: ssh-id
362390
mountPath: /secret/ssh/
391+
- name: meshrr-conf
392+
mountPath: /opt/meshrr/conf/meshrr.conf.yml
393+
readOnly: true
394+
subPath: meshrr.conf.yml
363395
env:
364396
- name: POD_IP
365397
valueFrom:
366398
fieldRef:
367399
fieldPath: status.podIP
368-
- name: MESH_SERVICE_NAME
369-
value: meshrr-lothlorien
370-
- name: UPSTREAM_SERVICE_NAME
371-
value: meshrr-core
372-
- name: MESHRR_CLIENTRANGE
373-
value: 0/0
374400
affinity:
375401
nodeAffinity:
376402
requiredDuringSchedulingIgnoredDuringExecution:

examples/2regions-hrr/templates/lothlorien-config.j2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
system {
22
root-authentication {
3-
encrypted-password "{{ ENCRYPTED_ROOT_PW }}"; ## SECRET-DATA
3+
encrypted-password "{{ encrypted_root_pw }}"; ## SECRET-DATA
44
}
55
login {
66
user meshrr {
@@ -40,12 +40,12 @@ groups {
4040
group MESHRR-CLIENTS {
4141
type internal;
4242
cluster {{ POD_IP }};
43-
allow {{ MESHRR_CLIENTRANGE }};
44-
}{% if UPSTREAM_SERVICE_NAME is not none %}
43+
allow [ {% for prefix in bgpgroups_subtractive['MESHRR-CLIENTS'].prefixes %}{{ prefix }} {% endfor %}];
44+
}
4545
group MESHRR-UPSTREAM {
4646
type internal;
4747
export UPSTREAM-OUT;
48-
}{% endif %}
48+
}
4949
}
5050
}
5151
}
@@ -68,7 +68,7 @@ policy-options {
6868
community INREGION-PREFERRED members 65000:102;
6969
}
7070
routing-options {
71-
autonomous-system {{ AUTONOMOUS_SYSTEM }};
71+
autonomous-system {{ asn }};
7272
router-id {{ POD_IP }};
7373
}
7474
protocols {

examples/2regions-hrr/templates/mirkwood-config.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ groups {
4141
type internal;
4242
cluster {{ POD_IP }};
4343
allow [ {% for prefix in bgpgroups_subtractive['MESHRR-CLIENTS'].prefixes %}{{ prefix }} {% endfor %}];
44-
}{% if UPSTREAM_SERVICE_NAME is not none %}
44+
}
4545
group MESHRR-UPSTREAM {
4646
type internal;
4747
export UPSTREAM-OUT;
48-
}{% endif %}
48+
}
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)