-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1064 from rancher/issue-1051
Add controllers for OTEL log scraper
- Loading branch information
Showing
23 changed files
with
1,838 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
opnimeta "github.com/rancher/opni/pkg/util/meta" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type CollectorState string | ||
|
||
const ( | ||
CollectorStatePending CollectorState = "pending" | ||
CollectorStateReady CollectorState = "ready" | ||
CollectorStateError CollectorState = "error" | ||
) | ||
|
||
type CollectorSpec struct { | ||
opnimeta.ImageSpec `json:",inline,omitempty"` | ||
AgentEndpoint string `json:"agentEndpoint,omitempty"` | ||
SystemNamespace string `json:"systemNamespace,omitempty"` | ||
ClusterID string `json:"clusterID"` | ||
LoggingConfig *corev1.LocalObjectReference `json:"loggingConfig,omitempty"` | ||
} | ||
|
||
// CollectorStatus defines the observed state of Collector | ||
type CollectorStatus struct { | ||
Conditions []string `json:"conditions,omitempty"` | ||
State CollectorState `json:"state,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:storageversion | ||
|
||
// Collector is the Schema for the logadapters API | ||
type Collector struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CollectorSpec `json:"spec,omitempty"` | ||
Status CollectorStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// CollectorList contains a list of Collector | ||
type CollectorList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Collector `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Collector{}, &CollectorList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package v1beta1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// CollectorConfigSpec defines the desired state of CollectorConfig | ||
type CollectorConfigSpec struct { | ||
// +kubebuilder:validation:Enum:=aks;eks;gke;k3s;rke;rke2;generic | ||
// +kubebuilder:validation:Required | ||
Provider LogProvider `json:"provider"` | ||
|
||
SELinuxEnabled bool `json:"seLinuxEnabled,omitempty"` | ||
Selector Selector `json:"selector,omitempty"` | ||
|
||
AKS *AKSSpec `json:"aks,omitempty"` | ||
EKS *EKSSpec `json:"eks,omitempty"` | ||
GKE *GKESpec `json:"gke,omitempty"` | ||
K3S *K3SSpec `json:"k3s,omitempty"` | ||
RKE *RKESpec `json:"rke,omitempty"` | ||
RKE2 *RKE2Spec `json:"rke2,omitempty"` | ||
} | ||
|
||
type SelectorConfig struct { | ||
Namespace string `json:"namespace,omitempty"` | ||
PodNames []string `json:"podNames,omitempty"` | ||
} | ||
|
||
type Selector struct { | ||
Include []SelectorConfig `json:"include,omitempty"` | ||
Exclude []SelectorConfig `json:"exclude,omitempty"` | ||
} | ||
|
||
// CollectorConfigStatus defines the observed state of CollectorConfig | ||
type CollectorConfigStatus struct { | ||
Phase string `json:"phase,omitempty"` | ||
Message string `json:"message,omitempty"` | ||
Conditions []string `json:"conditions,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:storageversion | ||
|
||
// CollectorConfig is the Schema for the logadapters API | ||
type CollectorConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CollectorConfigSpec `json:"spec,omitempty"` | ||
Status CollectorConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// CollectorConfigList contains a list of CollectorConfig | ||
type CollectorConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CollectorConfig `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CollectorConfig{}, &CollectorConfigList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.