@@ -7,13 +7,10 @@ import (
77 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88)
99
10- // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
11- // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
12-
1310// KollectSinkSpec defines the desired state of KollectSink.
1411type KollectSinkSpec struct {
1512 // type selects the sink backend implementation.
16- // +kubebuilder:validation:Enum=git;gitlab;s3;gcs;prometheus
13+ // +kubebuilder:validation:Enum=git;gitlab;s3;gcs;postgres;kafka
1714 // +required
1815 Type string `json:"type"`
1916
@@ -33,6 +30,49 @@ type KollectSinkSpec struct {
3330 // The annotation kollect.dev/test-connection=true has the same effect.
3431 // +optional
3532 ConnectionTest bool `json:"connectionTest,omitempty"`
33+
34+ // cluster labels exported inventory in multi-cluster installs.
35+ // +optional
36+ Cluster string `json:"cluster,omitempty"`
37+
38+ // postgres configures a PostgreSQL database sink.
39+ // +optional
40+ Postgres * PostgresSpec `json:"postgres,omitempty"`
41+
42+ // kafka configures a Kafka or Redpanda event sink.
43+ // +optional
44+ Kafka * KafkaSpec `json:"kafka,omitempty"`
45+ }
46+
47+ // PostgresSpec configures PostgreSQL upsert export.
48+ type PostgresSpec struct {
49+ // databaseRef references a Secret containing the connection string (key dsn or url).
50+ // +required
51+ DatabaseRef * SecretReference `json:"databaseRef"`
52+
53+ // table is the destination table name.
54+ // +required
55+ Table string `json:"table"`
56+
57+ // schema is the PostgreSQL schema (default public).
58+ // +optional
59+ Schema string `json:"schema,omitempty"`
60+ }
61+
62+ // KafkaSpec configures Kafka inventory change events.
63+ type KafkaSpec struct {
64+ // brokers lists Kafka bootstrap addresses (host:port).
65+ // +required
66+ // +listType=atomic
67+ Brokers []string `json:"brokers"`
68+
69+ // topic is the destination topic for inventory events.
70+ // +required
71+ Topic string `json:"topic"`
72+
73+ // secretRef references a Secret with optional SASL/TLS credentials.
74+ // +optional
75+ SecretRef * SecretReference `json:"secretRef,omitempty"`
3676}
3777
3878// TLSSpec configures custom CA trust for sink endpoints.
@@ -64,20 +104,7 @@ type SecretReference struct {
64104
65105// KollectSinkStatus defines the observed state of KollectSink.
66106type KollectSinkStatus struct {
67- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
68- // Important: Run "make" to regenerate code after modifying this file
69-
70- // See Kubernetes API conventions for typical status properties.
71-
72107 // conditions represent the current state of the KollectSink resource.
73- // Each condition has a unique type and reflects the status of a specific aspect of the resource.
74- //
75- // Standard condition types include:
76- // - "Available": the resource is fully functional
77- // - "Progressing": the resource is being created or updated
78- // - "Degraded": the resource failed to reach or maintain its desired state
79- //
80- // The status of each condition is one of True, False, or Unknown.
81108 // +listType=map
82109 // +listMapKey=type
83110 // +optional
0 commit comments