![通过 Kubenetes POD 在主机上创建 OVS 桥](https://linux22.com/image/223843/%E9%80%9A%E8%BF%87%20Kubenetes%20POD%20%E5%9C%A8%E4%B8%BB%E6%9C%BA%E4%B8%8A%E5%88%9B%E5%BB%BA%20OVS%20%E6%A1%A5.png)
我创建了一个守护进程:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-ovs
namespace: kube-system
labels:
app: ovs
spec:
selector:
matchLabels:
name: kube-ovs
template:
metadata:
labels:
name: kube-ovs
spec:
hostNetwork: true
containers:
- name: ovs
securityContext:
privileged: true
image: openvswitch/ovs:2.11.2_debian
command: ["start-ovs"]
args:
- ovsdb-server
- --detach
- ovs-vsctl
- --no-wait
- init &&
- ovs-vswitchd
volumeMounts:
- name: ovs
mountPath: /var/run/openvswitch
- name: kernel-modules
mountPath: /lib/modules/5.4.0-88-generic
# terminationGracePeriodSeconds: 30
volumes:
- name: kernel-modules
hostPath:
path: /lib/modules/5.4.0-88-generic
- name: ovs
hostPath:
path: /var/run/openvswitch
我需要在主机(Kubernetes 节点)上创建 OVS 桥。我无法访问操作系统来安装开放开关。但Kubernetes运行在特权模式下,可以通过容器访问主机。
是否可以?