Remove not required file
[multicloud/k8s.git] / kud / tests / sdwan / sdwan-openwrt-ovn.yml
1 ---
2 apiVersion: v1
3 kind: ConfigMap
4 metadata:
5   name: sdwan-config-ovn
6 data:
7   entrypoint.sh: |
8     #!/bin/bash
9     # Always exit on errors.
10     set -e
11
12     interface0=net0
13     ipaddr0=`ifconfig $interface0 | awk '/inet/{print $2}' | cut -f2 -d ":" | awk 'NR==1 {print $1}'`
14
15     interface1=net1
16     ipaddr1=`ifconfig $interface1 | awk '/inet/{print $2}' | cut -f2 -d ":" | awk 'NR==1 {print $1}'`
17
18     net_config=/etc/config/network
19     cat >> $net_config << EOF
20     config interface 'wan'
21         option ifname '$interface0'
22         option proto 'static'
23         option ipaddr '$ipaddr0'
24         option netmask '255.255.255.0'
25
26     config interface 'wanb'
27         option ifname '$interface1'
28         option proto 'static'
29         option ipaddr '$ipaddr1'
30         option netmask '255.255.255.0'
31     EOF
32
33     /sbin/procd &
34     /sbin/ubusd &
35     iptables -S
36     sleep 1
37     /etc/init.d/rpcd start
38     /etc/init.d/dnsmasq start
39     /etc/init.d/network start
40     /etc/init.d/odhcpd start
41     /etc/init.d/uhttpd start
42     /etc/init.d/log start
43     /etc/init.d/dropbear start
44     /etc/init.d/mwan3 restart
45
46     echo "Entering sleep... (success)"
47
48     # Sleep forever.
49     while true; do sleep 100; done
50
51 ---
52 apiVersion: v1
53 kind: Pod
54 metadata:
55   name: sdwan-ovn-pod
56   annotations:
57     k8s.v1.cni.cncf.io/networks: '[{ "name": "ovn-networkobj"}]'
58     k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [{ "name": "ovn-port-net", "interface": "net0" , "defaultGateway": "false"},
59        { "name": "ovn-priv-net", "interface": "net1" , "defaultGateway": "false"}]}'
60 spec:
61   containers:
62   - name: sdwan-ovn-pod
63     image: hle2/openwrt-1806-mwan3:v0.1.0
64     ports:
65       - containerPort: 22
66       - containerPort: 80
67     command:
68     - /bin/sh
69     - /init/entrypoint.sh
70     imagePullPolicy: IfNotPresent
71     securityContext:
72       privileged: true
73     volumeMounts:
74       - name: entrypoint-sh
75         mountPath: /init
76   volumes:
77     - name: entrypoint-sh
78       configMap:
79         name: sdwan-config-ovn
80         items:
81         - key: entrypoint.sh
82           path: entrypoint.sh