Skip to content

Commit

Permalink
Merge pull request spidernet-io#3588 from cyclinder/coordinator/veth_…
Browse files Browse the repository at this point in the history
…address

coordinator: add ipAddress for pod's veth0
  • Loading branch information
weizhoublue committed Jun 21, 2024
2 parents 13ecbd9 + b91c9dd commit 13c95f0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/coordinator/cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ func (c *coordinator) setupVeth(logger *zap.Logger, containerID string) error {
if err := netlink.LinkSetUp(link); err != nil {
return fmt.Errorf("failed to set %q UP: %v", containerInterface.Name, err)
}

if c.ipFamily == netlink.FAMILY_V6 {
// set an address to veth to fix work with istio
// set only when not ipv6 only
return nil
}

if err = netlink.AddrAdd(link, &netlink.Addr{
IPNet: &net.IPNet{
IP: net.ParseIP("169.254.200.1"),
Mask: net.CIDRMask(32, 32),
},
}); err != nil {
return fmt.Errorf("failed to add ip address to veth0: %v", err)
}
return nil
})

Expand Down

0 comments on commit 13c95f0

Please sign in to comment.