blob: 5d016f58dcd30016732c720363e74ca36458a676 [file] [log] [blame]
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -07001# Copyright 2019-present Open Networking Foundation
2#
Jeremy Ronquillo5263c732020-10-13 09:42:19 -07003# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -07004
5---
6apiVersion: "k8s.cni.cncf.io/v1"
7kind: NetworkAttachmentDefinition
8metadata:
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -07009 name: core-net
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070010spec:
11 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050012 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070013 "type": "simpleovs",
14 "ipam": {
15 "type": "static"
16 }
17 }'
18---
19apiVersion: "k8s.cni.cncf.io/v1"
20kind: NetworkAttachmentDefinition
21metadata:
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -070022 name: access-net
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070023spec:
24 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050025 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070026 "type": "simpleovs",
27 "ipam": {
28 "type": "static"
29 }
30 }'
31---
32apiVersion: "k8s.cni.cncf.io/v1"
33kind: NetworkAttachmentDefinition
34metadata:
35 name: enb-net
36spec:
37 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050038 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070039 "type": "simpleovs",
40 "ipam": {
41 "type": "static"
42 }
43 }'
44---
45apiVersion: v1
46kind: Pod
47metadata:
48 name: router
49 labels:
50 app: router
51 annotations:
52 k8s.v1.cni.cncf.io/networks: '[
Hyunsun84f0f172020-09-23 15:40:08 -050053 { "name": "core-net", "interface": "core-rtr", "ips": ["192.168.250.1/24"] },
54 { "name": "enb-net", "interface": "enb-rtr", "ips": ["192.168.251.1/24"] },
55 { "name": "access-net", "interface": "access-rtr", "ips": ["192.168.252.1/24"] }
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070056 ]'
57spec:
58 containers:
59 - name: quagga
60 command: ["/bin/bash", "-c"]
61 args:
62 - >
63 sysctl -w net.ipv4.ip_forward=1;
64 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
65 trap : TERM INT; sleep infinity & wait
66 image: opencord/quagga
67 securityContext:
68 privileged: true
69 capabilities:
70 add:
71 - NET_ADMIN
72 ports:
73 - containerPort: 2601