feat(cluster): Add cluster setupMode (manual|hetzner|aws|digitalocean) with conditional Hetzner auto-provisioning; UI and dashboard improvements; dependency upgrades
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/cloudly',
|
||||
version: '5.0.6',
|
||||
version: '5.1.0',
|
||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||
}
|
||||
|
@@ -24,11 +24,13 @@ export class ClusterManager {
|
||||
this.typedrouter.addTypedHandler<plugins.servezoneInterfaces.requests.cluster.IRequest_CreateCluster>(
|
||||
new plugins.typedrequest.TypedHandler('createCluster', async (dataArg) => {
|
||||
// TODO: guards
|
||||
const setupMode = dataArg.setupMode || 'manual'; // Default to manual if not specified
|
||||
const cluster = await this.createCluster({
|
||||
id: plugins.smartunique.uniSimple('cluster'),
|
||||
data: {
|
||||
userId: null, // this is created by the createCluster method
|
||||
name: dataArg.clusterName,
|
||||
setupMode: setupMode,
|
||||
acmeInfo: null,
|
||||
cloudlyUrl: `https://${this.cloudlyRef.config.data.publicUrl}:${this.cloudlyRef.config.data.publicPort}/`,
|
||||
servers: [],
|
||||
@@ -36,7 +38,12 @@ export class ClusterManager {
|
||||
},
|
||||
});
|
||||
console.log(await cluster.createSavableObject());
|
||||
this.cloudlyRef.serverManager.ensureServerInfrastructure();
|
||||
|
||||
// Only auto-provision servers if setupMode is 'hetzner'
|
||||
if (setupMode === 'hetzner') {
|
||||
this.cloudlyRef.serverManager.ensureServerInfrastructure();
|
||||
}
|
||||
|
||||
return {
|
||||
cluster: await cluster.createSavableObject(),
|
||||
};
|
||||
|
@@ -55,6 +55,12 @@ export class CloudlyServerManager {
|
||||
// get all clusters
|
||||
const allClusters = await this.cloudlyRef.clusterManager.getAllClusters();
|
||||
for (const cluster of allClusters) {
|
||||
// Skip clusters that are not set up for Hetzner auto-provisioning
|
||||
if (cluster.data.setupMode !== 'hetzner') {
|
||||
console.log(`Skipping server provisioning for cluster ${cluster.id} - setupMode is ${cluster.data.setupMode || 'manual'}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// get existing servers
|
||||
const servers = await this.getServersByCluster(cluster);
|
||||
|
||||
|
Reference in New Issue
Block a user