controller

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventPod            = "pod"
	EventLogConf        = "logConfig"
	EventNode           = "node"
	EventClusterLogConf = "clusterLogConfig"
	EventSink           = "sink"
	EventInterceptor    = "interceptor"
)
View Source
const (
	ReasonFailed  = "syncFailed"
	ReasonSuccess = "syncSuccess"

	MessageSyncSuccess = "Sync type %s %v success"
	MessageSyncFailed  = "Sync type %s %v failed: %s"
)
View Source
const (
	GenerateConfigName           = "kube-loggie.yml"
	GenerateTypeLoggieConfigName = "loggie-config.yml"
	GenerateTypeNodeConfigName   = "node-config.yml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Cluster        string `yaml:"cluster" default:""`
	Kubeconfig     string `yaml:"kubeconfig"`
	Master         string `yaml:"master"`
	NodeName       string `yaml:"-"`
	ConfigFilePath string `yaml:"-"`

	ContainerRuntime        string   `yaml:"containerRuntime"`
	RuntimeEndpoints        []string `` /* 147-byte string literal not displayed */
	RootFsCollectionEnabled bool     `yaml:"rootFsCollectionEnabled"`
	PodLogDirPrefix         string   `yaml:"podLogDirPrefix" default:"/var/log/pods"`
	KubeletRootDir          string   `yaml:"kubeletRootDir" default:"/var/lib/kubelet"`

	Fields      Fields            `yaml:"fields"` // Deprecated: use k8sFields instead
	K8sFields   map[string]string `yaml:"k8sFields"`
	ParseStdout bool              `yaml:"parseStdout"`
}

func (*Config) Validate added in v1.2.0

func (c *Config) Validate() error

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	config *Config,
	kubeClientset kubernetes.Interface,
	logConfigClientset logconfigClientset.Interface,
	podInformer corev1Informers.PodInformer,
	logConfigInformer logconfigInformers.LogConfigInformer,
	clusterLogConfigInformer logconfigInformers.ClusterLogConfigInformer,
	sinkInformer logconfigInformers.SinkInformer,
	interceptorInformer logconfigInformers.InterceptorInformer,
	nodeInformer corev1Informers.NodeInformer,
	runtime runtime.Runtime,
) *Controller

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{}) error

type Element

type Element struct {
	Type         string `json:"type"` // resource type, eg: pod
	Key          string `json:"key"`  // MetaNamespaceKey, format: <namespace>/<name>
	SelectorType string `json:"selectorType"`
}

Element the item add to queue

type Fields

type Fields struct {
	NodeName      string `yaml:"node.name"`
	NodeIP        string `yaml:"node.ip"`
	Namespace     string `yaml:"namespace"`
	PodName       string `yaml:"pod.name"`
	PodIP         string `yaml:"pod.ip"`
	ContainerName string `yaml:"container.name"`
	LogConfig     string `yaml:"logConfig"`
}

Jump to

Keyboard shortcuts

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