kubedog

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TrackTerminationModeAnnoName annotation allows to specify how to track resource.
	TrackTerminationModeAnnoName = helper.RootAnnoName + "track-termination-mode"

	// FailModeAnnoName annotation specifies what to do after resource fails.
	FailModeAnnoName = helper.RootAnnoName + "fail-mode"

	// FailuresAllowedPerReplicaAnnoName specifies how many times resource is allowed to fail.
	FailuresAllowedPerReplicaAnnoName = helper.RootAnnoName + "failures-allowed-per-replica"

	// LogRegexAnnoName allows to set regexp for log lines.
	LogRegexAnnoName = helper.RootAnnoName + "log-regex"

	// LogRegexForAnnoPrefix allows to set regexp for individual containers.
	LogRegexForAnnoPrefix = helper.RootAnnoName + "log-regex-for-"

	// SkipLogsAnnoName allows to skip log streaming.
	SkipLogsAnnoName = helper.RootAnnoName + "skip-logs"

	// SkipLogsForContainersAnnoName allows to skip log streaming for individual containers.
	SkipLogsForContainersAnnoName = helper.RootAnnoName + "skip-logs-for-containers"

	// ShowLogsOnlyForContainersAnnoName allows to show logs only for specified containers.
	ShowLogsOnlyForContainersAnnoName = helper.RootAnnoName + "show-logs-only-for-containers"

	// ShowLogsUntilAnnoName is unused.
	ShowLogsUntilAnnoName = helper.RootAnnoName + "show-logs-until"

	// ShowEventsAnnoName enables streaming resource events.
	ShowEventsAnnoName = helper.RootAnnoName + "show-service-messages"

	// ReplicasOnCreationAnnoName is unused.
	ReplicasOnCreationAnnoName = helper.RootAnnoName + "replicas-on-creation"
)

Variables

This section is empty.

Functions

func FixLog added in v0.27.1

func FixLog(width int) error

FixLog will disable kubernetes logger and fix width for logboek.

func MakeSpecs

func MakeSpecs(m []Resource, ns string) (*multitrack.MultitrackSpecs, error)

MakeSpecs creates *multitrack.MultitrackSpecs for Resource slice in provided namespace.

func SilenceKlog added in v0.20.0

func SilenceKlog(ctx context.Context) error

SilenceKlog discards all klog logs except FATAL.

func SilenceKlogV2 added in v0.20.0

func SilenceKlogV2(ctx context.Context) error

SilenceKlogV2 discards all klog/v2 logs except FATAL.

Types

type Config

type Config struct {
	StatusInterval time.Duration
	Timeout        time.Duration
	StartDelay     time.Duration
}

Config is config for kubedog library.

type Resource

type Resource struct {
	Spec             `yaml:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
	meta1.TypeMeta   `yaml:",inline"`
	meta1.ObjectMeta `yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}

Resource is base structure for all k8s resources that have replicas. Used to parse out replicas count.

func Parse added in v0.12.0

func Parse(yamlFile []byte) []Resource

Parse parses YAML manifests of kubernetes resources and returns Resource slice.

func (*Resource) MakeMultiTrackSpec

func (r *Resource) MakeMultiTrackSpec(ns string) (*multitrack.MultitrackSpec, error)

MakeMultiTrackSpec creates *multitrack.MultitrackSpec for current resource.

type Spec

type Spec struct {
	Replicas *uint32 `yaml:"replicas,omitempty" json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}

Spec is spec structure with replicas. Only replicas count is used.

Jump to

Keyboard shortcuts

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