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

Refactor/telemetry types #841

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3de6d58
Start stubbing out methods for agent config.
Miles-Garnsey Jan 17, 2023
fd9c12c
Add reconciliation logic, tests.
Miles-Garnsey Jan 20, 2023
def6772
CRD upgrades, codegen upgrades.
Miles-Garnsey Jan 20, 2023
bc8917f
Remove RemoveSts functions, reinstate tests.
Miles-Garnsey Jan 23, 2023
dc0e0a8
Make type names more concise.
Miles-Garnsey Jan 23, 2023
ff5c2af
Fix npe, update codegen.
Miles-Garnsey Jan 23, 2023
dc07565
Switch yaml library to `sigs.k8s.io/yaml` to take advantage of better…
Miles-Garnsey Jan 25, 2023
32cebed
Fix unit tests to account for new yaml library.
Miles-Garnsey Jan 25, 2023
184e0f7
Move the reconciliation of the telemetry agent's resources into the C…
Miles-Garnsey Jan 25, 2023
a3554e7
Ensure we cater to configmap updates, not just creations.
Miles-Garnsey Jan 25, 2023
f77face
Massage results so that they integrate a bit better.
Miles-Garnsey Jan 25, 2023
357e3ee
Make sure agent reconciliation funcs have access to requeue delay.
Miles-Garnsey Jan 25, 2023
911f936
Create new CreateFailingFakeClient to assist tests.
Miles-Garnsey Jan 25, 2023
0078b01
Work around conflict between struct embedding and inability to modify…
Miles-Garnsey Jan 25, 2023
c6304bf
Add more tests to the reconciliation logic.
Miles-Garnsey Jan 25, 2023
9b21ce1
Fixes for unit tests.
Miles-Garnsey Jan 25, 2023
fd421a5
Make sure we're settings managed by labels.
Miles-Garnsey Jan 27, 2023
76391ea
Add envtests and kuttl tests.
Miles-Garnsey Jan 27, 2023
3af601c
Changelog.
Miles-Garnsey Jan 27, 2023
6c76cab
Fix configmap name.
Miles-Garnsey Jan 27, 2023
ee5b7f9
Add a default for when the Cassandra agent spec is not defined.
Miles-Garnsey Jan 27, 2023
10c3053
More work on getting envtests passing.
Miles-Garnsey Jan 27, 2023
f21d553
Ensure that all labels are set to clean up configmap when cluster del…
Miles-Garnsey Jan 30, 2023
f67024b
Ensure correct defaults for the agent.
Miles-Garnsey Jan 30, 2023
3078679
Fix another unit test.
Miles-Garnsey Jan 30, 2023
e163ffb
From recollection, the metrics agent config belongs in the same folde…
Miles-Garnsey Jan 30, 2023
6a48cb2
Fix mount path for config file.
Miles-Garnsey Jan 30, 2023
4445087
Fix configmap namespacing issues.
Miles-Garnsey Jan 31, 2023
51dc62c
Fix kuttl tests to account for new CM name.
Miles-Garnsey Feb 1, 2023
2b6af11
Start stubbing out methods for agent config.
Miles-Garnsey Jan 17, 2023
a9a6264
CRD upgrades, codegen upgrades.
Miles-Garnsey Jan 20, 2023
9af9e72
Make type names more concise.
Miles-Garnsey Jan 23, 2023
e4d60f4
Changelog.
Miles-Garnsey Jan 27, 2023
a57a5d5
Refactor telemetry types
Miles-Garnsey Feb 1, 2023
ecfb3f5
Fix issues in rebase.
Miles-Garnsey Feb 1, 2023
50c99af
Fix rebase related problems.
Miles-Garnsey Feb 2, 2023
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
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions CHANGELOG/CHANGELOG-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ When cutting a new release, update the `unreleased` heading to the tag being gen

## unreleased
* [FEATURE] [#783](https://github.com/k8ssandra/k8ssandra-operator/issues/783) Allow disabling MCAC
* [FEATURE] [#739815](https://github.com/k8ssandra/k8ssandra-operator/issues/815) Add configuration block to CRDs for new Cassandra metrics agent.
* [FEATURE] [#739](https://github.com/k8ssandra/k8ssandra-operator/issues/739) Add API for cluster-level tasks
* [FEATURE] [#775](https://github.com/k8ssandra/k8ssandra-operator/issues/775) Add the ability to inject and configure a Vector agent sidecar in the Cassandra pods
* [FEATURE] [#600](https://github.com/k8ssandra/k8ssandra-operator/issues/600) Disable secrets management and replication with the external secrets provider
Expand Down
2 changes: 1 addition & 1 deletion apis/k8ssandra/v1alpha1/k8ssandracluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ type DatacenterOptions struct {
// If telemetry configurations are defined, telemetry resources will be deployed to integrate with
// a user-provided monitoring solution (at present, only support for Prometheus is available).
// +optional
Telemetry *telemetryapi.TelemetrySpec `json:"telemetry,omitempty"`
Telemetry *telemetryapi.CassandraTelemetrySpec `json:"telemetry,omitempty"`

// CDC defines the desired state for CDC integrations. It can be used to feed mutation events from Cassandra into an Apache Pulsar cluster,
// from where they can be expored to external systems.
Expand Down
2 changes: 1 addition & 1 deletion apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go

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

7 changes: 6 additions & 1 deletion apis/telemetry/v1alpha1/telemetry_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ func (in *TelemetrySpec) MergeWith(clusterTemplate *TelemetrySpec) *TelemetrySpe
return goalesceutils.MergeCRs(clusterTemplate, in)
}

// MergeWith merges the given cluster-level template into this (DC-level) template.
func (in *CassandraTelemetrySpec) MergeWith(clusterTemplate *CassandraTelemetrySpec) *CassandraTelemetrySpec {
return goalesceutils.MergeCRs(clusterTemplate, in)
}

func (in *TelemetrySpec) IsPrometheusEnabled() bool {
return in != nil && in.Prometheus != nil && in.Prometheus.Enabled != nil && *in.Prometheus.Enabled
}

func (in *TelemetrySpec) IsMcacEnabled() bool {
func (in *CassandraTelemetrySpec) IsMcacEnabled() bool {
return in == nil || in.Mcac == nil || in.Mcac.Enabled == nil || *in.Mcac.Enabled
}

Expand Down
18 changes: 17 additions & 1 deletion apis/telemetry/v1alpha1/telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
package v1alpha1

import (
promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type TelemetrySpec struct {
Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"`
Mcac *McacTelemetrySpec `json:"mcac,omitempty"`
Vector *VectorSpec `json:"vector,omitempty"`
}

type CassandraTelemetrySpec struct {
*TelemetrySpec `json:",inline"`
Mcac *McacTelemetrySpec `json:"mcac,omitempty"`
Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"`
}

type PrometheusTelemetrySpec struct {
// Enable the creation of Prometheus serviceMonitors for this resource (Cassandra or Stargate).
Enabled *bool `json:"enabled,omitempty"`
Expand Down Expand Up @@ -126,3 +132,13 @@ type McacTelemetrySpec struct {
// This is considered true by default.
Enabled *bool `json:"enabled,omitempty"`
}

type CassandraAgentSpec struct {
Endpoint Endpoint `json:"endpoint,omitempty"`
Filters []promapi.RelabelConfig `json:"filters,omitempty"`
}

type Endpoint struct {
Address string `json:"address,omitempty"`
Port string `json:"port,omitempty"`
}
74 changes: 69 additions & 5 deletions apis/telemetry/v1alpha1/zz_generated.deepcopy.go

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

Loading