Skip to content

Commit

Permalink
New telemetry agent config (#813)
Browse files Browse the repository at this point in the history
* Provide a new API within the K8ssandraCluster CRDs to configure the new Cassandra telemetry agent.
* Create a ConfigMap for new Cassandra telemetry agent and mount it to the Cassandra STS.
  • Loading branch information
Miles-Garnsey authored Feb 7, 2023
1 parent 7128c15 commit 6201418
Show file tree
Hide file tree
Showing 58 changed files with 19,075 additions and 5,959 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/version_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
push:
branches:
- main
- 'release/**'
- "release/**"
paths-ignore:
- 'docs/**'
- 'CHANGELOG/**'
- "docs/**"
- "CHANGELOG/**"
pull_request:
branches:
- main
- 'release/**'
- "release/**"
paths-ignore:
- 'docs/**'
- 'CHANGELOG/**'
- "docs/**"
- "CHANGELOG/**"

jobs:
build_image:
Expand Down Expand Up @@ -60,63 +60,63 @@ jobs:
name: Run kuttl tests
strategy:
matrix:
k8s_version:
- "1.21"
- "1.22"
- "1.23"
serverVersion:
- 3.11.12
- 4.0.3
k8s_version:
- "1.21"
- "1.22"
- "1.23"
serverVersion:
- 3.11.14
- 4.0.3
kuttl-test:
- test-cassandra-versions
- test-cassandra-versions
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
if: github.event_name != 'pull_request'
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: Kind kube-proxy issue workaround
run: sudo sysctl net/netfilter/nf_conntrack_max=524288
- name: Download k8ssandra-operator image
uses: actions/download-artifact@v2
with:
name: k8ssandra-operator
path: /tmp
- name: Load Docker images
run: |
docker load --input /tmp/k8ssandra-k8ssandra-operator.tar
- name: Install kustomize
uses: imranismail/setup-kustomize@v2
with:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
if: github.event_name != 'pull_request'
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
- name: Kind kube-proxy issue workaround
run: sudo sysctl net/netfilter/nf_conntrack_max=524288
- name: Download k8ssandra-operator image
uses: actions/download-artifact@v2
with:
name: k8ssandra-operator
path: /tmp
- name: Load Docker images
run: |
docker load --input /tmp/k8ssandra-k8ssandra-operator.tar
- name: Install kustomize
uses: imranismail/setup-kustomize@v2
with:
kustomize-version: 4.x
- name: Log kustomize version
run: kustomize version
- name: Install kuttl
run: |
make install-kuttl
- name: Create kind cluster
run: |
kind create cluster --name k8ssandra-0 --config ./test/kuttl/config/kind/w3k${{ matrix.k8s_version }}.yaml
make cert-manager
make IMG="k8ssandra/k8ssandra-operator:latest" kind-load-image
- name: Run kuttl test
run: |
# We are running tests against k8s 1.21
# Additional versions must be added in kind config files under ./test/config/kind
- name: Log kustomize version
run: kustomize version
- name: Install kuttl
run: |
make install-kuttl
- name: Create kind cluster
run: |
kind create cluster --name k8ssandra-0 --config ./test/kuttl/config/kind/w3k${{ matrix.k8s_version }}.yaml
make cert-manager
make IMG="k8ssandra/k8ssandra-operator:latest" kind-load-image
- name: Run kuttl test
run: |
# We are running tests against k8s 1.21
# Additional versions must be added in kind config files under ./test/config/kind
# Currently we aren't using the kuttl-test Makefile target while trying to iron out the
# release process. The following changes have been made to stay as close as possible
# to the existing behavior with kuttl tests while supporting the ability to use a release
# image tag of the operator.
# Currently we aren't using the kuttl-test Makefile target while trying to iron out the
# release process. The following changes have been made to stay as close as possible
# to the existing behavior with kuttl tests while supporting the ability to use a release
# image tag of the operator.
SERVERVERSION=${{ matrix.serverVersion }} ./bin/kubectl-kuttl test --kind-context=k8ssandra-0 --start-kind=false --test ${{ matrix.kuttl-test }}
- name: Delete kind cluster
run: |
kind delete cluster --name k8ssandra-0
SERVERVERSION=${{ matrix.serverVersion }} ./bin/kubectl-kuttl test --kind-context=k8ssandra-0 --start-kind=false --test ${{ matrix.kuttl-test }}
- name: Delete kind cluster
run: |
kind delete cluster --name k8ssandra-0
2 changes: 1 addition & 1 deletion CHANGELOG/CHANGELOG-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Changelog for the K8ssandra Operator, new PRs should update the `unreleased` sec
When cutting a new release, update the `unreleased` heading to the tag being generated and date, like `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unreleased` entries.

## unreleased

* [FEATURE] [#739815](https://github.com/k8ssandra/k8ssandra-operator/issues/815) Add configuration block to CRDs for new Cassandra metrics agent.
12 changes: 12 additions & 0 deletions apis/telemetry/v1alpha1/telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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"
)
Expand All @@ -11,6 +12,7 @@ type TelemetrySpec struct {
Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"`
Mcac *McacTelemetrySpec `json:"mcac,omitempty"`
Vector *VectorSpec `json:"vector,omitempty"`
Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"`
}

type PrometheusTelemetrySpec struct {
Expand Down Expand Up @@ -126,3 +128,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"`
}
44 changes: 44 additions & 0 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 6201418

Please sign in to comment.