Skip to content

Commit 3de1ccd

Browse files
nvazquezPearl1594DaanHooglandsureshanaparti
authored andcommitted
CKS Enhancements (apache#9102)
CKS Enhancements: * Ability to specify different compute or service offerings for different types of CKS cluster nodes – worker, master or etcd * Ability to use CKS ready custom templates for CKS cluster nodes * Add and Remove external nodes to and from a kubernetes cluster Co-authored-by: nvazquez <[email protected]> * Update remove node timeout global setting * CKS/NSX : Missing variables in worker nodes * CKS: Fix ISO attach logic * CKS: Fix ISO attach logic * address comment * Fix Port - Node mapping when cluster is scaled in the presence of external node(s) * CKS: Externalize control and worker node setup wait time and installation attempts * Fix logger * Add missing headers and fix end of line on files * CKS Mark Nodes for Manual Upgrade and Filter Nodes to add to CKS cluster from the same network * Add support to deploy CKS cluster nodes on hosts dedicated to a domain --------- Co-authored-by: Pearl Dsilva <[email protected]> * Support unstacked ETCD --------- Co-authored-by: nvazquez <[email protected]> * Fix CKS cluster scaling and minor UI improvement * Reuse k8s cluster public IP for etcd nodes and rename etcd nodes * Fix DNS resolver issue * Update UDP active monitor to ICMP * Add hypervisor type to CKS cluster creation to fix CKS cluster creation when External hosts added * Fix build * Fix logger * Modify hypervisor param description in the create CKS cluster API * CKS delete fails when external nodes are present * CKS delete fails when external nodes are present * address comment * Improve network rules cleanup on failure adding external nodes to CKS cluster * UI: Fix etcd template was not honoured * UI: Fix etcd template was not honoured * Refactor * CKS: Exclude etcd nodes when calculating port numbers * Fix network cleanup in case of CKS cluster failure * Externalize retries and inverval for NSX segment deletion * Fix CKS scaling when external node(s) present in the cluster * CKS: Fix port numbers displayed against ETCD nodes * Add node version details to every node of k8s cluster - as we now support manual upgrade * Add node version details to every node of k8s cluster - as we now support manual upgrade * update column name * CKS: Exclude etcd nodes when calculating port numbers * update param name * update param * UI: Fix CKS cluster creation templates listing for non admins * CKS: Prevent etcd node start port number to coincide with k8s cluster start port numbers * CKS: Set default kubernetes cluster node version to the kubernetes cluster version on upgrade * CKS: Set default kubernetes cluster node version to the kubernetes cluster version on upgrade * consolidate query * Fix upgrade logic --------- Co-authored-by: nvazquez <[email protected]> * Fix CKS cluster version upgrade * CKS: Fix etcd port numbers being skipped * Fix CKS cluster with etcd nodes on VPC * Move schema and upgrade for 4.20 * Fix logger * Fix after rebasing * Add support for using different CNI plugins with CKS * Add support for using different CNI plugins with CKS * remove unused import * Add UI support and list cni config API * necessary UI changes * add license * changes to support external cni * UI changes * Fix NPE on restarting VPC with additional public IPs * fix merge conflict * add asnumber to create k8s svc layer * support cni framework to use as-numbers * update code * condition to ignore undefined jinja template variables * CKS: Do not pass AS number when network ID is passed * Fix deletion of Userdata / CNI Configuration in projects * CKS: Add CNI configuration details to the response and UI * Explicit events for registering cni configuration * Add Delete cni configuration API * Fix CKS deployment when using VPC tiers with custom ACLs * Fix DNS list on VR * CKS: Use Network offering of the network passed during CKS cluster creation to get the AS number * CKS cluster with guest IP * Fix: Use control node guest IP as join IP for external nodes addition * Fix DNS resolver issue * Improve etcd indexing - start from 1 * CKS: Add external node to a CKS cluster deployed with etcd node(s) successfully * CKS: Add external node to a CKS cluster deployed with etcd node(s) successfully * simplify logic * Tweak setup-kube-system script for baremetal external nodes * Consider cordoned nodes while getting ready nodes * Fix CKS cluster scale calculations * Set token TTL to 0 (no expire) for external etcd * Fix missing quotes * Fix build * Revert PR 9133 * Add calico commands for ens35 interface * Address review comments: plan CKS cluster deployment based on the node type * Add qemu-guest-agent dependency for kvm based templates * Add marvin test for CKS clusters with different offerings per node type * Remove test tag * Add marvin test and fix update template for cks and since annotations * Fix marvin test for adding and removing external nodes * Fix since version on API params * Address review comments * Fix unit test * Address review comments * UI: Make CKS public templates visible to non-admins on CKS cluster creation * Fix linter * Fix merge error * Fix positional parameters on the create kubernetes ISO script and make the ETCD version optional * fix etcd port displayed * Further improvements to CKS (#118) * Multiple nics support on Ubuntu template * Multiple nics support on Ubuntu template * supports allocating IP to the nic when VM is added to another network - no delay * Add option to select DNS or VR IP as resolver on VPC creation * Add API param and UI to select option * Add column on vpc and pass the value on the databags for CsDhcp.py to fix accordingly * Externalize the CKS Configuration, so that end users can tweak the configuration before deploying the cluster * Add new directory to c8 packaging for CKS config * Remove k8s configuration from resources and make it configurable * Revert "Remove k8s configuration from resources and make it configurable" This reverts commit d5997033ebe4ba559e6478a64578b894f8e7d3db. * copy conf to mgmt server and consume them from there * Remove node from cluster * Add missing /opt/bin directory requrired by external nodes * Login to a specific Project view * add indents * Fix CKS HA clusters * Fix build --------- Co-authored-by: Nicolas Vazquez <[email protected]> * Add missing headers * Fix linter * Address more review comments * Fix unit test * Fix scaling case for the same offering * Revert "Login to a specific Project view" This reverts commit 95e3756. * Revert "Fix CKS HA clusters" (#120) This reverts commit 8dac16a. * Apply suggestions from code review about user data Co-authored-by: Suresh Kumar Anaparti <[email protected]> * Update api/src/main/java/org/apache/cloudstack/api/command/user/userdata/BaseRegisterUserDataCmd.java Co-authored-by: Suresh Kumar Anaparti <[email protected]> * Refactor column names and schema path * Fix scaling for non existing previous offering per node type * Update node offering entry if there was an existing offering but a global service offering has been provided on scale --------- Co-authored-by: Pearl Dsilva <[email protected]> Co-authored-by: Daan Hoogland <[email protected]> Co-authored-by: Suresh Kumar Anaparti <[email protected]>
1 parent d219d01 commit 3de1ccd

File tree

142 files changed

+7376
-628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+7376
-628
lines changed

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ public class EventTypes {
293293

294294
//registering userdata events
295295
public static final String EVENT_REGISTER_USER_DATA = "REGISTER.USER.DATA";
296+
public static final String EVENT_REGISTER_CNI_CONFIG = "REGISTER.CNI.CONFIG";
297+
public static final String EVENT_DELETE_CNI_CONFIG = "DELETE.CNI.CONFIG";
296298

297299
//register for user API and secret keys
298300
public static final String EVENT_REGISTER_FOR_SECRET_API_KEY = "REGISTER.USER.KEY";
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ enum Event {
4444
AutoscaleRequested,
4545
ScaleUpRequested,
4646
ScaleDownRequested,
47+
AddNodeRequested,
48+
RemoveNodeRequested,
4749
UpgradeRequested,
4850
OperationSucceeded,
4951
OperationFailed,
@@ -59,6 +61,8 @@ enum State {
5961
Stopped("All resources for the Kubernetes cluster are destroyed, Kubernetes cluster may still have ephemeral resource like persistent volumes provisioned"),
6062
Scaling("Transient state in which resources are either getting scaled up/down"),
6163
Upgrading("Transient state in which cluster is getting upgraded"),
64+
Importing("Transient state in which additional nodes are added as worker nodes to a cluster"),
65+
RemovingNodes("Transient state in which additional nodes are removed from a cluster"),
6266
Alert("State to represent Kubernetes clusters which are not in expected desired state (operationally in active control place, stopped cluster VM's etc)."),
6367
Recovering("State in which Kubernetes cluster is recovering from alert state"),
6468
Destroyed("End state of Kubernetes cluster in which all resources are destroyed, cluster will not be usable further"),
@@ -96,6 +100,17 @@ enum State {
96100
s_fsm.addTransition(State.Upgrading, Event.OperationSucceeded, State.Running);
97101
s_fsm.addTransition(State.Upgrading, Event.OperationFailed, State.Alert);
98102

103+
s_fsm.addTransition(State.Running, Event.AddNodeRequested, State.Importing);
104+
s_fsm.addTransition(State.Alert, Event.AddNodeRequested, State.Importing);
105+
s_fsm.addTransition(State.Importing, Event.OperationSucceeded, State.Running);
106+
s_fsm.addTransition(State.Importing, Event.OperationFailed, State.Running);
107+
s_fsm.addTransition(State.Alert, Event.OperationSucceeded, State.Running);
108+
109+
s_fsm.addTransition(State.Running, Event.RemoveNodeRequested, State.RemovingNodes);
110+
s_fsm.addTransition(State.Alert, Event.RemoveNodeRequested, State.RemovingNodes);
111+
s_fsm.addTransition(State.RemovingNodes, Event.OperationSucceeded, State.Running);
112+
s_fsm.addTransition(State.RemovingNodes, Event.OperationFailed, State.Running);
113+
99114
s_fsm.addTransition(State.Alert, Event.RecoveryRequested, State.Recovering);
100115
s_fsm.addTransition(State.Recovering, Event.OperationSucceeded, State.Running);
101116
s_fsm.addTransition(State.Recovering, Event.OperationFailed, State.Alert);
@@ -142,4 +157,13 @@ enum State {
142157
Long getMaxSize();
143158
Long getSecurityGroupId();
144159
ClusterType getClusterType();
160+
Long getControlNodeServiceOfferingId();
161+
Long getWorkerNodeServiceOfferingId();
162+
Long getEtcdNodeServiceOfferingId();
163+
Long getControlNodeTemplateId();
164+
Long getWorkerNodeTemplateId();
165+
Long getEtcdNodeTemplateId();
166+
Long getEtcdNodeCount();
167+
Long getCniConfigId();
168+
String getCniConfigDetails();
145169
}

api/src/main/java/com/cloud/kubernetes/cluster/KubernetesServiceHelper.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@
1818

1919
import org.apache.cloudstack.acl.ControlledEntity;
2020

21+
import java.util.Map;
22+
2123
import com.cloud.user.Account;
2224
import com.cloud.uservm.UserVm;
2325
import com.cloud.utils.component.Adapter;
2426

2527
public interface KubernetesServiceHelper extends Adapter {
2628

29+
enum KubernetesClusterNodeType {
30+
CONTROL, WORKER, ETCD, DEFAULT
31+
}
32+
2733
ControlledEntity findByUuid(String uuid);
2834
ControlledEntity findByVmId(long vmId);
2935
void checkVmCanBeDestroyed(UserVm userVm);
36+
boolean isValidNodeType(String nodeType);
37+
Map<String, Long> getServiceOfferingNodeTypeMap(Map<String, Map<String, String>> serviceOfferingNodeTypeMap);
38+
Map<String, Long> getTemplateNodeTypeMap(Map<String, Map<String, String>> templateNodeTypeMap);
3039
void cleanupForAccount(Account account);
3140
}

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,6 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
268268
InternalLoadBalancerElementService getInternalLoadBalancerElementByNetworkServiceProviderId(long networkProviderId);
269269
InternalLoadBalancerElementService getInternalLoadBalancerElementById(long providerId);
270270
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();
271+
272+
boolean handleCksIsoOnNetworkVirtualRouter(Long virtualRouterId, boolean mount) throws ResourceUnavailableException;
271273
}

api/src/main/java/com/cloud/network/vpc/Vpc.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,6 @@ public enum State {
105105
String getIp6Dns1();
106106

107107
String getIp6Dns2();
108+
109+
boolean useRouterIpAsResolver();
108110
}

api/src/main/java/com/cloud/network/vpc/VpcService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ public interface VpcService {
4848
* @param vpcName
4949
* @param displayText
5050
* @param cidr
51-
* @param networkDomain TODO
51+
* @param networkDomain TODO
5252
* @param ip4Dns1
5353
* @param ip4Dns2
54-
* @param displayVpc TODO
54+
* @param displayVpc TODO
55+
* @param useVrIpResolver
5556
* @return
5657
* @throws ResourceAllocationException TODO
5758
*/
5859
Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String displayText, String cidr, String networkDomain,
5960
String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2, Boolean displayVpc, Integer publicMtu, Integer cidrSize,
60-
Long asNumber, List<Long> bgpPeerIds)
61-
throws ResourceAllocationException;
61+
Long asNumber, List<Long> bgpPeerIds, Boolean useVrIpResolver) throws ResourceAllocationException;
6262

6363
/**
6464
* Persists VPC record in the database

api/src/main/java/com/cloud/server/ManagementService.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@
7070
import org.apache.cloudstack.api.command.user.ssh.DeleteSSHKeyPairCmd;
7171
import org.apache.cloudstack.api.command.user.ssh.ListSSHKeyPairsCmd;
7272
import org.apache.cloudstack.api.command.user.ssh.RegisterSSHKeyPairCmd;
73+
import org.apache.cloudstack.api.command.user.userdata.DeleteCniConfigurationCmd;
7374
import org.apache.cloudstack.api.command.user.userdata.DeleteUserDataCmd;
7475
import org.apache.cloudstack.api.command.user.userdata.ListUserDataCmd;
76+
import org.apache.cloudstack.api.command.user.userdata.RegisterCniConfigurationCmd;
7577
import org.apache.cloudstack.api.command.user.userdata.RegisterUserDataCmd;
7678
import org.apache.cloudstack.api.command.user.vm.GetVMPasswordCmd;
7779
import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
@@ -393,17 +395,23 @@ public interface ManagementService {
393395
* The api command class.
394396
* @return The list of userdatas found.
395397
*/
396-
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd);
398+
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd, boolean forCks);
399+
400+
/**
401+
* Registers a cni configuration.
402+
*
403+
* @param cmd The api command class.
404+
* @return A VO with the registered user data.
405+
*/
406+
UserData registerCniConfiguration(RegisterCniConfigurationCmd cmd);
397407

398408
/**
399409
* Registers a userdata.
400410
*
401-
* @param cmd
402-
* The api command class.
411+
* @param cmd The api command class.
403412
* @return A VO with the registered userdata.
404413
*/
405414
UserData registerUserData(RegisterUserDataCmd cmd);
406-
407415
/**
408416
* Deletes a userdata.
409417
*
@@ -413,6 +421,14 @@ public interface ManagementService {
413421
*/
414422
boolean deleteUserData(DeleteUserDataCmd cmd);
415423

424+
/**
425+
* Deletes user data.
426+
*
427+
* @param cmd
428+
* The api command class.
429+
* @return True on success. False otherwise.
430+
*/
431+
boolean deleteCniConfiguration(DeleteCniConfigurationCmd cmd);
416432
/**
417433
* Search registered key pairs for the logged in user.
418434
*

api/src/main/java/com/cloud/template/TemplateApiService.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,23 @@ public interface TemplateApiService {
6262
VirtualMachineTemplate prepareTemplate(long templateId, long zoneId, Long storageId);
6363

6464

65+
/**
66+
* Detach ISO from VM
67+
* @param vmId id of the VM
68+
* @param isoId id of the ISO (when passed). If it is not passed, it will get it from user_vm table
69+
* @param extraParams forced, isVirtualRouter
70+
* @return true when operation succeeds, false if not
71+
*/
72+
boolean detachIso(long vmId, Long isoId, Boolean... extraParams);
6573

66-
boolean detachIso(long vmId, boolean forced);
67-
68-
boolean attachIso(long isoId, long vmId, boolean forced);
74+
/**
75+
* Attach ISO to a VM
76+
* @param isoId id of the ISO to attach
77+
* @param vmId id of the VM to attach the ISO to
78+
* @param extraParams: forced, isVirtualRouter
79+
* @return true when operation succeeds, false if not
80+
*/
81+
boolean attachIso(long isoId, long vmId, Boolean... extraParams);
6982

7083
/**
7184
* Deletes a template

api/src/main/java/com/cloud/template/VirtualMachineTemplate.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public enum TemplateFilter {
145145

146146
boolean isDeployAsIs();
147147

148+
boolean isForCks();
149+
148150
Long getUserDataId();
149151

150152
UserData.UserDataOverridePolicy getUserDataOverridePolicy();

api/src/main/java/com/cloud/user/UserData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ public enum UserDataOverridePolicy {
2929
String getUserData();
3030

3131
String getParams();
32+
boolean isForCks();
3233
}

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Map;
2222
import java.util.Optional;
2323

24+
import com.cloud.deploy.DeploymentPlan;
2425
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
2526
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
2627
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
@@ -129,7 +130,7 @@ UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, E
129130

130131
UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ResourceAllocationException;
131132

132-
void startVirtualMachine(UserVm vm) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;
133+
void startVirtualMachine(UserVm vm, DeploymentPlan plan) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;
133134

134135
void startVirtualMachineForHA(VirtualMachine vm, Map<VirtualMachineProfile.Param, Object> params,
135136
DeploymentPlanner planner) throws InsufficientCapacityException, ResourceUnavailableException,

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public interface VmDetailConstants {
9292
String DEPLOY_AS_IS_CONFIGURATION = "configurationId";
9393
String KEY_PAIR_NAMES = "keypairnames";
9494
String CKS_CONTROL_NODE_LOGIN_USER = "controlNodeLoginUser";
95+
String CKS_NODE_TYPE = "node";
96+
String OFFERING = "offering";
97+
String TEMPLATE = "template";
9598

9699
// VMware to KVM VM migrations specific
97100
String VMWARE_TO_KVM_PREFIX = "vmware-to-kvm";

api/src/main/java/org/apache/cloudstack/api/ApiCommandResourceType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public enum ApiCommandResourceType {
8585
ObjectStore(org.apache.cloudstack.storage.object.ObjectStore.class),
8686
Bucket(org.apache.cloudstack.storage.object.Bucket.class),
8787
QuotaTariff(org.apache.cloudstack.quota.QuotaTariff.class),
88-
KubernetesCluster(null),
88+
KubernetesCluster(com.cloud.kubernetes.cluster.KubernetesCluster.class),
8989
KubernetesSupportedVersion(null),
9090
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class),
9191
DisasterRecoveryCluster(com.cloud.dr.cluster.DisasterRecoveryCluster.class);

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ public class ApiConstants {
119119
public static final String CN = "cn";
120120
public static final String COMMAND = "command";
121121
public static final String CMD_EVENT_TYPE = "cmdeventtype";
122+
public static final String CNI_CONFIG = "cniconfig";
123+
public static final String CNI_CONFIG_ID = "cniconfigurationid";
124+
public static final String CNI_CONFIG_DETAILS = "cniconfigdetails";
125+
public static final String CNI_CONFIG_NAME = "cniconfigname";
122126
public static final String COMPONENT = "component";
123127
public static final String CPU_CORE_PER_SOCKET = "cpucorepersocket";
124128
public static final String CPU_NUMBER = "cpunumber";
@@ -145,6 +149,7 @@ public class ApiConstants {
145149
public static final String SAVING_RATE = "savingrate";
146150
public static final String ENCRYPT_ROOT = "encryptroot";
147151
public static final String ENCRYPTION_SUPPORTED = "encryptionsupported";
152+
public static final String ETCD_IPS = "etcdips";
148153
public static final String MIN_IOPS = "miniops";
149154
public static final String MAX_IOPS = "maxiops";
150155
public static final String HYPERVISOR_SNAPSHOT_RESERVE = "hypervisorsnapshotreserve";
@@ -340,6 +345,7 @@ public class ApiConstants {
340345
public static final String LBID = "lbruleid";
341346
public static final String LB_PROVIDER = "lbprovider";
342347
public static final String MAC_ADDRESS = "macaddress";
348+
public static final String MANUAL_UPGRADE = "manualupgrade";
343349
public static final String MAX = "max";
344350
public static final String MAX_SNAPS = "maxsnaps";
345351
public static final String MAX_BACKUPS = "maxbackups";
@@ -351,6 +357,7 @@ public class ApiConstants {
351357
public static final String MIGRATIONS = "migrations";
352358
public static final String MEMORY = "memory";
353359
public static final String MODE = "mode";
360+
public static final String MOUNT_CKS_ISO_ON_VR = "mountcksisoonvr";
354361
public static final String MULTI_ARCH = "ismultiarch";
355362
public static final String NSX_MODE = "nsxmode";
356363
public static final String NETWORK_MODE = "networkmode";
@@ -367,6 +374,7 @@ public class ApiConstants {
367374
public static final String NIC_PACKED_VIRTQUEUES_ENABLED = "nicpackedvirtqueuesenabled";
368375
public static final String NEW_START_IP = "newstartip";
369376
public static final String NEW_END_IP = "newendip";
377+
public static final String KUBERNETES_NODE_VERSION = "kubernetesnodeversion";
370378
public static final String NUM_RETRIES = "numretries";
371379
public static final String OFFER_HA = "offerha";
372380
public static final String OS_DISTRIBUTION = "osdistribution";
@@ -554,6 +562,7 @@ public class ApiConstants {
554562
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
555563
public static final String USER_SECRET_KEY = "usersecretkey";
556564
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
565+
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
557566
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
558567
public static final String VALUE = "value";
559568
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
@@ -570,6 +579,12 @@ public class ApiConstants {
570579

571580
public static final String VLAN = "vlan";
572581
public static final String VLAN_RANGE = "vlanrange";
582+
public static final String WORKER_SERVICE_OFFERING_ID = "workerofferingid";
583+
public static final String WORKER_SERVICE_OFFERING_NAME = "workerofferingname";
584+
public static final String CONTROL_SERVICE_OFFERING_ID = "controlofferingid";
585+
public static final String CONTROL_SERVICE_OFFERING_NAME = "controlofferingname";
586+
public static final String ETCD_SERVICE_OFFERING_ID = "etcdofferingid";
587+
public static final String ETCD_SERVICE_OFFERING_NAME = "etcdofferingname";
573588
public static final String REMOVE_VLAN = "removevlan";
574589
public static final String VLAN_ID = "vlanid";
575590
public static final String ISOLATED_PVLAN = "isolatedpvlan";
@@ -920,6 +935,7 @@ public class ApiConstants {
920935
public static final String SPLIT_CONNECTIONS = "splitconnections";
921936
public static final String FOR_VPC = "forvpc";
922937
public static final String FOR_NSX = "fornsx";
938+
public static final String FOR_CKS = "forcks";
923939
public static final String NSX_SUPPORT_LB = "nsxsupportlb";
924940
public static final String NSX_SUPPORTS_INTERNAL_LB = "nsxsupportsinternallb";
925941
public static final String FOR_TUNGSTEN = "fortungsten";
@@ -1128,6 +1144,10 @@ public class ApiConstants {
11281144
public static final String MASTER_NODES = "masternodes";
11291145
public static final String NODE_IDS = "nodeids";
11301146
public static final String CONTROL_NODES = "controlnodes";
1147+
public static final String ETCD_NODES = "etcdnodes";
1148+
public static final String EXTERNAL_NODES = "externalnodes";
1149+
public static final String IS_EXTERNAL_NODE = "isexternalnode";
1150+
public static final String IS_ETCD_NODE = "isetcdnode";
11311151
public static final String MIN_SEMANTIC_VERSION = "minimumsemanticversion";
11321152
public static final String MIN_KUBERNETES_VERSION_ID = "minimumkubernetesversionid";
11331153
public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize";
@@ -1136,6 +1156,8 @@ public class ApiConstants {
11361156
public static final String AUTOSCALING_ENABLED = "autoscalingenabled";
11371157
public static final String MIN_SIZE = "minsize";
11381158
public static final String MAX_SIZE = "maxsize";
1159+
public static final String NODE_TYPE_OFFERING_MAP = "nodeofferings";
1160+
public static final String NODE_TYPE_TEMPLATE_MAP = "nodetemplates";
11391161

11401162
public static final String DESKTOP_CONTROLLER_VERSION = "controllerversion";
11411163
public static final String DESKTOP_CONTROLLER_VERSION_NAME = "controllerversionname";

api/src/main/java/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public ApiCommandResourceType getApiResourceType() {
104104

105105
@Override
106106
public void execute() {
107-
boolean result = _templateService.detachIso(virtualMachineId, isForced());
107+
boolean result = _templateService.detachIso(virtualMachineId, null, isForced());
108108
if (result) {
109109
UserVm userVm = _entityMgr.findById(UserVm.class, virtualMachineId);
110110
UserVmResponse response = _responseGenerator.createUserVmResponse(getResponseView(), "virtualmachine", userVm).get(0);

api/src/main/java/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ public class GetUploadParamsForTemplateCmd extends AbstractGetUploadParamsCmd {
102102
description = "(VMware only) true if VM deployments should preserve all the configurations defined for this template", since = "4.15.1")
103103
private Boolean deployAsIs;
104104

105+
@Parameter(name=ApiConstants.FOR_CKS,
106+
type = CommandType.BOOLEAN,
107+
description = "if true, the templates would be available for deploying CKS clusters", since = "4.21.0")
108+
protected Boolean forCks;
109+
105110
public String getDisplayText() {
106111
return StringUtils.isBlank(displayText) ? getName() : displayText;
107112
}
@@ -175,6 +180,10 @@ public boolean isDeployAsIs() {
175180
Boolean.TRUE.equals(deployAsIs);
176181
}
177182

183+
public boolean isForCks() {
184+
return Boolean.TRUE.equals(forCks);
185+
}
186+
178187
public CPU.CPUArch getArch() {
179188
return CPU.CPUArch.fromType(arch);
180189
}

api/src/main/java/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public class ListTemplatesCmd extends BaseListTaggedResourcesCmd implements User
105105
since = "4.19.0")
106106
private Boolean isVnf;
107107

108+
@Parameter(name = ApiConstants.FOR_CKS, type = CommandType.BOOLEAN,
109+
description = "list templates that can be used to deploy CKS clusters",
110+
since = "4.21.0")
111+
private Boolean forCks;
112+
108113
@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING,
109114
description = "the CPU arch of the template. Valid options are: x86_64, aarch64",
110115
since = "4.20")
@@ -211,6 +216,8 @@ public Boolean getVnf() {
211216
return isVnf;
212217
}
213218

219+
public Boolean getForCks() { return forCks; }
220+
214221
public CPU.CPUArch getArch() {
215222
if (StringUtils.isBlank(arch)) {
216223
return null;

0 commit comments

Comments
 (0)