@@ -72,14 +72,16 @@ type OpenAICompatibleSpec struct {
7272 Model string `json:"model"`
7373}
7474
75- // +kubebuilder:validation:XValidation:rule="has(self.memberProjects) && size(self.memberProjects) > 0 ? !has(self.apiKeys) || size( self.apiKeys) == 0 : has(self.apiKeys) && size(self.apiKeys) > 0",message="Exactly one of memberProjects or apiKeys must be non-empty ."
75+ // +kubebuilder:validation:XValidation:rule="( has(self.memberProjects) && size(self.memberProjects) > 0 ? 1 : 0) + (has( self.remoteCoroot) ? 1 : 0) + ( has(self.apiKeys) && size(self.apiKeys) > 0 ? 1 : 0) == 1 ",message="Exactly one of memberProjects, remoteCoroot, or apiKeys must be set ."
7676type ProjectSpec struct {
7777 // Project name (e.g., production, staging; required).
7878 // +kubebuilder:validation:Required
7979 Name string `json:"name,omitempty"`
8080 // Names of existing projects to aggregate (multi-cluster mode).
8181 MemberProjects []string `json:"memberProjects,omitempty"`
82- // Project API keys, used by agents to send telemetry data (required unless memberProjects is set).
82+ // Use another Coroot instance as the data source for this project.
83+ RemoteCoroot * RemoteCorootSpec `json:"remoteCoroot,omitempty"`
84+ // Project API keys, used by agents to send telemetry data (required unless memberProjects or remoteCoroot is set).
8385 ApiKeys []ApiKeySpec `json:"apiKeys,omitempty"`
8486 // Notification integrations.
8587 NotificationIntegrations * NotificationIntegrationsSpec `json:"notificationIntegrations,omitempty"`
@@ -100,6 +102,21 @@ type ApiKeySpec struct {
100102 Description string `json:"description,omitempty"`
101103}
102104
105+ type RemoteCorootSpec struct {
106+ // Base URL of the remote Coroot instance.
107+ // +kubebuilder:validation:Pattern="^https?://.+$"
108+ Url string `json:"url,omitempty"`
109+ // Whether to skip verification of the Coroot server's TLS certificate.
110+ TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"`
111+ // API key of the remote project.
112+ ApiKey string `json:"apiKey,omitempty"`
113+ // Secret containing the API key.
114+ ApiKeySecret * corev1.SecretKeySelector `json:"apiKeySecret,omitempty"`
115+ // Prometheus query resolution/refresh interval (e.g. 15s).
116+ // +kubebuilder:validation:Pattern="^[0-9]+[smhdwy]$"
117+ MetricResolution string `json:"metricResolution,omitempty"`
118+ }
119+
103120type NotificationIntegrationsSpec struct {
104121 // The URL of Coroot instance (required). Used for generating links in notifications.
105122 // +kubebuilder:validation:Pattern="^https?://.+$"
0 commit comments