- Add PendingServiceDiscovery model and database migration - Add PendingServices API controller for service assignment - Add KubernetesPendingSyncService for background sync - Add RBAC configuration for K8s service discovery - Update Dockerfile and K8s deployment configs - Add service discovery design documentation Workflow: K8s services with label managed-by=yarp are discovered and stored in pending table. Admin approves before they become active gateway downstream services.
28 lines
880 B
C#
28 lines
880 B
C#
namespace YarpGateway.Models;
|
|
|
|
public class GwPendingServiceDiscovery
|
|
{
|
|
public long Id { get; set; }
|
|
public string K8sServiceName { get; set; } = string.Empty;
|
|
public string K8sNamespace { get; set; } = string.Empty;
|
|
public string? K8sClusterIP { get; set; }
|
|
public string DiscoveredPorts { get; set; } = "[]";
|
|
public string Labels { get; set; } = "{}";
|
|
public int PodCount { get; set; } = 0;
|
|
public int Status { get; set; } = 0;
|
|
public string? AssignedClusterId { get; set; }
|
|
public string? AssignedBy { get; set; }
|
|
public DateTime? AssignedAt { get; set; }
|
|
public DateTime DiscoveredAt { get; set; } = DateTime.UtcNow;
|
|
public bool IsDeleted { get; set; } = false;
|
|
public int Version { get; set; } = 0;
|
|
}
|
|
|
|
public enum PendingServiceStatus
|
|
{
|
|
Pending = 0,
|
|
Approved = 1,
|
|
Rejected = 2,
|
|
K8sServiceNotFound = 3
|
|
}
|