Documentation ¶
Index ¶
- Constants
- func PrintBanner(cfg *LogConfig)
- func PrintInfo(log logr.Logger, version string)
- func ServeRoot(mgr manager.Manager, cfg AppConfig) error
- func SetupLog(cfg *LogConfig)
- func SetupTracing(cfg Config, ctx context.Context, log logr.Logger) func()
- type AppConfig
- type Config
- type ControllerConfig
- type LogConfig
- type TracingConfig
Constants ¶
View Source
const ( // CreatedByAnnotationKey https://kubernetes.io/docs/reference/labels-annotations-taints/#app-kubernetes-io-created-by CreatedByAnnotationKey = "app.kubernetes.io/created-by" // CreatedByAnnotationValue https://kubernetes.io/docs/reference/labels-annotations-taints/#app-kubernetes-io-created-by CreatedByAnnotationValue = "log2rbac" )
Various constants used across the log2rbac
Variables ¶
This section is empty.
Functions ¶
func PrintBanner ¶
func PrintBanner(cfg *LogConfig)
PrintBanner prints the ascii banner for log2rbac app in logs the fatih/color module should be smart enough to recognize the attached stdout's file descriptor if it's capable of colors, but we can explicitly control this by cfg.Colors bool
func PrintInfo ¶ added in v0.0.2
PrintInfo prints the versions of golang and the git-sha to the logs
Types ¶
type Config ¶
type Config struct { Log *LogConfig Controller *ControllerConfig Tracing *TracingConfig App *AppConfig }
Config is top-lvl entrypoint to the configuration of log2rbac operator
type ControllerConfig ¶
type ControllerConfig struct { // sync intervals SyncIntervalAfterNoRbacEntryMinutes int `env:"SYNC_INTERVAL_AFTER_NO_RBAC_ENTRY_MINUTES,default=5"` SyncIntervalAfterNoLogsSeconds int `env:"SYNC_INTERVAL_AFTER_NO_LOGS_SECONDS,default=30"` SyncIntervalAfterPodRestartSeconds int `env:"SYNC_INTERVAL_AFTER_POD_RESTART_SECONDS,default=20"` SyncIntervalAfterErrorMinutes int `env:"SYNC_INTERVAL_AFTER_ERROR,default=3"` IgnoreSameEventsWithinSeconds float64 `env:"IGNORE_SAME_EVENTS_WITHIN_SECONDS,default=1.0"` ShouldRestartAppPods bool `env:"SHOULD_RESTART_APP_PODS,default=true"` }
ControllerConfig contains internal parameters for the controller like sync intervals
type LogConfig ¶
type LogConfig struct { Colors bool `env:"COLORS,default=true"` NoBanner bool `env:"NO_BANNER,default=false"` }
LogConfig contains log related configuration
type TracingConfig ¶ added in v0.0.4
type TracingConfig struct { Enabled bool `env:"TRACING_ENABLED,default=false"` Endpoint string `env:"OTEL_EXPORTER_OTLP_ENDPOINT,default=localhost:4318"` SamplingRatio string `env:"TRACING_SAMPLING_RATIO"` }
TracingConfig contains options related to distributed tracing and opentelemetry
Click to show internal directories.
Click to hide internal directories.