Skip to content

Commit

Permalink
Merge branch 'main' into feature/metrics-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey authored Jan 30, 2023
2 parents ccb4ba6 + 779eced commit 344c69c
Show file tree
Hide file tree
Showing 19 changed files with 1,211 additions and 191 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test_and_build_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install yq
run: |
sudo rm /bin/yq
wget https://github.com/mikefarah/yq/releases/download/v4.28.1/yq_linux_amd64.tar.gz
tar -xzf yq_linux_amd64.tar.gz
sudo mv ./yq_linux_amd64 /usr/bin/yq
- name: Run unit and integration tests
run: |
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG/CHANGELOG-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ When cutting a new release, update the `unreleased` heading to the tag being gen

## unreleased
* [FEATURE] [#739815](https://github.com/k8ssandra/k8ssandra-operator/issues/815) Add configuration block to CRDs for new Cassandra metrics agent.
* [FEATURE] [#783](https://github.com/k8ssandra/k8ssandra-operator/issues/783) Allow disabling MCAC
* [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
* [ENHANCEMENT] [#817](https://github.com/k8ssandra/k8ssandra-operator/issues/817) Allow configuring the Vector agent sidecar in the CRD
* [ENHANCEMENT] [#796](https://github.com/k8ssandra/k8ssandra-operator/issues/796) Enable smart token allocation by default for DSE
* [ENHANCEMENT] [#765](https://github.com/k8ssandra/k8ssandra-operator/issues/765) Add GitHub workflow to test various k8s versions
* [ENHANCEMENT] [#323](https://github.com/k8ssandra/k8ssandra/issues/323) Use Cassandra internals for JMX authentication
* [ENHANCEMENT] [#770](https://github.com/k8ssandra/k8ssandra-operator/issues/770) Update to Go 1.19 and Operator SDK 1.25.2
* [ENHANCEMENT] [#525](https://github.com/k8ssandra/k8ssandra-operator/issues/525) Deep-merge cluster- and dc-level templates
* [ENHANCEMENT] [#781](https://github.com/k8ssandra/k8ssandra-operator/issues/781) Expose perNodeConfigInitContainer.Image through CRD
* [ENHANCEMENT] [#783](https://github.com/k8ssandra/k8ssandra-operator/issues/783) Make ServiceAccount of Cassandra pods configurable
* [BUGFIX] [#726](https://github.com/k8ssandra/k8ssandra-operator/issues/726) Don't propagate Cassandra tolerations to the Stargate deployment
* [BUGFIX] [#778](https://github.com/k8ssandra/k8ssandra-operator/issues/778) Fix Stargate deployments on k8s clusters using a custom domain name
* [TESTING] [#761](https://github.com/k8ssandra/k8ssandra-operator/issues/761) Stabilize integration and e2e tests
Expand Down
3 changes: 3 additions & 0 deletions apis/k8ssandra/v1alpha1/k8ssandracluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ type DatacenterOptions struct {
// +optional
// +kubebuilder:default="mikefarah/yq:4"
PerNodeConfigInitContainerImage string `json:"perNodeConfigInitContainerImage,omitempty"`

// The k8s service account to use for the Cassandra pods
ServiceAccount string `json:"serviceAccount,omitempty"`
}

// NetworkingConfig is a copy of cass-operator's NetworkingConfig struct. It is copied here to
Expand Down
4 changes: 4 additions & 0 deletions apis/telemetry/v1alpha1/telemetry_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ func (in *TelemetrySpec) IsPrometheusEnabled() bool {
return in != nil && in.Prometheus != nil && in.Prometheus.Enabled != nil && *in.Prometheus.Enabled
}

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

func (in *TelemetrySpec) IsVectorEnabled() bool {
return in != nil && in.Vector != nil && in.Vector.Enabled != nil && *in.Vector.Enabled
}
71 changes: 64 additions & 7 deletions apis/telemetry/v1alpha1/telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ type VectorSpec struct {
// Enabling the vector agent will inject a sidecar container into the pod.
Enabled *bool `json:"enabled,omitempty"`

// Config is the name of the configmap containing custom sinks and transformers for the Vector agent.
// The configmap must be in the same namespace as the CassandraDatacenter and contain a vector.toml entry
// with the Vector configuration in toml format.
// The agent is already configured with a "cassandra_metrics" source that needs to be used as input for the sinks.
// If not set, the default console sink will be used.
Config *corev1.LocalObjectReference `json:"config,omitempty"`

// Resources is the resource requirements for the Vector agent.
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

Expand All @@ -48,6 +41,66 @@ type VectorSpec struct {
// +optional
// kube:default=30s
ScrapeInterval *metav1.Duration `json:"scrapeInterval,omitempty"`

Components *VectorComponentsSpec `json:"components,omitempty"`
}

type VectorComponentsSpec struct {
// Sources is the list of sources to use for the Vector agent.
// +optional
Sources []VectorSourceSpec `json:"sources,omitempty"`

// Sinks is the list of sinks to use for the Vector agent.
// +optional
Sinks []VectorSinkSpec `json:"sinks,omitempty"`

// Transforms is the list of transforms to use for the Vector agent.
// +optional
Transforms []VectorTransformSpec `json:"transforms,omitempty"`
}

type VectorSourceSpec struct {
// Name is the name of the source.
Name string `json:"name"`

// Type is the type of the source.
Type string `json:"type"`

// Config is the configuration for the source.
// +optional
Config string `json:"config,omitempty"`
}

type VectorSinkSpec struct {
// Name is the name of the sink.
Name string `json:"name"`

// Type is the type of the sink.
Type string `json:"type"`

// Inputs is the list of inputs for the transform.
// +optional
Inputs []string `json:"inputs,omitempty"`

// Config is the configuration for the sink.
// +optional
Config string `json:"config,omitempty"`
}

type VectorTransformSpec struct {
// Name is the name of the transform.
Name string `json:"name"`

// Type is the type of the transform.
Type string `json:"type"`

// Inputs is the list of inputs for the transform.
// +optional
Inputs []string `json:"inputs,omitempty"`

// Config is the configuration for the transform.
// +optional
Config string `json:"config,omitempty"`
}

type McacTelemetrySpec struct {
Expand All @@ -70,6 +123,10 @@ type McacTelemetrySpec struct {
// Setting it to an empty list will result in all metrics being extracted.
// +optional
MetricFilters *[]string `json:"metricFilters,omitempty"`

// enabled sets whether MCAC (legacy metrics endpoint) is enabled.
// This is considered true by default.
Enabled *bool `json:"enabled,omitempty"`
}

type CassandraAgentSpec struct {
Expand Down
104 changes: 99 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

0 comments on commit 344c69c

Please sign in to comment.