mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
CKS: Use Zone MTUs when network is created at the time of CKS cluster creation
This commit is contained in:
parent
4348386970
commit
a3cba0475c
@ -107,6 +107,10 @@ public interface NetworkService {
|
|||||||
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType) throws
|
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType) throws
|
||||||
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
|
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
|
||||||
|
|
||||||
|
Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
|
||||||
|
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs) throws
|
||||||
|
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
|
||||||
|
|
||||||
Pair<List<? extends Network>, Integer> searchForNetworks(ListNetworksCmd cmd);
|
Pair<List<? extends Network>, Integer> searchForNetworks(ListNetworksCmd cmd);
|
||||||
|
|
||||||
boolean deleteNetwork(long networkId, boolean forced);
|
boolean deleteNetwork(long networkId, boolean forced);
|
||||||
|
|||||||
@ -973,9 +973,12 @@ public class KubernetesClusterManagerImpl extends ManagerBase implements Kuberne
|
|||||||
|
|
||||||
CallContext networkContext = CallContext.register(CallContext.current(), ApiCommandResourceType.Network);
|
CallContext networkContext = CallContext.register(CallContext.current(), ApiCommandResourceType.Network);
|
||||||
try {
|
try {
|
||||||
|
Long zoneId = zone.getId();
|
||||||
|
Integer publicMTU = NetworkService.VRPublicInterfaceMtu.valueIn(zoneId);
|
||||||
|
Integer privateMTU = NetworkService.VRPrivateInterfaceMtu.valueIn(zoneId);
|
||||||
network = networkService.createGuestNetwork(networkOffering.getId(), clusterName + "-network",
|
network = networkService.createGuestNetwork(networkOffering.getId(), clusterName + "-network",
|
||||||
owner.getAccountName() + "-network", owner, physicalNetwork, zone.getId(),
|
owner.getAccountName() + "-network", owner, physicalNetwork, zoneId,
|
||||||
ControlledEntity.ACLType.Account);
|
ControlledEntity.ACLType.Account, new Pair<>(publicMTU, privateMTU));
|
||||||
} catch (ConcurrentOperationException | InsufficientCapacityException | ResourceAllocationException e) {
|
} catch (ConcurrentOperationException | InsufficientCapacityException | ResourceAllocationException e) {
|
||||||
logAndThrow(Level.ERROR, String.format("Unable to create network for the Kubernetes cluster: %s", clusterName));
|
logAndThrow(Level.ERROR, String.format("Unable to create network for the Kubernetes cluster: %s", clusterName));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@ -1869,6 +1869,18 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
|
|||||||
null, null, null, null, null, null, null, null, null, null);
|
null, null, null, null, null, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DB
|
||||||
|
@ActionEvent(eventType = EventTypes.EVENT_NETWORK_CREATE, eventDescription = "creating network")
|
||||||
|
public Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
|
||||||
|
PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs) throws
|
||||||
|
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
|
||||||
|
return _networkMgr.createGuestNetwork(networkOfferingId, name, displayText,
|
||||||
|
null, null, null, false, null, owner, null, physicalNetwork, zoneId,
|
||||||
|
aclType, null, null, null, null, true, null,
|
||||||
|
null, null, null, null, null, null, null, null, vrIfaceMTUs, null);
|
||||||
|
}
|
||||||
|
|
||||||
void checkAndSetRouterSourceNatIp(Account owner, CreateNetworkCmd cmd, Network network) throws InsufficientAddressCapacityException, ResourceAllocationException {
|
void checkAndSetRouterSourceNatIp(Account owner, CreateNetworkCmd cmd, Network network) throws InsufficientAddressCapacityException, ResourceAllocationException {
|
||||||
String sourceNatIp = cmd.getSourceNatIP();
|
String sourceNatIp = cmd.getSourceNatIP();
|
||||||
if (sourceNatIp == null) {
|
if (sourceNatIp == null) {
|
||||||
|
|||||||
@ -230,6 +230,13 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkOrches
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
|
||||||
|
PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs)
|
||||||
|
throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.cloud.network.NetworkService#searchForNetworks(com.cloud.api.commands.ListNetworksCmd)
|
* @see com.cloud.network.NetworkService#searchForNetworks(com.cloud.api.commands.ListNetworksCmd)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user