Git Product home page Git Product logo

ipvs's Introduction

ipvs - networking for containers

Test GoDoc Go Report Card

ipvs provides a native Go implementation for communicating with IPVS kernel module using a netlink socket.

Using ipvs

import (
	"log"

	"github.com/moby/ipvs"
)

func main() {
	handle, err := ipvs.New("")
	if err != nil {
		log.Fatalf("ipvs.New: %s", err)
	}
	svcs, err := handle.GetServices()
	if err != nil {
		log.Fatalf("handle.GetServices: %s", err)
	}
}

Contributing

Want to hack on ipvs? Docker's contributions guidelines apply.

Copyright and license

Copyright 2015 Docker, inc. Code released under the Apache 2.0 license.

ipvs's People

Contributors

aboch avatar akihirosuda avatar allencloud avatar amoghe avatar andrewsykim avatar calavera avatar cpuguy83 avatar ctelfer avatar daehyeok avatar daym avatar dims avatar dmcgowan avatar euanh avatar herrwagner avatar icefed avatar jdrahos avatar jsoref avatar justincormack avatar lbernail avatar mavenugo avatar mrjana avatar msabansal avatar neersighted avatar ns-jtenberge avatar selansen avatar smarkm avatar thajeztah avatar tklauser avatar vdemeester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipvs's Issues

Using this package without ipvs doesn't return error

I use you example, slightly modified;

package main

import (
	"log"

	"github.com/moby/ipvs"
)

func main() {
	handle, err := ipvs.New("")
	if err != nil {
		log.Fatalf("ipvs.New: %s", err)
	}
	log.Println("ipvs.New did NOT give an error!!")
	_, err = handle.GetServices()
	if err != nil {
		log.Fatalf("handle.GetServices: %s", err)
	}
	log.Println("handle.GetServices did NOT give an error!!")
}

And run on a kernel where ipvs is not configured. Output:

# moby-example 
WARN[0000] Running modprobe ip_vs failed with message: `modprobe: WARNING: Module ip_vs not found in directory /lib/modules/6.1.0`, error: exit status 1 
ERRO[0000] Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this is fixed. 
2022/12/23 18:09:43 ipvs.New did NOT give an error!!
2022/12/23 18:09:43 handle.GetServices did NOT give an error!!

So, that ipvs can't be loaded is obviously noted, but even so err==nil is returned.

This is a serious bug, which enforces weird work-arounds do detect if ipvs can be used:

https://github.com/Nordix/kubernetes/blob/68d78c89eccf2d2f381033c836472d53f3ba41c9/pkg/proxy/ipvs/proxier.go#L692-L694

Connections counters overflow

The active and inactive connection counters are represented by 16 bit unsigned integers in this library, even though they are returned as 32 bit values by the system. This leads to a rollover of values if more than 2^16 = 65,536 connections exist for a destination. See #24 for a fix.

Run CI on CentOS 7

A lot of Kubernetes users (using IPVS proxy) run on CentOS 7 which is based on Linux 3.10. In the past there have been compatibility issues with older kernel where certain netlink attributes do not exist. For example, for Linux < 3.18 the address family doesn't exist so we had to create some workarounds (#15 and #19). The address family compatibility issue would have been caught if we ran tests on CentOS 7.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.