Closed cgilmour closed 8 years ago
Tested with kubernetes + romana/kube#10: All steps completed successfully.
Tested with devstack + networking-romana#12: Instances came up with addresses.
Generally, I don't like our core services to have some environment specific code in them. This should be handled by adaptors.
As far as I can tell, the only difference between the cluster-types is how the tenant is looked up.
Instead of letting IPAM figure out how a tenant for a specific environment is to be looked up, we could instead offer a tenant_by_id
and a tenant_by_name
query option. That's generic and independent of the environment.
The calling code (in networking_romana or in the CNI plugin) can then use whatever query option works for them. That way, we avoid environment specific code in our core components.
So should the IPAM requests be: (same path different parameters)
networking-romana: /allocateIP?tenant=id&tenantID=4238979234&segmentName=...
CNI: /allocateIP?tenant=name&tenantName=tenant-a&segmentName=...
Or (different path, different parameters)
networking-romana: /allocateIPUsingTenantID?tenantID==4238979234&segmentName=...
CNI: /allocateIPUsingTenantName?tenantName=tenant-a&segmentName=...
Or: both should query topology and tenant, build the real value, post to IPAM /endpoints and extract the IP from the response?
WE can leave it as is and fix up in 0.8.3 with proper calls (driver looking things up via external ID).
Why not:
/allocateIP?tenantID=4238979234&segmentName=...
and
/allocateIP?tenantName=tenant-a&segmentName=...
?
Basically, use whatever works for you. No need to declare a type.
Going to proceed with this and matching PRs on networking-romana and kube. This needs to be merged to master also.
This PR changes the behaviour of the "legacy allocate IP" path in the IPAM service. Now, it takes a "clusterType" parameter with values either 'kubernetes' or 'openstack'.
For kubernetes, it will expect a tenantName parameter, and compare it to the Name field in the tenant data. For openstack/devstack, it will expect a tenantID parameter, and compare it to the ExternalID field in the tenant data.