Skip to content

Commit

Permalink
Add cluster_name field
Browse files Browse the repository at this point in the history
Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent committed Oct 22, 2024
1 parent 001d8a7 commit 90e393d
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 79 deletions.
1 change: 1 addition & 0 deletions api/v1/README.md

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

63 changes: 37 additions & 26 deletions api/v1/tetragon/events.pb.go

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

2 changes: 2 additions & 0 deletions api/v1/tetragon/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,6 @@ message GetEventsResponse {
// aggregation_info contains information about aggregation results. This field
// is set only for aggregated responses.
AggregationInfo aggregation_info = 1002;
// Name of the cluster where this event was observed.
string cluster_name = 1003;
}

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

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

1 change: 1 addition & 0 deletions docs/content/en/docs/reference/grpc-api.md

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

1 change: 1 addition & 0 deletions docs/content/en/docs/reference/helm-chart.md

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

1 change: 1 addition & 0 deletions install/kubernetes/tetragon/README.md

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

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
{{- include "tetragon.labels" . | nindent 4 }}
data:
cluster-name: {{ .Values.tetragon.clusterName | quote }}
{{- if .Values.tetragon.btf }}
btf: {{ .Values.tetragon.btf }}
{{- end }}
Expand Down Expand Up @@ -75,4 +76,4 @@ data:
{{- if .Values.tetragon.enableKeepSensorsOnExit }}
keep-sensors-on-exit: "true"
release-pinned-bpf: "false"
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions install/kubernetes/tetragon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ tetragon:
# With both of the above redaction filters in place, we are now redacting all
# password arguments.
redactionFilters: ""
# -- Name of the cluster where Tetragon is installed. Tetragon uses this value
# to set the cluster_name field in GetEventsResponse messages.
clusterName: ""
# -- Access Kubernetes API to associate Tetragon events with Kubernetes pods.
enableK8sAPI: true
# -- Enable Capabilities visibility in exec and kprobe events.
Expand Down
1 change: 1 addition & 0 deletions pkg/option/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type config struct {
Verbosity int
ForceSmallProgs bool
ForceLargeProgs bool
ClusterName string

EnableProcessNs bool
EnableProcessCred bool
Expand Down
3 changes: 3 additions & 0 deletions pkg/option/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
KeyDataCacheSize = "data-cache-size"
KeyForceSmallProgs = "force-small-progs"
KeyForceLargeProgs = "force-large-progs"
KeyClusterName = "cluster-name"

KeyLogLevel = "log-level"
KeyLogFormat = "log-format"
Expand Down Expand Up @@ -143,6 +144,7 @@ func ReadAndSetFlags() error {
Config.ForceSmallProgs = viper.GetBool(KeyForceSmallProgs)
Config.ForceLargeProgs = viper.GetBool(KeyForceLargeProgs)
Config.Debug = viper.GetBool(KeyDebug)
Config.ClusterName = viper.GetString(KeyClusterName)

Config.EnableProcessCred = viper.GetBool(KeyEnableProcessCred)
Config.EnableProcessNs = viper.GetBool(KeyEnableProcessNs)
Expand Down Expand Up @@ -301,6 +303,7 @@ func AddFlags(flags *pflag.FlagSet) {
flags.BoolP(KeyDebug, "d", false, "Enable debug messages. Equivalent to '--log-level=debug'")
flags.String(KeyHubbleLib, defaults.DefaultTetragonLib, "Location of Tetragon libs (btf and bpf files)")
flags.String(KeyBTF, "", "Location of btf")
flags.String(KeyClusterName, "", "Name of the cluster where Tetragon is installed")

flags.String(KeyProcFS, "/proc/", "Location of procfs to consume existing PIDs")
flags.String(KeyKernelVersion, "", "Kernel version")
Expand Down
Loading

0 comments on commit 90e393d

Please sign in to comment.