Mark subproject as dirty in CMKS - Infra
This commit is contained in:
89
src/EntKube.Web/Data/AppDeployment.cs
Normal file
89
src/EntKube.Web/Data/AppDeployment.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
namespace EntKube.Web.Data;
|
||||
|
||||
/// <summary>
|
||||
/// An app deployment represents a deployable unit targeting a specific cluster
|
||||
/// and namespace. Think of it like an ArgoCD Application — it describes what
|
||||
/// should be deployed, where, and tracks whether the live state matches.
|
||||
///
|
||||
/// A deployment can be defined three ways:
|
||||
/// - Manual: structured form (containers, services, PVCs) → generated manifests
|
||||
/// - Yaml: raw K8s YAML pasted or uploaded
|
||||
/// - HelmChart: a Helm chart with repo, name, version, and dynamic values
|
||||
///
|
||||
/// Regardless of type, the platform tracks the deployment's sync and health
|
||||
/// status by comparing desired state to live cluster state.
|
||||
/// </summary>
|
||||
public class AppDeployment
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A human-friendly name for this deployment (e.g. "billing-api-prod").
|
||||
/// Must be unique within an app.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How this deployment is defined — Manual form, raw YAML, or Helm chart.
|
||||
/// </summary>
|
||||
public DeploymentType Type { get; set; }
|
||||
|
||||
// ── Target ──
|
||||
|
||||
/// <summary>
|
||||
/// The environment this deployment targets (e.g. Production).
|
||||
/// </summary>
|
||||
public Guid EnvironmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cluster within that environment where resources will be applied.
|
||||
/// </summary>
|
||||
public Guid ClusterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Kubernetes namespace for all resources in this deployment.
|
||||
/// </summary>
|
||||
public required string Namespace { get; set; }
|
||||
|
||||
// ── Status (ArgoCD-style) ──
|
||||
|
||||
public SyncStatus SyncStatus { get; set; } = SyncStatus.Unknown;
|
||||
public HealthStatus HealthStatus { get; set; } = HealthStatus.Unknown;
|
||||
public string? StatusMessage { get; set; }
|
||||
public DateTime? LastSyncedAt { get; set; }
|
||||
|
||||
// ── Helm-specific fields (only used when Type == HelmChart) ──
|
||||
|
||||
/// <summary>
|
||||
/// The Helm chart repository URL (e.g. "https://charts.bitnami.com/bitnami").
|
||||
/// </summary>
|
||||
public string? HelmRepoUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The chart name within the repository (e.g. "postgresql").
|
||||
/// </summary>
|
||||
public string? HelmChartName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The chart version to deploy (e.g. "15.5.0").
|
||||
/// </summary>
|
||||
public string? HelmChartVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Helm values as YAML text. These override the chart's default values.
|
||||
/// Stored as free-form YAML so any chart's values can be represented.
|
||||
/// </summary>
|
||||
public string? HelmValues { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
// Navigation
|
||||
public App App { get; set; } = null!;
|
||||
public Environment Environment { get; set; } = null!;
|
||||
public KubernetesCluster Cluster { get; set; } = null!;
|
||||
public ICollection<DeploymentManifest> Manifests { get; set; } = [];
|
||||
public ICollection<DeploymentResource> Resources { get; set; } = [];
|
||||
public ICollection<StorageBinding> StorageBindings { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user