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

Option to exclude worker from Dynatrace monitoring #1482

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
1 change: 1 addition & 0 deletions cmd/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ func init() {
tapCmd.Flags().Bool(configStructs.IgnoreTaintedLabel, defaultTapConfig.IgnoreTainted, "Ignore tainted pods while running Worker DaemonSet")
tapCmd.Flags().Bool(configStructs.IngressEnabledLabel, defaultTapConfig.Ingress.Enabled, "Enable Ingress")
tapCmd.Flags().Bool(configStructs.TelemetryEnabledLabel, defaultTapConfig.Telemetry.Enabled, "Enable/disable Telemetry")
tapCmd.Flags().Bool(configStructs.DynatraceExcludeWorkerLabel, defaultTapConfig.DynatraceExcludeWorker, "Exclude worker from Dynatrace monitoring")
}
2 changes: 2 additions & 0 deletions config/configStructs/tapConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
IngressEnabledLabel = "ingress-enabled"
TelemetryEnabledLabel = "telemetry-enabled"
DebugLabel = "debug"
DynatraceExcludeWorkerLabel = "dynatrace-exclude-worker"
ContainerPort = 80
ContainerPortStr = "80"
)
Expand Down Expand Up @@ -156,6 +157,7 @@ type TapConfig struct {
Metrics MetricsConfig `yaml:"metrics" json:"metrics"`
TrafficSampleRate int `yaml:"trafficSampleRate" json:"trafficSampleRate" default:"100"`
TcpStreamChannelTimeoutMs int `yaml:"tcpStreamChannelTimeoutMs" json:"tcpStreamChannelTimeoutMs" default:"10000"`
DynatraceExcludeWorker bool `yaml:"dynatraceExcludeWorker" json:"dynatraceExcludeWorker" default:"false"`
}

func (config *TapConfig) PodRegex() *regexp.Regexp {
Expand Down
1 change: 1 addition & 0 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Please refer to [metrics](./metrics.md) documentation for details.
| `tap.tls` | Capture the encrypted/TLS traffic from cryptography libraries like OpenSSL | `true` |
| `tap.ignoreTainted` | Whether to ignore tainted nodes | `false` |
| `tap.labels` | Kubernetes labels to apply to all Kubeshark resources | `{}` |
| `tap.dynatraceExcludeWorker` | Exclude worker from Dynatrace monitoring | `false` |
| `tap.annotations` | Kubernetes annotations to apply to all Kubeshark resources | `{}` |
| `tap.nodeSelectorTerms` | Node selector terms | `[{"matchExpressions":[{"key":"kubernetes.io/os","operator":"In","values":["linux"]}]}]` |
| `tap.auth.enabled` | Enable authentication | `false` |
Expand Down
3 changes: 3 additions & 0 deletions helm-chart/templates/09-worker-daemon-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
sidecar.istio.io/inject: "false"
{{- include "kubeshark.labels" . | nindent 4 }}
annotations:
{{- if .Values.tap.dynatraceExcludeWorker }}
oneagent.dynatrace.com/inject: "false"
{{- end }}
{{- if .Values.tap.annotations }}
{{- toYaml .Values.tap.annotations | nindent 4 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ tap:
tls: true
ignoreTainted: false
labels: {}
dynatraceExcludeWorker: false
annotations: {}
nodeSelectorTerms:
- matchExpressions:
Expand Down
Loading