Change:
Is this a BUG REPORT or FEATURE REQUEST?: Feature request /kind feature What happened: Currently we have kubernetes cluster installed, in node machines we have one subnet and two routers attached. One router for external network and one router for internal network. However, when we create type: loadbalancer services in kubernetes, we have to hardcode floatingnetwork id to only one of those (external or internal). What you expected to happen: I except that I could define from which floatingnetwork loadbalancer is taking its floating ip address in each service. One possible solution could be that if floatingnetworkid is defined like currently - that networkid is default one. Then we could have possibility to override that in each service configuration. Like if we do not want use default floating-pool we could change it: I do not know does this even work in openstack, it might need some manual route settings in lbaas. Environment: Kubernetes version (use ): 1.6 Cloud provider or hardware configuration**: openstack OS (e.g. from /etc/os-release): centos cc
Exposing first to external network so the external floatingip is working. Then update floating-networkid in kubernetes cloud-config in all nodes+masters and restart all machines. Exposing to internal network However, this last curl did not work from outside openstack. There is some route issue with it, if I try that outside openstack the result is: tcpdump from node the external one which works 192.168.1.12 is lbaas fixed ip: tcpdump from node the internal one which does not work 192.168.1.13 is lbaas fixed ip: This might mean that lbaas is using default router (which is external) to answer back to client, so the route in lbaas should be modified. No idea is that possible.
There are no sig labels on this issue. Please by: a sig: e.g., to notify the contributor experience sig, OR the label manually: e.g., to apply the label Note: Method 1 will trigger an email to the group. You can find the group list and label list . The in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals
/sig openstack /sig network
I have defined host route to subnet, which is 10.222.0.0/16,192.168.1.4 this row basically means that all connections toward 10.222.0.0/16 should use 192.168.1.4 router interface, which is internal router. However, openstack lbaas is ignoring these host routes so before that is fixed there is no sense to code this feature to kubernetes. edit. looks like it is fixed that fix is not to our openstack yet. After that fix this is this my idea should work. Now the question is how we should implement this multiple floatingnetworkids to kubernetes. I can make PR but first I would like to discuss how it should be done.
Sounds good. cc
the problem what I am thinking currently is that I would like to have possibility to specify floating-pool in each service. Some service people may want expose service to external network and some service to internal network. However, the service api spec is quite hardcoded or can I add variable there? I am planning to add variable like there.

Discussion:
activeStatus = "ACTIVE" errorStatus  = "ERROR" <ins> ServiceAnnotationLoadBalancerFloatingNetworkId = "loadbalancer.openstack.org/floating-network-id" </ins> ) // LoadBalancer implementation for LBaaS v1

return addrs[0].Address, nil } <ins> //getStringFromServiceAnnotation searches a given v1.Service for a specific annotationKey and either returns the annotation's value or a specified defaultSetting func getStringFromServiceAnnotation(service *v1.Service, annotationKey string, defaultSetting string) string { glog.V(4).Infof("getStringFromServiceAnnotation(%v, %v, %v)", service, annotationKey, defaultSetting) if annotationValue, ok := service.Annotations[annotationKey]; ok { //if there is an annotation for this setting, set the "setting" var to it // annotationValue can be empty, it is working as designed // it makes possible for instance provisioning loadbalancer without floatingip glog.V(4).Infof("Found a Service Annotation: %v = %v", annotationKey, annotationValue) return annotationValue } //if there is no annotation, set "settings" var to the value from cloud config glog.V(4).Infof("Could not find a Service Annotation; falling back on cloud-config setting: %v = %v", annotationKey, defaultSetting) return defaultSetting } </ins> // TODO: This code currently ignores 'region' and always creates a // loadbalancer in only the current OpenStack region.  We should take // a list of regions (from config) and query/create loadbalancers in

return nil, fmt.Errorf("no ports provided to openstack load balancer") } <ins> floatingPool := getStringFromServiceAnnotation(apiService, ServiceAnnotationLoadBalancerFloatingNetworkId, lbaas.opts.FloatingNetworkId) glog.V(4).Infof("EnsureLoadBalancer using floatingPool: %v", floatingPool) </ins> // Check for TCP protocol on each port // TODO: Convert all error messages to use an event recorder for _, port := range ports {

if err != nil && err != ErrNotFound { return nil, fmt.Errorf("Error getting floating ip for port %s: %v", portID, err) } <del> if floatIP == nil && lbaas.opts.FloatingNetworkId != "" { </del> <ins> if floatIP == nil && floatingPool != "" { </ins> glog.V(4).Infof("Creating floating ip for loadbalancer %s port %s", loadbalancer.ID, portID) floatIPOpts := floatingips.CreateOpts{ <del> FloatingNetworkID: lbaas.opts.FloatingNetworkId, </del> <ins> FloatingNetworkID: floatingPool, </ins> PortID:            portID, } floatIP, err = floatingips.Create(lbaas.network, floatIPOpts).Extract()