Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 2 | # |
Jeremy Ronquillo | 5263c73 | 2020-10-13 09:42:19 -0700 | [diff] [blame] | 3 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 4 | |
| 5 | --- |
| 6 | apiVersion: "k8s.cni.cncf.io/v1" |
| 7 | kind: NetworkAttachmentDefinition |
| 8 | metadata: |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 9 | name: core-net |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 10 | spec: |
| 11 | config: '{ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 12 | "cniVersion": "0.3.1", |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 13 | "type": "simpleovs", |
| 14 | "ipam": { |
| 15 | "type": "static" |
| 16 | } |
| 17 | }' |
| 18 | --- |
| 19 | apiVersion: "k8s.cni.cncf.io/v1" |
| 20 | kind: NetworkAttachmentDefinition |
| 21 | metadata: |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 22 | name: access-net |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 23 | spec: |
| 24 | config: '{ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 25 | "cniVersion": "0.3.1", |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 26 | "type": "simpleovs", |
| 27 | "ipam": { |
| 28 | "type": "static" |
| 29 | } |
| 30 | }' |
| 31 | --- |
| 32 | apiVersion: "k8s.cni.cncf.io/v1" |
| 33 | kind: NetworkAttachmentDefinition |
| 34 | metadata: |
| 35 | name: enb-net |
| 36 | spec: |
| 37 | config: '{ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 38 | "cniVersion": "0.3.1", |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 39 | "type": "simpleovs", |
| 40 | "ipam": { |
| 41 | "type": "static" |
| 42 | } |
| 43 | }' |
| 44 | --- |
| 45 | apiVersion: v1 |
| 46 | kind: Pod |
| 47 | metadata: |
| 48 | name: router |
| 49 | labels: |
| 50 | app: router |
| 51 | annotations: |
| 52 | k8s.v1.cni.cncf.io/networks: '[ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 53 | { "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 Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 56 | ]' |
| 57 | spec: |
| 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 |