injector

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SidecarTypeFilebeat                  = "filebeat"
	SidecarTypeVector                    = "vector"
	SidecarContainerDefaultFilebeatImage = "elastic/filebeat:6.7.0"
	SidecarContainerDefaultVectorImage   = "timberio/vector:0.34.1-distroless-static"
	SidecarInitContainerDefaultImage     = "alpine:3.9"
)

Variables

This section is empty.

Functions

func JoinLines

func JoinLines(lines string, addLinePrefix, addLineSuffix string) string

func PatchYaml

func PatchYaml(yamlString, patchJsonString string) (string, error)

func ReloadInjectorConfig

func ReloadInjectorConfig(c *Config) error

func ServeLogSidecarPods

func ServeLogSidecarPods(w http.ResponseWriter, r *http.Request)

Types

type Config

type Config struct {
	CertFile string
	KeyFile  string

	SidecarType string

	FilebeatConfigFile string
	SidecarConfigFile  string
	VectorConfigFile   string
}

func (*Config) AddFlags

func (c *Config) AddFlags()

func (*Config) InjectorConfig

func (c *Config) InjectorConfig() (*InjectorConfig, error)

func (*Config) TLSConfig

func (c *Config) TLSConfig(stop <-chan struct{}, reloadCh <-chan chan error) (*tls.Config, error)

type ContainerConfig

type ContainerConfig struct {
	Image           string                  `json:"image,omitempty" yaml:"image,omitempty"`
	ImagePullPolicy v1.PullPolicy           `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"`
	Resources       v1.ResourceRequirements `json:"resources" yaml:"resources"`
}

type ContainerLogConfig

type ContainerLogConfig struct {
	ContainerName string
	VolumeName    string
	LogPath       string
}

type ContainerLogConfigs

type ContainerLogConfigs map[string]VolumeLogConfig // key: containerName; value: VolumeLogConfig

type InjectorConfig

type InjectorConfig struct {
	SidecarType            string
	SidecarConfig          SidecarConfig
	FilebeatConfigTemplate *template.Template
	VectorConfigTemplate   *template.Template
}

func GetInjectorConfig

func GetInjectorConfig() *InjectorConfig

type LogsidecarConfig

type LogsidecarConfig struct {
	ContainerLogConfigs ContainerLogConfigs `json:"containerLogConfigs,omitempty"`
}

type SidecarConfig

type SidecarConfig struct {
	InitContainer     ContainerConfig `json:"initContainer" yaml:"initContainer"`
	FilebeatContainer ContainerConfig `json:"filebeatContainer,omitempty" yaml:"filebeatContainer,omitempty"`
	VectorContainer   ContainerConfig `json:"vectorContainer,omitempty" yaml:"vectorContainer,omitempty"`
}

type VolumeLogConfig

type VolumeLogConfig map[string][]string // key: volumeName; value: logRelativePaths

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL