Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restructure the thanos components #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 104 additions & 126 deletions api/v1alpha1/observatorium_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@ type ObservatoriumSpec struct {
ObjectStorageConfig ObjectStorageConfig `json:"objectStorageConfig"`
// Hashrings describes a list of Hashrings
Hashrings []*Hashring `json:"hashrings"`
// Thanos CompactSpec
Compact CompactSpec `json:"compact"`
// Thanos Receive Controller Spec
ThanosReceiveController ThanosReceiveControllerSpec `json:"thanosReceiveController,omitempty"`
// Thanos ThanosPersistentSpec
Receivers ReceiversSpec `json:"receivers"`
// Thanos QueryFrontend
QueryFrontend QueryFrontendSpec `json:"queryFrontend,omitempty"`
// Thanos StoreSpec
Store StoreSpec `json:"store"`
// Thanos RulerSpec
Rule RuleSpec `json:"rule"`
// Thanos
// +optional
Thanos ThanosSpec `json:"thanos"`
// API
API APISpec `json:"api,omitempty"`
// Query
Query QuerySpec `json:"query,omitempty"`
// Loki
// +optional
Loki *LokiSpec `json:"loki,omitempty"`
Expand All @@ -61,6 +50,27 @@ type ObservatoriumSpec struct {
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
}

type ThanosSpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// Thanos Compact
Compact CompactSpec `json:"compact"`
// Thanos Query
Query QuerySpec `json:"query,omitempty"`
// Thanos Query Frontend
QueryFrontend QueryFrontendSpec `json:"queryFrontend,omitempty"`
// Thanos Receive Controller
ReceiveController ReceiveControllerSpec `json:"receiveController,omitempty"`
// Thanos Thanos Receiver
Receivers ReceiversSpec `json:"receivers"`
// Thanos Ruler
Rule RuleSpec `json:"rule"`
// Thanos Store
Store StoreSpec `json:"store"`
}

type ObjectStorageConfig struct {
// Object Store Config Secret for Thanos
Thanos *ThanosObjectStorageConfigSpec `json:"thanos"`
Expand Down Expand Up @@ -96,11 +106,7 @@ type LokiObjectStorageConfigSpec struct {
RegionKey string `json:"regionKey"`
}

type ThanosReceiveControllerSpec struct {
// Receive Controller image
Image string `json:"image,omitempty"`
// Version describes the version of Thanos receive controller to use.
Version string `json:"version,omitempty"`
type ReceiveControllerSpec struct {
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
Expand All @@ -110,12 +116,8 @@ type ThanosReceiveControllerSpec struct {
}

type ReceiversSpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Number of Receiver replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// ReplicationFactor defines the number of copies of every time-series
Expand All @@ -129,10 +131,6 @@ type ReceiversSpec struct {
}

type StoreSpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
Shards *int32 `json:"shards,omitempty"`
Expand All @@ -148,10 +146,6 @@ type StoreSpec struct {

// StoreCacheSpec describes configuration for Store Memcached
type StoreCacheSpec struct {
// Memcached image
Image string `json:"image,omitempty"`
// Version of Memcached image to be deployed.
Version string `json:"version,omitempty"`
// Memcached Prometheus Exporter image
ExporterImage string `json:"exporterImage,omitempty"`
// Version of Memcached Prometheus Exporter image to be deployed.
Expand All @@ -171,6 +165,85 @@ type StoreCacheSpec struct {
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type QuerySpec struct {
// Number of Query replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Queriers.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type RuleConfig struct {
// Rule ConfigMap Name
Name string `json:"name"`
// Rule ConfigMap key
Key string `json:"key"`
}

type RuleSpec struct {
// Number of Rule replicas.
Replicas *int32 `json:"replicas,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// RulesConfig configures rules from the configmaps
// +optional
RulesConfig []RuleConfig `json:"rulesConfig,omitempty"`
// AlertmanagerURLs
// +optional
AlertmanagerURLs []string `json:"alertmanagerURLs,omitempty"`
// ReloaderImage is an image of configmap reloader
// +optional
ReloaderImage string `json:"reloaderImage,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// Compute Resources required by this container.
// +optional
ReloaderResources v1.ResourceRequirements `json:"reloaderResources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Rulers.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type CompactSpec struct {
// Number of Compact replicas.
Replicas *int32 `json:"replicas,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// RetentionResolutionRaw
RetentionResolutionRaw string `json:"retentionResolutionRaw"`
// RetentionResolutionRaw
RetentionResolution5m string `json:"retentionResolution5m"`
// RetentionResolutionRaw
RetentionResolution1h string `json:"retentionResolution1h"`
// EnableDownsampling enables downsampling.
EnableDownsampling bool `json:"enableDownsampling,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Compactors.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type VolumeClaimTemplate struct {
Spec v1.PersistentVolumeClaimSpec `json:"spec"`
}

type QueryFrontendSpec struct {
// Number of Query Frontend replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Query Frontends.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

// Permission is an Observatorium RBAC permission.
type Permission string

Expand Down Expand Up @@ -294,101 +367,6 @@ type APISpec struct {
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type QuerySpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Number of Query replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Queriers.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type RuleConfig struct {
// Rule ConfigMap Name
Name string `json:"name"`
// Rule ConfigMap key
Key string `json:"key"`
}

type RuleSpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Number of Rule replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// RulesConfig configures rules from the configmaps
// +optional
RulesConfig []RuleConfig `json:"rulesConfig,omitempty"`
// AlertmanagerURLs
// +optional
AlertmanagerURLs []string `json:"alertmanagerURLs,omitempty"`
// ReloaderImage is an image of configmap reloader
// +optional
ReloaderImage string `json:"reloaderImage,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// Compute Resources required by this container.
// +optional
ReloaderResources v1.ResourceRequirements `json:"reloaderResources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Rulers.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type CompactSpec struct {
// Thanos image
Image string `json:"image,omitempty"`
// Number of Compact replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Thanos image to be deployed.
Version string `json:"version,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// RetentionResolutionRaw
RetentionResolutionRaw string `json:"retentionResolutionRaw"`
// RetentionResolutionRaw
RetentionResolution5m string `json:"retentionResolution5m"`
// RetentionResolutionRaw
RetentionResolution1h string `json:"retentionResolution1h"`
// EnableDownsampling enables downsampling.
EnableDownsampling bool `json:"enableDownsampling,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Compactors.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type VolumeClaimTemplate struct {
Spec v1.PersistentVolumeClaimSpec `json:"spec"`
}

type QueryFrontendSpec struct {
// Thanos Query Frontend image
Image string `json:"image,omitempty"`
// Number of Query Frontend replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Query Frontend image to be deployed.
Version string `json:"version,omitempty"`
// Compute Resources required by this container.
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ServiceMonitor enables deploying a service monitor for the Thanos Query Frontends.
// +optional
ServiceMonitor bool `json:"serviceMonitor,omitempty"`
}

type Hashring struct {
// Thanos Hashring name
Hashring string `json:"hashring"`
Expand Down
40 changes: 28 additions & 12 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading