-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add TC migration option (#1876)
Signed-off-by: Bence Csati <[email protected]> Signed-off-by: Peter Wilcsinszky <[email protected]> Co-authored-by: Peter Wilcsinszky <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,171 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies: | ||
- name: logging-operator-crds | ||
repository: "" | ||
version: 0.0.0 | ||
- name: telemetry-controller | ||
repository: oci://ghcr.io/kube-logging/helm-charts | ||
version: 0.0.15 | ||
digest: sha256:8ff43abc414a65d3069a1c6b697826e639134c1791bb84b1fbde054ff7de450c | ||
generated: "2024-12-16T17:13:49.863948+01:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# TC-routing | ||
|
||
## Setup | ||
|
||
In this setup customer-a sends logs over the traditional path (fluentbit -> fluentd) while | ||
customer-b sends over the telemetry-controller path (opentelemetry collector -> fluentd). | ||
|
||
In both cases, flows and outputs should work and behave the same. | ||
|
||
```shell | ||
make kind-cluster | ||
make docker-build | ||
kind load docker-image controller:local | ||
|
||
helm dependency update charts/logging-operator | ||
helm upgrade --install \ | ||
--wait \ | ||
--create-namespace \ | ||
--namespace logging \ | ||
logging-operator ./charts/logging-operator/ \ | ||
--set image.repository=controller \ | ||
--set image.tag=local \ | ||
--set extraArgs='{"-enable-leader-election=true","-enable-telemetry-controller-route"}' \ | ||
--set telemetry-controller.install=true \ | ||
--set testReceiver.enabled=true | ||
|
||
kubectl apply -f config/samples/telemetry-controller-routing/ | ||
|
||
helm upgrade --install --namespace customer-a log-generator oci://ghcr.io/kube-logging/helm-charts/log-generator | ||
helm upgrade --install --namespace customer-b log-generator oci://ghcr.io/kube-logging/helm-charts/log-generator | ||
helm upgrade --install --namespace infra log-generator oci://ghcr.io/kube-logging/helm-charts/log-generator | ||
``` | ||
|
||
## Switching between logging-routes or TC routing | ||
|
||
To use only logging-routes (This is the default behaviour!): | ||
|
||
- Don't set anything. | ||
|
||
```yaml | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Logging | ||
spec: | ||
routeConfig: | ||
enableTelemetryControllerRoute: false | ||
disableLoggingRoute: false | ||
``` | ||
To use logging-routes and TC routing in parallel: | ||
```yaml | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Logging | ||
spec: | ||
routeConfig: | ||
enableTelemetryControllerRoute: true | ||
disableLoggingRoute: false | ||
``` | ||
To use only TC routing: | ||
```yaml | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Logging | ||
spec: | ||
routeConfig: | ||
enableTelemetryControllerRoute: true | ||
disableLoggingRoute: true | ||
``` | ||
NOTE: You can change these setting on the fly, the only requirement is to have the necessary components deployed. |
59 changes: 59 additions & 0 deletions
59
config/samples/telemetry-controller-routing/tc-tenant-a-logging.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: customer-a | ||
labels: | ||
tenant: customer-a | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: customer-a-infra | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Logging | ||
metadata: | ||
name: customer-a | ||
labels: | ||
tenant: customer-a | ||
spec: | ||
fluentd: | ||
disablePvc: true | ||
logLevel: trace | ||
controlNamespace: customer-a-infra | ||
watchNamespaceSelector: | ||
matchLabels: | ||
tenant: customer-a | ||
routeConfig: | ||
enableTelemetryControllerRoute: false | ||
disableLoggingRoute: false | ||
tenantLabels: | ||
tenant: customer-a | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Flow | ||
metadata: | ||
name: all | ||
namespace: customer-a | ||
spec: | ||
match: | ||
- select: | ||
labels: | ||
app.kubernetes.io/name: log-generator | ||
localOutputRefs: | ||
- http-a | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: Output | ||
metadata: | ||
name: http-a | ||
namespace: customer-a | ||
spec: | ||
http: | ||
endpoint: http://logging-operator-test-receiver.logging:8080/customer-a | ||
content_type: application/json | ||
buffer: | ||
type: memory | ||
tags: time | ||
timekey: 1s | ||
timekey_wait: 0s |
Oops, something went wrong.