Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 1 | # 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. |
Hyunsun Moon | 89886f1 | 2019-09-05 22:16:09 -0600 | [diff] [blame] | 14 | |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 15 | --- |
Hyunsun Moon | 623ad54 | 2019-09-07 14:30:23 -0600 | [diff] [blame] | 16 | apiVersion: "k8s.cni.cncf.io/v1" |
| 17 | kind: NetworkAttachmentDefinition |
| 18 | metadata: |
| 19 | name: sgi-net |
| 20 | spec: |
| 21 | config: '{ |
| 22 | "type": "simpleovs", |
| 23 | "ipam": { |
| 24 | "type": "static" |
| 25 | } |
| 26 | }' |
| 27 | --- |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 28 | apiVersion: v1 |
| 29 | kind: Pod |
| 30 | metadata: |
| 31 | name: router |
| 32 | labels: |
Hyunsun Moon | 89886f1 | 2019-09-05 22:16:09 -0600 | [diff] [blame] | 33 | app: router |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 34 | annotations: |
| 35 | k8s.v1.cni.cncf.io/networks: '[ |
Woojoong Kim | 5220aeb | 2020-02-12 13:27:15 -0800 | [diff] [blame] | 36 | { "name": "sgi-net", "interface": "sgi-rtr", "ips": "192.168.250.250/24" } |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 37 | ]' |
| 38 | spec: |
| 39 | containers: |
| 40 | - name: quagga |
| 41 | command: ["/bin/bash", "-c"] |
| 42 | args: |
| 43 | - > |
Woojoong Kim | 68b57e7 | 2019-10-16 14:19:55 -0700 | [diff] [blame] | 44 | sysctl -w net.ipv4.ip_forward=1; |
| 45 | iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 46 | trap : TERM INT; sleep infinity & wait |
| 47 | image: opencord/quagga |
| 48 | securityContext: |
Woojoong Kim | 68b57e7 | 2019-10-16 14:19:55 -0700 | [diff] [blame] | 49 | privileged: true |
Hyunsun Moon | 81c8e23 | 2019-05-21 03:40:22 -0600 | [diff] [blame] | 50 | capabilities: |
| 51 | add: |
| 52 | - NET_ADMIN |
| 53 | ports: |
| 54 | - containerPort: 2601 |