78 lines
2.2 KiB
TypeScript
78 lines
2.2 KiB
TypeScript
import type { IServiceRessources } from './docker.js';
|
|
|
|
export interface IService {
|
|
id: string;
|
|
data: {
|
|
name: string;
|
|
description: string;
|
|
imageId: string;
|
|
imageVersion: string;
|
|
environment: { [key: string]: string };
|
|
/**
|
|
* the main secret bundle id, exclusive to the service
|
|
*/
|
|
secretBundleId: string;
|
|
/**
|
|
* those secret bundle ids do not belong to the service itself
|
|
* and thus live past the service lifecycle
|
|
*/
|
|
additionalSecretBundleIds?: string[];
|
|
|
|
/**
|
|
* Service category determines deployment behavior
|
|
* - base: Core services that run on every node (coreflow, coretraffic, corelog)
|
|
* - distributed: Services that run on limited nodes (cores3, coremongo)
|
|
* - workload: User applications
|
|
*/
|
|
serviceCategory: 'base' | 'distributed' | 'workload';
|
|
|
|
/**
|
|
* Deployment strategy for the service
|
|
* - all-nodes: Deploy to every node in the cluster
|
|
* - limited-replicas: Deploy to a limited number of nodes
|
|
* - custom: Custom deployment logic
|
|
*/
|
|
deploymentStrategy: 'all-nodes' | 'limited-replicas' | 'custom';
|
|
|
|
/**
|
|
* Maximum number of replicas for distributed services
|
|
* For example, 3 for cores3 or coremongo
|
|
*/
|
|
maxReplicas?: number;
|
|
|
|
/**
|
|
* Whether to enforce anti-affinity rules
|
|
* When true, tries to spread deployments across different BareMetal servers
|
|
*/
|
|
antiAffinity?: boolean;
|
|
|
|
scaleFactor: number;
|
|
balancingStrategy: 'round-robin' | 'least-connections';
|
|
ports: {
|
|
web: number;
|
|
custom?: { [domain: string]: string };
|
|
};
|
|
resources?: IServiceRessources;
|
|
domains: {
|
|
/**
|
|
* Optional domain ID to specify which domain to use
|
|
* If not specified, will use the default domain or require manual configuration
|
|
*/
|
|
domainId?: string;
|
|
/**
|
|
* The subdomain name (e.g., 'api', 'www', '@' for root)
|
|
*/
|
|
name: string;
|
|
/**
|
|
* The port to expose (defaults to ports.web if not specified)
|
|
*/
|
|
port?: number;
|
|
/**
|
|
* The protocol for this domain entry
|
|
*/
|
|
protocol?: 'http' | 'https' | 'ssh';
|
|
}[];
|
|
deploymentIds: string[];
|
|
};
|
|
}
|