Documentation ¶
Index ¶
Constants ¶
View Source
const ( RUNNING = "running" WAITING = "waiting" TERMINATED = "terminated" )
Variables ¶
This section is empty.
Functions ¶
func Watch ¶
func Watch(ctx context.Context, i v1.PodInterface, podFilter *regexp.Regexp, containerFilter *regexp.Regexp, containerExcludeFilter *regexp.Regexp, containerState ContainerState, labelSelector labels.Selector) (chan *Target, chan *Target, error)
Watch starts listening to Kubernetes events and emits modified containers/pods. The first result is targets added, the second is targets removed
Types ¶
type Config ¶
type Config struct { KubeConfig string ContextName string Namespace string PodQuery *regexp.Regexp Timestamps bool ContainerQuery *regexp.Regexp ExcludeContainerQuery *regexp.Regexp ContainerState ContainerState Exclude []*regexp.Regexp Include []*regexp.Regexp Since time.Duration AllNamespaces bool LabelSelector labels.Selector TailLines *int64 Template *template.Template }
Config contains the config for stern
type ContainerState ¶
type ContainerState string
func NewContainerState ¶
func NewContainerState(stateConfig string) (ContainerState, error)
func (ContainerState) Match ¶
func (stateConfig ContainerState) Match(containerState v1.ContainerState) bool
type Log ¶
type Log struct { // Message is the log message itself Message string `json:"message"` // Namespace of the pod Namespace string `json:"namespace"` // PodName of the pod PodName string `json:"podName"` // ContainerName of the container ContainerName string `json:"containerName"` PodColor *color.Color `json:"-"` ContainerColor *color.Color `json:"-"` }
Log is the object which will be used together with the template to generate the output.
type Tail ¶
type Tail struct { Namespace string PodName string ContainerName string Options *TailOptions // contains filtered or unexported fields }
func NewTail ¶
func NewTail(namespace, podName, containerName string, tmpl *template.Template, options *TailOptions) *Tail
NewTail returns a new tail for a Kubernetes container inside a pod
type TailOptions ¶
Click to show internal directories.
Click to hide internal directories.