osixia / docker-keepalived

Keepalived container image 🐳🌴
MIT License
403 stars 146 forks source link

Netlink: error: Operation not permitted(1), type=RTM_NEWADDR(20), seq=1563327313, pid=0 #31

Closed guang0204 closed 5 years ago

guang0204 commented 5 years ago

docker image ,How to solve this problem?

guang0204 commented 5 years ago

权限问题导致的

daveteu commented 3 years ago

什么权限?

pshizhsysu commented 2 years ago

权限不够,需要添加NET_ADMIN, NET_BROADCAST,NET_RAW 比如: 1、用docker运行

docker run --cap-add=NET_ADMIN --cap-add=NET_BROADCAST --cap-add=NET_RAW ....

2、用k8s的Pod运行

apiVersion: v1
kind: Pod
metadata:
  name: xxx
spec:
  containers:
  - name: keepalived
    image: xxxxx
    securityContext:
      capabilities:
        add: ["NET_ADMIN", "NET_BROADCAST", "NET_RAW"]
...