Skip to content

CKS Enhancements #9102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 110 commits into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
4982b1b
CKS Enhancements - Phase 1
nvazquez Mar 7, 2024
20c4029
CKS Enhancements - Phase 2: Add and Remove external nodes to and from…
Pearl1594 Apr 10, 2024
d4500ea
Update remove node timeout global setting
Pearl1594 Apr 10, 2024
2d09811
CKS/NSX : Missing variables in worker nodes
Pearl1594 Apr 11, 2024
9d0e79d
CKS: Fix ISO attach logic
Pearl1594 Apr 18, 2024
67c75e1
Phase2: Fix Port - Node mapping when cluster is scaled in the presenc…
Pearl1594 May 2, 2024
5352198
CKS: Externalize control and worker node setup wait time and installa…
Pearl1594 Apr 10, 2024
033a636
Fix logger
nvazquez May 21, 2024
469c08d
Add missing headers and fix end of line on files
nvazquez May 22, 2024
f103c43
CKS Mark Nodes for Manual Upgrade and Filter Nodes to add to CKS clus…
nvazquez May 2, 2024
b72a7cd
Add support to deploy CKS cluster nodes on hosts dedicated to a domain
nvazquez May 2, 2024
1e40aed
Support unstacked ETCD
Pearl1594 May 2, 2024
8cfa6e6
Fix CKS cluster scaling and minor UI improvement
nvazquez May 7, 2024
fe81ae0
Reuse k8s cluster public IP for etcd nodes and rename etcd nodes
Pearl1594 May 7, 2024
b09c11f
Fix DNS resolver issue
Pearl1594 May 20, 2024
4499177
Update UDP active monitor to ICMP
Pearl1594 May 20, 2024
98389a1
Add hypervisor type to CKS cluster creation to fix CKS cluster creati…
nvazquez May 20, 2024
a490dbb
Fix build
nvazquez May 22, 2024
83a9fcd
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 22, 2024
c9097ee
Fix logger
nvazquez May 22, 2024
4be1d33
Modify hypervisor param description in the create CKS cluster API
Pearl1594 May 23, 2024
4b4a675
CKS delete fails when external nodes are present
Pearl1594 May 23, 2024
aca606e
Improve network rules cleanup on failure adding external nodes to CKS…
nvazquez May 23, 2024
589adae
UI: Fix etcd template was not honoured
nvazquez May 23, 2024
bac0a2e
CKS: Exclude etcd nodes when calculating port numbers
Pearl1594 May 28, 2024
90db24f
Fix network cleanup in case of CKS cluster failure
nvazquez May 28, 2024
00a98ea
Externalize retries and inverval for NSX segment deletion
nvazquez May 28, 2024
7483da2
Fix CKS scaling when external node(s) present in the cluster
Pearl1594 May 28, 2024
5a11451
CKS: Fix port numbers displayed against ETCD nodes
Pearl1594 May 28, 2024
97aa35a
Add node version details to every node of k8s cluster - as we now sup…
Pearl1594 May 28, 2024
7cf7f1f
UI: Fix CKS cluster creation templates listing for non admins
nvazquez May 28, 2024
2eae6a9
CKS: Prevent etcd node start port number to coincide with k8s cluster…
Pearl1594 May 29, 2024
1d6d5d2
CKS: Set default kubernetes cluster node version to the kubernetes cl…
Pearl1594 May 29, 2024
a501082
Fix CKS cluster version upgrade
nvazquez May 29, 2024
006c5cb
CKS: Fix etcd port numbers being skipped
Pearl1594 May 30, 2024
8ca9013
Fix CKS cluster with etcd nodes on VPC
nvazquez May 31, 2024
27f7a16
Move schema and upgrade for 4.20
nvazquez Jun 5, 2024
5403757
Fix logger
nvazquez Jun 5, 2024
94bcc3f
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jun 5, 2024
c087de4
Merge branch '4.19'
DaanHoogland Oct 2, 2024
87a528d
Merge branch 'main' into cks-enhancements-upstream
nvazquez Oct 3, 2024
9a1b32e
Merge branch 'main' into cks-enhancements-upstream
nvazquez Oct 3, 2024
f8fd8e0
Fix after rebasing
nvazquez Oct 3, 2024
b0eb65f
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jan 2, 2025
2a1de76
Add support for using different CNI plugins with CKS
Pearl1594 Jun 26, 2024
51d4403
CKS: Do not pass AS number when network ID is passed
Pearl1594 Jun 26, 2024
1dadd25
Fix deletion of Userdata / CNI Configuration in projects
Pearl1594 Jul 8, 2024
e5d377a
CKS: Add CNI configuration details to the response and UI
Pearl1594 Jul 8, 2024
b3ff5a3
Explicit events for registering cni configuration
Pearl1594 Jul 8, 2024
3067641
Add Delete cni configuration API
Pearl1594 Jul 8, 2024
8826d37
Fix CKS deployment when using VPC tiers with custom ACLs
Pearl1594 Jul 10, 2024
84eca88
Fix DNS list on VR
nvazquez Jul 15, 2024
749a71d
CKS: Use Network offering of the network passed during CKS cluster cr…
Pearl1594 Jul 17, 2024
27d08e2
CKS cluster with guest IP
Pearl1594 Jul 17, 2024
c884423
Fix: Use control node guest IP as join IP for external nodes addition
nvazquez Jul 19, 2024
1952f2e
Fix DNS resolver issue
Pearl1594 Jul 31, 2024
9905f07
Improve etcd indexing - start from 1
Pearl1594 Jul 31, 2024
fe3efdb
CKS: Add external node to a CKS cluster deployed with etcd node(s) su…
Pearl1594 Aug 1, 2024
ab27183
Tweak setup-kube-system script for baremetal external nodes
Pearl1594 Aug 1, 2024
a4a5541
Consider cordoned nodes while getting ready nodes
Pearl1594 Aug 6, 2024
43d2131
Fix CKS cluster scale calculations
nvazquez Aug 7, 2024
e7884b3
Set token TTL to 0 (no expire) for external etcd
Pearl1594 Sep 5, 2024
313facb
Fix missing quotes
Pearl1594 Sep 6, 2024
663dce1
Fix build
nvazquez Jan 2, 2025
ce50ad2
Revert PR 9133
nvazquez Jan 4, 2025
89effc7
Add calico commands for ens35 interface
nvazquez Jan 7, 2025
36a02b8
Address review comments: plan CKS cluster deployment based on the nod…
nvazquez Jan 8, 2025
4b6e0ec
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jan 8, 2025
7501b74
Add qemu-guest-agent dependency for kvm based templates
Pearl1594 Jan 8, 2025
397f25d
Add marvin test for CKS clusters with different offerings per node type
nvazquez Jan 9, 2025
258a2cb
Remove test tag
nvazquez Jan 9, 2025
90eb42a
Add marvin test and fix update template for cks and since annotations
nvazquez Jan 13, 2025
e8a96d4
Fix marvin test for adding and removing external nodes
nvazquez Jan 14, 2025
b310852
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jan 17, 2025
67a51be
Merge branch 'main' into cks-enhancements-upstream
nvazquez Feb 3, 2025
0662117
Merge branch 'main' into cks-enhancements-upstream
nvazquez Feb 24, 2025
f53d137
Fix since version on API params
nvazquez Feb 24, 2025
6568c50
Address review comments
nvazquez Feb 24, 2025
82e0bf5
Fix unit test
nvazquez Feb 24, 2025
ddaa65f
Address review comments
nvazquez Feb 25, 2025
fbe0496
Merge branch 'main' into cks-enhancements-upstream
nvazquez Feb 26, 2025
e904b1b
Merge branch 'main' into cks-enhancements-upstream
nvazquez Mar 17, 2025
fe3e914
UI: Make CKS public templates visible to non-admins on CKS cluster cr…
nvazquez Mar 18, 2025
98bb4af
Fix linter
nvazquez Apr 7, 2025
94449f4
Merge branch 'main' into cks-enhancements-upstream
nvazquez Apr 14, 2025
a9bc998
Merge branch 'main' into cks-enhancements-upstream
nvazquez Apr 25, 2025
bfa6f52
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 11, 2025
fd730a0
Fix merge error
nvazquez May 12, 2025
0f79583
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 16, 2025
5e7f86b
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 20, 2025
6804d62
Merge branch 'main' of https://github.com/apache/cloudstack into cks-…
Pearl1594 May 22, 2025
ca1b116
Fix positional parameters on the create kubernetes ISO script and mak…
nvazquez May 22, 2025
e2065a0
fix etcd port displayed
Pearl1594 May 23, 2025
f0130d2
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 28, 2025
138ed60
Further improvements to CKS (#118)
Pearl1594 May 28, 2025
20cbc1f
Add missing headers
nvazquez May 28, 2025
6264c21
Fix linter
nvazquez May 28, 2025
bcf7b6d
Address more review comments
nvazquez May 28, 2025
db97e96
Fix unit test
nvazquez May 28, 2025
9b7ee63
Merge branch 'main' into cks-enhancements-upstream
nvazquez May 28, 2025
9d1699b
Fix scaling case for the same offering
nvazquez May 29, 2025
05f357e
Revert "Login to a specific Project view"
nvazquez May 30, 2025
0be2cd5
Revert "Fix CKS HA clusters" (#120)
nvazquez Jun 2, 2025
86ea8c7
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jun 10, 2025
5dcac1e
Apply suggestions from code review about user data
nvazquez Jun 10, 2025
db50411
Update api/src/main/java/org/apache/cloudstack/api/command/user/userd…
nvazquez Jun 10, 2025
2f8e9ab
Refactor column names and schema path
nvazquez Jun 10, 2025
4875d15
Merge branch 'main' into cks-enhancements-upstream
nvazquez Jun 12, 2025
2771ab7
Fix scaling for non existing previous offering per node type
nvazquez Jun 17, 2025
b09b75a
Update node offering entry if there was an existing offering but a gl…
nvazquez Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ public class EventTypes {

//registering userdata events
public static final String EVENT_REGISTER_USER_DATA = "REGISTER.USER.DATA";
public static final String EVENT_REGISTER_CNI_CONFIG = "REGISTER.CNI.CONFIG";
public static final String EVENT_DELETE_CNI_CONFIG = "DELETE.CNI.CONFIG";

//register for user API and secret keys
public static final String EVENT_REGISTER_FOR_SECRET_API_KEY = "REGISTER.USER.KEY";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ enum Event {
AutoscaleRequested,
ScaleUpRequested,
ScaleDownRequested,
AddNodeRequested,
RemoveNodeRequested,
UpgradeRequested,
OperationSucceeded,
OperationFailed,
Expand All @@ -59,6 +61,8 @@ enum State {
Stopped("All resources for the Kubernetes cluster are destroyed, Kubernetes cluster may still have ephemeral resource like persistent volumes provisioned"),
Scaling("Transient state in which resources are either getting scaled up/down"),
Upgrading("Transient state in which cluster is getting upgraded"),
Importing("Transient state in which additional nodes are added as worker nodes to a cluster"),
RemovingNodes("Transient state in which additional nodes are removed from a cluster"),
Alert("State to represent Kubernetes clusters which are not in expected desired state (operationally in active control place, stopped cluster VM's etc)."),
Recovering("State in which Kubernetes cluster is recovering from alert state"),
Destroyed("End state of Kubernetes cluster in which all resources are destroyed, cluster will not be usable further"),
Expand Down Expand Up @@ -96,6 +100,17 @@ enum State {
s_fsm.addTransition(State.Upgrading, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.Upgrading, Event.OperationFailed, State.Alert);

s_fsm.addTransition(State.Running, Event.AddNodeRequested, State.Importing);
s_fsm.addTransition(State.Alert, Event.AddNodeRequested, State.Importing);
s_fsm.addTransition(State.Importing, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.Importing, Event.OperationFailed, State.Running);
s_fsm.addTransition(State.Alert, Event.OperationSucceeded, State.Running);

s_fsm.addTransition(State.Running, Event.RemoveNodeRequested, State.RemovingNodes);
s_fsm.addTransition(State.Alert, Event.RemoveNodeRequested, State.RemovingNodes);
s_fsm.addTransition(State.RemovingNodes, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.RemovingNodes, Event.OperationFailed, State.Running);

s_fsm.addTransition(State.Alert, Event.RecoveryRequested, State.Recovering);
s_fsm.addTransition(State.Recovering, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.Recovering, Event.OperationFailed, State.Alert);
Expand Down Expand Up @@ -142,4 +157,13 @@ enum State {
Long getMaxSize();
Long getSecurityGroupId();
ClusterType getClusterType();
Long getControlNodeServiceOfferingId();
Long getWorkerNodeServiceOfferingId();
Long getEtcdNodeServiceOfferingId();
Long getControlNodeTemplateId();
Long getWorkerNodeTemplateId();
Long getEtcdNodeTemplateId();
Long getEtcdNodeCount();
Long getCniConfigId();
String getCniConfigDetails();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@

import org.apache.cloudstack.acl.ControlledEntity;

import java.util.Map;

import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
import com.cloud.utils.component.Adapter;

public interface KubernetesServiceHelper extends Adapter {

enum KubernetesClusterNodeType {
CONTROL, WORKER, ETCD, DEFAULT
}

ControlledEntity findByUuid(String uuid);
ControlledEntity findByVmId(long vmId);
void checkVmCanBeDestroyed(UserVm userVm);
boolean isValidNodeType(String nodeType);
Map<String, Long> getServiceOfferingNodeTypeMap(Map<String, Map<String, String>> serviceOfferingNodeTypeMap);
Map<String, Long> getTemplateNodeTypeMap(Map<String, Map<String, String>> templateNodeTypeMap);
void cleanupForAccount(Account account);
}
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,6 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
InternalLoadBalancerElementService getInternalLoadBalancerElementByNetworkServiceProviderId(long networkProviderId);
InternalLoadBalancerElementService getInternalLoadBalancerElementById(long providerId);
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();

boolean handleCksIsoOnNetworkVirtualRouter(Long virtualRouterId, boolean mount) throws ResourceUnavailableException;
}
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/network/vpc/Vpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,6 @@ public enum State {
String getIp6Dns1();

String getIp6Dns2();

boolean useRouterIpAsResolver();
}
8 changes: 4 additions & 4 deletions api/src/main/java/com/cloud/network/vpc/VpcService.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public interface VpcService {
* @param vpcName
* @param displayText
* @param cidr
* @param networkDomain TODO
* @param networkDomain TODO
* @param ip4Dns1
* @param ip4Dns2
* @param displayVpc TODO
* @param displayVpc TODO
* @param useVrIpResolver
* @return
* @throws ResourceAllocationException TODO
*/
Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String displayText, String cidr, String networkDomain,
String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2, Boolean displayVpc, Integer publicMtu, Integer cidrSize,
Long asNumber, List<Long> bgpPeerIds)
throws ResourceAllocationException;
Long asNumber, List<Long> bgpPeerIds, Boolean useVrIpResolver) throws ResourceAllocationException;

/**
* Persists VPC record in the database
Expand Down
24 changes: 20 additions & 4 deletions api/src/main/java/com/cloud/server/ManagementService.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
import org.apache.cloudstack.api.command.user.ssh.DeleteSSHKeyPairCmd;
import org.apache.cloudstack.api.command.user.ssh.ListSSHKeyPairsCmd;
import org.apache.cloudstack.api.command.user.ssh.RegisterSSHKeyPairCmd;
import org.apache.cloudstack.api.command.user.userdata.DeleteCniConfigurationCmd;
import org.apache.cloudstack.api.command.user.userdata.DeleteUserDataCmd;
import org.apache.cloudstack.api.command.user.userdata.ListUserDataCmd;
import org.apache.cloudstack.api.command.user.userdata.RegisterCniConfigurationCmd;
import org.apache.cloudstack.api.command.user.userdata.RegisterUserDataCmd;
import org.apache.cloudstack.api.command.user.vm.GetVMPasswordCmd;
import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
Expand Down Expand Up @@ -369,17 +371,23 @@ public interface ManagementService {
* The api command class.
* @return The list of userdatas found.
*/
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd);
Pair<List<? extends UserData>, Integer> listUserDatas(ListUserDataCmd cmd, boolean forCks);

/**
* Registers a cni configuration.
*
* @param cmd The api command class.
* @return A VO with the registered user data.
*/
UserData registerCniConfiguration(RegisterCniConfigurationCmd cmd);

/**
* Registers a userdata.
*
* @param cmd
* The api command class.
* @param cmd The api command class.
* @return A VO with the registered userdata.
*/
UserData registerUserData(RegisterUserDataCmd cmd);

/**
* Deletes a userdata.
*
Expand All @@ -389,6 +397,14 @@ public interface ManagementService {
*/
boolean deleteUserData(DeleteUserDataCmd cmd);

/**
* Deletes user data.
*
* @param cmd
* The api command class.
* @return True on success. False otherwise.
*/
boolean deleteCniConfiguration(DeleteCniConfigurationCmd cmd);
/**
* Search registered key pairs for the logged in user.
*
Expand Down
19 changes: 16 additions & 3 deletions api/src/main/java/com/cloud/template/TemplateApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,23 @@ public interface TemplateApiService {
VirtualMachineTemplate prepareTemplate(long templateId, long zoneId, Long storageId);


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

boolean detachIso(long vmId, boolean forced);

boolean attachIso(long isoId, long vmId, boolean forced);
/**
* Attach ISO to a VM
* @param isoId id of the ISO to attach
* @param vmId id of the VM to attach the ISO to
* @param extraParams: forced, isVirtualRouter
* @return true when operation succeeds, false if not
*/
boolean attachIso(long isoId, long vmId, Boolean... extraParams);

/**
* Deletes a template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ public enum TemplateFilter {

boolean isDeployAsIs();

boolean isForCks();

Long getUserDataId();

UserData.UserDataOverridePolicy getUserDataOverridePolicy();
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/user/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ public enum UserDataOverridePolicy {
String getUserData();

String getParams();
boolean isForCks();
}
3 changes: 2 additions & 1 deletion api/src/main/java/com/cloud/vm/UserVmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.Map;

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

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

void startVirtualMachine(UserVm vm) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;
void startVirtualMachine(UserVm vm, DeploymentPlan plan) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException;

void startVirtualMachineForHA(VirtualMachine vm, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlanner planner) throws InsufficientCapacityException, ResourceUnavailableException,
Expand Down
3 changes: 3 additions & 0 deletions api/src/main/java/com/cloud/vm/VmDetailConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public interface VmDetailConstants {
String DEPLOY_AS_IS_CONFIGURATION = "configurationId";
String KEY_PAIR_NAMES = "keypairnames";
String CKS_CONTROL_NODE_LOGIN_USER = "controlNodeLoginUser";
String CKS_NODE_TYPE = "node";
String OFFERING = "offering";
String TEMPLATE = "template";

// VMware to KVM VM migrations specific
String VMWARE_TO_KVM_PREFIX = "vmware-to-kvm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public enum ApiCommandResourceType {
ObjectStore(org.apache.cloudstack.storage.object.ObjectStore.class),
Bucket(org.apache.cloudstack.storage.object.Bucket.class),
QuotaTariff(org.apache.cloudstack.quota.QuotaTariff.class),
KubernetesCluster(null),
KubernetesCluster(com.cloud.kubernetes.cluster.KubernetesCluster.class),
KubernetesSupportedVersion(null),
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class);

Expand Down
22 changes: 22 additions & 0 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public class ApiConstants {
public static final String CN = "cn";
public static final String COMMAND = "command";
public static final String CMD_EVENT_TYPE = "cmdeventtype";
public static final String CNI_CONFIG = "cniconfig";
public static final String CNI_CONFIG_ID = "cniconfigurationid";
public static final String CNI_CONFIG_DETAILS = "cniconfigdetails";
public static final String CNI_CONFIG_NAME = "cniconfigname";
public static final String COMPONENT = "component";
public static final String CPU_CORE_PER_SOCKET = "cpucorepersocket";
public static final String CPU_NUMBER = "cpunumber";
Expand All @@ -140,6 +144,7 @@ public class ApiConstants {
public static final String ENCRYPT_FORMAT = "encryptformat";
public static final String ENCRYPT_ROOT = "encryptroot";
public static final String ENCRYPTION_SUPPORTED = "encryptionsupported";
public static final String ETCD_IPS = "etcdips";
public static final String MIN_IOPS = "miniops";
public static final String MAX_IOPS = "maxiops";
public static final String HYPERVISOR_SNAPSHOT_RESERVE = "hypervisorsnapshotreserve";
Expand Down Expand Up @@ -333,6 +338,7 @@ public class ApiConstants {
public static final String LBID = "lbruleid";
public static final String LB_PROVIDER = "lbprovider";
public static final String MAC_ADDRESS = "macaddress";
public static final String MANUAL_UPGRADE = "manualupgrade";
public static final String MAX = "max";
public static final String MAX_SNAPS = "maxsnaps";
public static final String MAX_BACKUPS = "maxbackups";
Expand All @@ -344,6 +350,7 @@ public class ApiConstants {
public static final String MIGRATIONS = "migrations";
public static final String MEMORY = "memory";
public static final String MODE = "mode";
public static final String MOUNT_CKS_ISO_ON_VR = "mountcksisoonvr";
public static final String MULTI_ARCH = "ismultiarch";
public static final String NSX_MODE = "nsxmode";
public static final String NETWORK_MODE = "networkmode";
Expand All @@ -360,6 +367,7 @@ public class ApiConstants {
public static final String NIC_PACKED_VIRTQUEUES_ENABLED = "nicpackedvirtqueuesenabled";
public static final String NEW_START_IP = "newstartip";
public static final String NEW_END_IP = "newendip";
public static final String KUBERNETES_NODE_VERSION = "kubernetesnodeversion";
public static final String NUM_RETRIES = "numretries";
public static final String OFFER_HA = "offerha";
public static final String OS_DISTRIBUTION = "osdistribution";
Expand Down Expand Up @@ -547,6 +555,7 @@ public class ApiConstants {
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
public static final String USER_SECRET_KEY = "usersecretkey";
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
public static final String VALUE = "value";
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
Expand All @@ -563,6 +572,12 @@ public class ApiConstants {

public static final String VLAN = "vlan";
public static final String VLAN_RANGE = "vlanrange";
public static final String WORKER_SERVICE_OFFERING_ID = "workerofferingid";
public static final String WORKER_SERVICE_OFFERING_NAME = "workerofferingname";
public static final String CONTROL_SERVICE_OFFERING_ID = "controlofferingid";
public static final String CONTROL_SERVICE_OFFERING_NAME = "controlofferingname";
public static final String ETCD_SERVICE_OFFERING_ID = "etcdofferingid";
public static final String ETCD_SERVICE_OFFERING_NAME = "etcdofferingname";
public static final String REMOVE_VLAN = "removevlan";
public static final String VLAN_ID = "vlanid";
public static final String ISOLATED_PVLAN = "isolatedpvlan";
Expand Down Expand Up @@ -913,6 +928,7 @@ public class ApiConstants {
public static final String SPLIT_CONNECTIONS = "splitconnections";
public static final String FOR_VPC = "forvpc";
public static final String FOR_NSX = "fornsx";
public static final String FOR_CKS = "forcks";
public static final String NSX_SUPPORT_LB = "nsxsupportlb";
public static final String NSX_SUPPORTS_INTERNAL_LB = "nsxsupportsinternallb";
public static final String FOR_TUNGSTEN = "fortungsten";
Expand Down Expand Up @@ -1121,6 +1137,10 @@ public class ApiConstants {
public static final String MASTER_NODES = "masternodes";
public static final String NODE_IDS = "nodeids";
public static final String CONTROL_NODES = "controlnodes";
public static final String ETCD_NODES = "etcdnodes";
public static final String EXTERNAL_NODES = "externalnodes";
public static final String IS_EXTERNAL_NODE = "isexternalnode";
public static final String IS_ETCD_NODE = "isetcdnode";
public static final String MIN_SEMANTIC_VERSION = "minimumsemanticversion";
public static final String MIN_KUBERNETES_VERSION_ID = "minimumkubernetesversionid";
public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize";
Expand All @@ -1129,6 +1149,8 @@ public class ApiConstants {
public static final String AUTOSCALING_ENABLED = "autoscalingenabled";
public static final String MIN_SIZE = "minsize";
public static final String MAX_SIZE = "maxsize";
public static final String NODE_TYPE_OFFERING_MAP = "nodeofferings";
public static final String NODE_TYPE_TEMPLATE_MAP = "nodetemplates";

public static final String BOOT_TYPE = "boottype";
public static final String BOOT_MODE = "bootmode";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

@Override
public void execute() {
boolean result = _templateService.detachIso(virtualMachineId, isForced());
boolean result = _templateService.detachIso(virtualMachineId, null, isForced());

Check warning on line 107 in api/src/main/java/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L107 was not covered by tests
if (result) {
UserVm userVm = _entityMgr.findById(UserVm.class, virtualMachineId);
UserVmResponse response = _responseGenerator.createUserVmResponse(getResponseView(), "virtualmachine", userVm).get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@
description = "(VMware only) true if VM deployments should preserve all the configurations defined for this template", since = "4.15.1")
private Boolean deployAsIs;

@Parameter(name=ApiConstants.FOR_CKS,
type = CommandType.BOOLEAN,
description = "if true, the templates would be available for deploying CKS clusters", since = "4.21.0")
protected Boolean forCks;

public String getDisplayText() {
return StringUtils.isBlank(displayText) ? getName() : displayText;
}
Expand Down Expand Up @@ -168,6 +173,10 @@
Boolean.TRUE.equals(deployAsIs);
}

public boolean isForCks() {
return Boolean.TRUE.equals(forCks);
}

Check warning on line 178 in api/src/main/java/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java#L176-L178

Added lines #L176 - L178 were not covered by tests

public CPU.CPUArch getArch() {
return CPU.CPUArch.fromType(arch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
since = "4.19.0")
private Boolean isVnf;

@Parameter(name = ApiConstants.FOR_CKS, type = CommandType.BOOLEAN,
description = "list templates that can be used to deploy CKS clusters",
since = "4.21.0")
private Boolean forCks;

@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING,
description = "the CPU arch of the template. Valid options are: x86_64, aarch64",
since = "4.20")
Expand Down Expand Up @@ -202,6 +207,8 @@
return isVnf;
}

public Boolean getForCks() { return forCks; }

Check warning on line 210 in api/src/main/java/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L210 was not covered by tests

public CPU.CPUArch getArch() {
if (StringUtils.isBlank(arch)) {
return null;
Expand Down
Loading
Loading