blob: 89dbf50eaf7850b51cc20de695d5347a074616ef [file] [log] [blame]
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -07001# Copyright 2019-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15---
16apiVersion: "k8s.cni.cncf.io/v1"
17kind: NetworkAttachmentDefinition
18metadata:
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -070019 name: core-net
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070020spec:
21 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050022 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070023 "type": "simpleovs",
24 "ipam": {
25 "type": "static"
26 }
27 }'
28---
29apiVersion: "k8s.cni.cncf.io/v1"
30kind: NetworkAttachmentDefinition
31metadata:
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -070032 name: access-net
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070033spec:
34 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050035 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070036 "type": "simpleovs",
37 "ipam": {
38 "type": "static"
39 }
40 }'
41---
42apiVersion: "k8s.cni.cncf.io/v1"
43kind: NetworkAttachmentDefinition
44metadata:
45 name: enb-net
46spec:
47 config: '{
Hyunsun84f0f172020-09-23 15:40:08 -050048 "cniVersion": "0.3.1",
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070049 "type": "simpleovs",
50 "ipam": {
51 "type": "static"
52 }
53 }'
54---
55apiVersion: v1
56kind: Pod
57metadata:
58 name: router
59 labels:
60 app: router
61 annotations:
62 k8s.v1.cni.cncf.io/networks: '[
Hyunsun84f0f172020-09-23 15:40:08 -050063 { "name": "core-net", "interface": "core-rtr", "ips": ["192.168.250.1/24"] },
64 { "name": "enb-net", "interface": "enb-rtr", "ips": ["192.168.251.1/24"] },
65 { "name": "access-net", "interface": "access-rtr", "ips": ["192.168.252.1/24"] }
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070066 ]'
67spec:
68 containers:
69 - name: quagga
70 command: ["/bin/bash", "-c"]
71 args:
72 - >
73 sysctl -w net.ipv4.ip_forward=1;
74 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
75 trap : TERM INT; sleep infinity & wait
76 image: opencord/quagga
77 securityContext:
78 privileged: true
79 capabilities:
80 add:
81 - NET_ADMIN
82 ports:
83 - containerPort: 2601