Skip to content

Commit 6adfda2

Browse files
nvazquezPearl1594DaanHooglandsureshanaparti
authored
CKS Enhancements (#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 4662ffc commit 6adfda2

File tree

142 files changed

+7378
-632
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

+7378
-632
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
@@ -289,6 +289,8 @@ public class EventTypes {
289289

290290
//registering userdata events
291291
public static final String EVENT_REGISTER_USER_DATA = "REGISTER.USER.DATA";
292+
public static final String EVENT_REGISTER_CNI_CONFIG = "REGISTER.CNI.CONFIG";
293+
public static final String EVENT_DELETE_CNI_CONFIG = "DELETE.CNI.CONFIG";
292294

293295
//register for user API and secret keys
294296
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
@@ -62,8 +62,10 @@
6262
import org.apache.cloudstack.api.command.user.ssh.DeleteSSHKeyPairCmd;
6363
import org.apache.cloudstack.api.command.user.ssh.ListSSHKeyPairsCmd;
6464
import org.apache.cloudstack.api.command.user.ssh.RegisterSSHKeyPairCmd;
65+
import org.apache.cloudstack.api.command.user.userdata.DeleteCniConfigurationCmd;
6566
import org.apache.cloudstack.api.command.user.userdata.DeleteUserDataCmd;
6667
import org.apache.cloudstack.api.command.user.userdata.ListUserDataCmd;
68+
import org.apache.cloudstack.api.command.user.userdata.RegisterCniConfigurationCmd;
6769
import org.apache.cloudstack.api.command.user.userdata.RegisterUserDataCmd;
6870
import org.apache.cloudstack.api.command.user.vm.GetVMPasswordCmd;
6971
import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
@@ -369,17 +371,23 @@ public interface ManagementService {
369371
* The api command class.
370372
* @return The list of userdatas found.
371373
*/
372-
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd);
374+
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd, boolean forCks);
375+
376+
/**
377+
* Registers a cni configuration.
378+
*
379+
* @param cmd The api command class.
380+
* @return A VO with the registered user data.
381+
*/
382+
UserData registerCniConfiguration(RegisterCniConfigurationCmd cmd);
373383

374384
/**
375385
* Registers a userdata.
376386
*
377-
* @param cmd
378-
* The api command class.
387+
* @param cmd The api command class.
379388
* @return A VO with the registered userdata.
380389
*/
381390
UserData registerUserData(RegisterUserDataCmd cmd);
382-
383391
/**
384392
* Deletes a userdata.
385393
*
@@ -389,6 +397,14 @@ public interface ManagementService {
389397
*/
390398
boolean deleteUserData(DeleteUserDataCmd cmd);
391399

400+
/**
401+
* Deletes user data.
402+
*
403+
* @param cmd
404+
* The api command class.
405+
* @return True on success. False otherwise.
406+
*/
407+
boolean deleteCniConfiguration(DeleteCniConfigurationCmd cmd);
392408
/**
393409
* Search registered key pairs for the logged in user.
394410
*

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

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

6060

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

62-
boolean detachIso(long vmId, boolean forced);
63-
64-
boolean attachIso(long isoId, long vmId, boolean forced);
70+
/**
71+
* Attach ISO to a VM
72+
* @param isoId id of the ISO to attach
73+
* @param vmId id of the VM to attach the ISO to
74+
* @param extraParams: forced, isVirtualRouter
75+
* @return true when operation succeeds, false if not
76+
*/
77+
boolean attachIso(long isoId, long vmId, Boolean... extraParams);
6578

6679
/**
6780
* 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
@@ -20,6 +20,7 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23+
import com.cloud.deploy.DeploymentPlan;
2324
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
2425
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
2526
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
@@ -111,7 +112,7 @@ UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, E
111112

112113
UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ResourceAllocationException;
113114

114-
void startVirtualMachine(UserVm vm) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;
115+
void startVirtualMachine(UserVm vm, DeploymentPlan plan) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;
115116

116117
void startVirtualMachineForHA(VirtualMachine vm, Map<VirtualMachineProfile.Param, Object> params,
117118
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
@@ -89,6 +89,9 @@ public interface VmDetailConstants {
8989
String DEPLOY_AS_IS_CONFIGURATION = "configurationId";
9090
String KEY_PAIR_NAMES = "keypairnames";
9191
String CKS_CONTROL_NODE_LOGIN_USER = "controlNodeLoginUser";
92+
String CKS_NODE_TYPE = "node";
93+
String OFFERING = "offering";
94+
String TEMPLATE = "template";
9295

9396
// VMware to KVM VM migrations specific
9497
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

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";
@@ -140,6 +144,7 @@ public class ApiConstants {
140144
public static final String ENCRYPT_FORMAT = "encryptformat";
141145
public static final String ENCRYPT_ROOT = "encryptroot";
142146
public static final String ENCRYPTION_SUPPORTED = "encryptionsupported";
147+
public static final String ETCD_IPS = "etcdips";
143148
public static final String MIN_IOPS = "miniops";
144149
public static final String MAX_IOPS = "maxiops";
145150
public static final String HYPERVISOR_SNAPSHOT_RESERVE = "hypervisorsnapshotreserve";
@@ -333,6 +338,7 @@ public class ApiConstants {
333338
public static final String LBID = "lbruleid";
334339
public static final String LB_PROVIDER = "lbprovider";
335340
public static final String MAC_ADDRESS = "macaddress";
341+
public static final String MANUAL_UPGRADE = "manualupgrade";
336342
public static final String MAX = "max";
337343
public static final String MAX_SNAPS = "maxsnaps";
338344
public static final String MAX_BACKUPS = "maxbackups";
@@ -344,6 +350,7 @@ public class ApiConstants {
344350
public static final String MIGRATIONS = "migrations";
345351
public static final String MEMORY = "memory";
346352
public static final String MODE = "mode";
353+
public static final String MOUNT_CKS_ISO_ON_VR = "mountcksisoonvr";
347354
public static final String MULTI_ARCH = "ismultiarch";
348355
public static final String NSX_MODE = "nsxmode";
349356
public static final String NETWORK_MODE = "networkmode";
@@ -360,6 +367,7 @@ public class ApiConstants {
360367
public static final String NIC_PACKED_VIRTQUEUES_ENABLED = "nicpackedvirtqueuesenabled";
361368
public static final String NEW_START_IP = "newstartip";
362369
public static final String NEW_END_IP = "newendip";
370+
public static final String KUBERNETES_NODE_VERSION = "kubernetesnodeversion";
363371
public static final String NUM_RETRIES = "numretries";
364372
public static final String OFFER_HA = "offerha";
365373
public static final String OS_DISTRIBUTION = "osdistribution";
@@ -547,6 +555,7 @@ public class ApiConstants {
547555
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
548556
public static final String USER_SECRET_KEY = "usersecretkey";
549557
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
558+
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
550559
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
551560
public static final String VALUE = "value";
552561
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
@@ -563,6 +572,12 @@ public class ApiConstants {
563572

564573
public static final String VLAN = "vlan";
565574
public static final String VLAN_RANGE = "vlanrange";
575+
public static final String WORKER_SERVICE_OFFERING_ID = "workerofferingid";
576+
public static final String WORKER_SERVICE_OFFERING_NAME = "workerofferingname";
577+
public static final String CONTROL_SERVICE_OFFERING_ID = "controlofferingid";
578+
public static final String CONTROL_SERVICE_OFFERING_NAME = "controlofferingname";
579+
public static final String ETCD_SERVICE_OFFERING_ID = "etcdofferingid";
580+
public static final String ETCD_SERVICE_OFFERING_NAME = "etcdofferingname";
566581
public static final String REMOVE_VLAN = "removevlan";
567582
public static final String VLAN_ID = "vlanid";
568583
public static final String ISOLATED_PVLAN = "isolatedpvlan";
@@ -913,6 +928,7 @@ public class ApiConstants {
913928
public static final String SPLIT_CONNECTIONS = "splitconnections";
914929
public static final String FOR_VPC = "forvpc";
915930
public static final String FOR_NSX = "fornsx";
931+
public static final String FOR_CKS = "forcks";
916932
public static final String NSX_SUPPORT_LB = "nsxsupportlb";
917933
public static final String NSX_SUPPORTS_INTERNAL_LB = "nsxsupportsinternallb";
918934
public static final String FOR_TUNGSTEN = "fortungsten";
@@ -1121,6 +1137,10 @@ public class ApiConstants {
11211137
public static final String MASTER_NODES = "masternodes";
11221138
public static final String NODE_IDS = "nodeids";
11231139
public static final String CONTROL_NODES = "controlnodes";
1140+
public static final String ETCD_NODES = "etcdnodes";
1141+
public static final String EXTERNAL_NODES = "externalnodes";
1142+
public static final String IS_EXTERNAL_NODE = "isexternalnode";
1143+
public static final String IS_ETCD_NODE = "isetcdnode";
11241144
public static final String MIN_SEMANTIC_VERSION = "minimumsemanticversion";
11251145
public static final String MIN_KUBERNETES_VERSION_ID = "minimumkubernetesversionid";
11261146
public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize";
@@ -1129,6 +1149,8 @@ public class ApiConstants {
11291149
public static final String AUTOSCALING_ENABLED = "autoscalingenabled";
11301150
public static final String MIN_SIZE = "minsize";
11311151
public static final String MAX_SIZE = "maxsize";
1152+
public static final String NODE_TYPE_OFFERING_MAP = "nodeofferings";
1153+
public static final String NODE_TYPE_TEMPLATE_MAP = "nodetemplates";
11321154

11331155
public static final String BOOT_TYPE = "boottype";
11341156
public static final String BOOT_MODE = "bootmode";

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
@@ -99,6 +99,11 @@ public class GetUploadParamsForTemplateCmd extends AbstractGetUploadParamsCmd {
9999
description = "(VMware only) true if VM deployments should preserve all the configurations defined for this template", since = "4.15.1")
100100
private Boolean deployAsIs;
101101

102+
@Parameter(name=ApiConstants.FOR_CKS,
103+
type = CommandType.BOOLEAN,
104+
description = "if true, the templates would be available for deploying CKS clusters", since = "4.21.0")
105+
protected Boolean forCks;
106+
102107
public String getDisplayText() {
103108
return StringUtils.isBlank(displayText) ? getName() : displayText;
104109
}
@@ -168,6 +173,10 @@ public boolean isDeployAsIs() {
168173
Boolean.TRUE.equals(deployAsIs);
169174
}
170175

176+
public boolean isForCks() {
177+
return Boolean.TRUE.equals(forCks);
178+
}
179+
171180
public CPU.CPUArch getArch() {
172181
return CPU.CPUArch.fromType(arch);
173182
}

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")
@@ -202,6 +207,8 @@ public Boolean getVnf() {
202207
return isVnf;
203208
}
204209

210+
public Boolean getForCks() { return forCks; }
211+
205212
public CPU.CPUArch getArch() {
206213
if (StringUtils.isBlank(arch)) {
207214
return null;

0 commit comments

Comments
 (0)