Skip to content

Commit

Permalink
coordinator: add ipAddress for pod's veth0
Browse files Browse the repository at this point in the history
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
  • Loading branch information
cyclinder committed Jun 14, 2024
1 parent b98c189 commit 2aef736
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/coordinator/cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ func (c *coordinator) setupVeth(logger *zap.Logger, containerID string) error {
return err
}

// set an address to veth to fix work with istio
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 IPAddress to veth0: %v", err)
}

if err := netlink.LinkSetUp(link); err != nil {
return fmt.Errorf("failed to set %q UP: %v", containerInterface.Name, err)
}
Expand Down

0 comments on commit 2aef736

Please sign in to comment.