i want to run the vyos at k8s platform. but get the below error:
but if run at container(docker). can be worker fine.
like: Vyos in containerlab switch issue
root@localhost:~# cat 3-macvlan-testpods.sh
#!/bin/bash
set -v
date
controller_node=`kubectl get nodes --no-headers -o custom-columns=NAME:.metadata.name| grep control-plane`
worker_node=`kubectl get nodes --no-headers -o custom-columns=NAME:.metadata.name| grep worker2`
cat <<EOF | kubectl apply -f -
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-whereabouts-public
spec:
config: '{
"cniVersion": "0.3.0",
"name": "whereaboutsexample",
"type": "macvlan",
"master": "enp2s0",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "10.1.5.1-10.1.5.2/24"
}
}'
EOF
cat <<EOF | kubectl apply -f -
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-whereabouts-private
spec:
config: '{
"cniVersion": "0.3.0",
"name": "whereaboutsexample",
"type": "macvlan",
"master": "enp3s0",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "10.1.8.1-10.1.8.2/24"
}
}'
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: vyos
annotations:
k8s.v1.cni.cncf.io/networks: macvlan-whereabouts-public@eth1, macvlan-whereabouts-private@eth2
spec:
containers:
- name: vyos
image: 192.168.2.100:5000/vyos/vyos:1.4.9
command: ["/sbin/init"]
volumeMounts:
- name: lib-muodules
mountPath: /lib/modules
securityContext:
privileged: true
volumes:
- name: lib-muodules
hostPath:
path: /lib/modules
nodeName: ${worker_node}
EOF
root@localhost:~#
root@vyos:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 fe80::200:ff:fe00:0/64 scope link
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host proto kernel_lo
valid_lft forever preferred_lft forever
2: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0
4: eth0@if48: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc noqueue state UP group default
link/ether 56:2f:ab:a2:33:a7 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.16.20.41/32 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::542f:abff:fea2:33a7/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
5: eth1@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 32:01:fa:76:36:b1 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.1.5.1/24 brd 10.1.5.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::3001:faff:fe76:36b1/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
6: eth2@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether e2:aa:ba:5a:4c:ec brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.1.8.1/24 brd 10.1.8.255 scope global eth2
valid_lft forever preferred_lft forever
inet6 fe80::e0aa:baff:fe5a:4cec/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
7: pim6reg@NONE: <NOARP,UP,LOWER_UP> mtu 1452 qdisc noqueue state UNKNOWN group default qlen 1000
link/pimreg
root@vyos:~#
root@vyos:~# ip r s
default via 169.254.1.1 dev eth0
10.1.5.0/24 dev eth1 proto kernel scope link src 10.1.5.1
10.1.8.0/24 dev eth2 proto kernel scope link src 10.1.8.1
169.254.1.1 dev eth0 scope link
root@vyos:~#
[edit]
vyos@vyos# set interfaces ethernet eth
Possible completions:
> ethN Ethernet interface name
>
[edit]
vyos@vyos# set interfaces ethernet eth1 address 10.1.5.1/24
[edit]
vyos@vyos# commit
[ interfaces ethernet eth1 ]
VyOS had an issue completing a command.
We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Contact us using the online help desk if you have a subscription:
https://support.vyos.io/
- Make sure you are running the latest version of VyOS available at:
https://vyos.net/get/
- Consult the community forum to see how to handle this issue:
https://forum.vyos.io
- Join us on Slack where our users exchange help and advice:
https://vyos.slack.com
When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your
business policy requires it)
- and include all the information presented below
Report time: 2024-03-10 13:23:33
Image version: VyOS 1.4-rolling-202403030008
Release train: sagitta
Built by: Luowei
Built on: Sun 03 Mar 2024 00:08 UTC
Build UUID: cb2b01af-c655-4d18-b894-336a9e816463
Build commit ID: 8c829af7b643cb
Architecture: x86_64
Boot via: installed image
System type: KVM guest
Hardware vendor: QEMU
Hardware model: Standard PC (Q35 + ICH9, 2009)
Hardware S/N:
Hardware UUID: 4e8afaf7-74a6-4d03-891c-efd355c309d2
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 388, in <module>
apply(c)
File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 376, in apply
e.update(ethernet)
File "/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py", line 461, in update
self.set_rps(dict_search('offload.rps', config) != None)
File "/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py", line 328, in set_rps
self._write_sysfs(f'/sys/class/net/{self.ifname}/queues/rx-{i}/rps_cpus', f'{rps_cpus:x}')
File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 130, in _write_sysfs
write_file(filename, str(value))
File "/usr/lib/python3/dist-packages/vyos/utils/file.py", line 69, in write_file
raise e
File "/usr/lib/python3/dist-packages/vyos/utils/file.py", line 61, in write_file
with open(fname, 'w' if not append else 'a') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: '/sys/class/net/eth1/queues/rx-0/rps_cpus'
noteworthy:
cmd 'ethtool --json --show-ring eth1'
returned (out):
[ ]
returned (err):
netlink error: Operation not supported
cmd 'ethtool --show-pause eth1'
returned (out):
returned (err):
netlink error: Operation not supported
cmd 'ethtool --show-eee eth1'
returned (out):
returned (err):
netlink error: Operation not supported
cmd 'ethtool --json --show-ring eth1'
returned (out):
[ ]
returned (err):
netlink error: Operation not supported
cmd 'ethtool --show-pause eth1'
returned (out):
returned (err):
netlink error: Operation not supported
cmd 'ethtool --show-eee eth1'
returned (out):
returned (err):
netlink error: Operation not supported
[[interfaces ethernet eth1]] failed
Commit failed
[edit]
vyos@vyos#