mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-12-07 21:01:38 +01:00
services-controller: Add LoadBalancer Service support (#53)
* Allow LoadBalancer Service type * Update docs
This commit is contained in:
parent
537cacc5c8
commit
a3bddf6ecd
@ -120,10 +120,10 @@ leverages standard Linux technologies **iptables, ipvs/lvs, ipset, iproute2**
|
||||
[Kubernetes network services proxy with IPVS/LVS](https://cloudnativelabs.github.io/post/2017-05-10-kube-network-service-proxy/)
|
||||
|
||||
Kube-router uses IPVS/LVS technology built in Linux to provide L4 load
|
||||
balancing. Each **ClusterIP** and **NodePort** Kubernetes Service type is
|
||||
configured as an IPVS virtual service. Each Service Endpoint is configured as
|
||||
real server to the virtual service. The standard **ipvsadm** tool can be used
|
||||
to verify the configuration and monitor the active connections.
|
||||
balancing. Each **ClusterIP**, **NodePort**, and **LoadBalancer** Kubernetes
|
||||
Service type is configured as an IPVS virtual service. Each Service Endpoint is
|
||||
configured as real server to the virtual service. The standard **ipvsadm** tool
|
||||
can be used to verify the configuration and monitor the active connections.
|
||||
|
||||
Below is example set of Services on Kubernetes:
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ func (nrc *NetworkRoutingController) Run(stopCh <-chan struct{}, wg *sync.WaitGr
|
||||
if nrc.advertiseClusterIp {
|
||||
glog.Infof("Advertising cluster ips")
|
||||
for _, svc := range watchers.ServiceWatcher.List() {
|
||||
if svc.Spec.Type == "ClusterIP" || svc.Spec.Type == "NodePort" {
|
||||
if svc.Spec.Type == "ClusterIP" || svc.Spec.Type == "NodePort" || svc.Spec.Type == "LoadBalancer" {
|
||||
|
||||
// skip headless services
|
||||
if svc.Spec.ClusterIP == "None" || svc.Spec.ClusterIP == "" {
|
||||
|
||||
@ -34,7 +34,7 @@ var (
|
||||
)
|
||||
|
||||
// Network services controller enables local node as network service proxy through IPVS/LVS.
|
||||
// Support only Kuberntes network services of type NodePort, ClusterIP. For each service a
|
||||
// Support only Kubernetes network services of type NodePort, ClusterIP, and LoadBalancer. For each service a
|
||||
// IPVS service is created and for each service endpoint a server is added to the IPVS service.
|
||||
// As services and endpoints are updated, network service controller gets the updates from
|
||||
// the kubernetes api server and syncs the ipvs configuration to reflect state of services
|
||||
@ -317,7 +317,7 @@ func buildServicesInfo() serviceInfoMap {
|
||||
continue
|
||||
}
|
||||
|
||||
if svc.Spec.Type == "LoadBalancer" || svc.Spec.Type == "ExternalName" {
|
||||
if svc.Spec.Type == "ExternalName" {
|
||||
glog.Infof("Skipping service name:%s namespace:%s due to service Type=%s", svc.Name, svc.Namespace, svc.Spec.Type)
|
||||
continue
|
||||
}
|
||||
|
||||
@ -63,5 +63,5 @@ func (s *KubeRouterConfig) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&s.PeerAsn, "peer-asn", s.PeerAsn, "ASN number of the BGP peer to which cluster nodes will advertise cluster ip and node's pod cidr")
|
||||
fs.BoolVar(&s.FullMeshMode, "nodes-full-mesh", s.FullMeshMode, "When enabled each node in the cluster will setup BGP peer with rest of the nodes. True by default")
|
||||
fs.StringVar(&s.HostnameOverride, "hostname-override", s.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname.")
|
||||
fs.BoolVar(&s.GlobalHairpinMode, "hairpin-mode", s.GlobalHairpinMode, "Adds iptable rules for every ClusterIP Service Endpoint to support hairpin traffic. False by default")
|
||||
fs.BoolVar(&s.GlobalHairpinMode, "hairpin-mode", s.GlobalHairpinMode, "Adds iptable rules for every Service Endpoint to support hairpin traffic. False by default")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user