v1

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. source: shim.proto

Index

Constants

View Source
const (
	ConfigDir                        = "etc"
	ConfigFileName                   = "shim.json"
	NodeLabel                        = "zeropod.ctrox.dev/node"
	PortsAnnotationKey               = "zeropod.ctrox.dev/ports-map"
	ContainerNamesAnnotationKey      = "zeropod.ctrox.dev/container-names"
	ScaleDownDurationAnnotationKey   = "zeropod.ctrox.dev/scaledown-duration"
	DisableCheckpoiningAnnotationKey = "zeropod.ctrox.dev/disable-checkpointing"
	PreDumpAnnotationKey             = "zeropod.ctrox.dev/pre-dump"
	MigrateAnnotationKey             = "zeropod.ctrox.dev/migrate"
	LiveMigrateAnnotationKey         = "zeropod.ctrox.dev/live-migrate"
	DisableProbeDetectAnnotationKey  = "zeropod.ctrox.dev/disable-probe-detection"
	ProbeBufferSizeAnnotationKey     = "zeropod.ctrox.dev/probe-buffer-size"
	ProxyTimeoutAnnotationKey        = "zeropod.ctrox.dev/proxy-timeout"
	ConnectTimeoutAnnotationKey      = "zeropod.ctrox.dev/connect-timeout"
	DisableMigrateDataAnnotationKey  = "zeropod.ctrox.dev/disable-migrate-data"
	CRIContainerNameAnnotation       = "io.kubernetes.cri.container-name"
	CRIContainerTypeAnnotation       = "io.kubernetes.cri.container-type"
	CRIPodNameAnnotation             = "io.kubernetes.cri.sandbox-name"
	CRIPodNamespaceAnnotation        = "io.kubernetes.cri.sandbox-namespace"
	CRIPodUIDAnnotation              = "io.kubernetes.cri.sandbox-uid"

	// DefaultProbeBufferSize should be able to fit kube-probe HTTP requests with
	// reasonable path and header sizes but should still be small enough to not
	// impact performance.
	DefaultProbeBufferSize        = 1024
	DefaultProbeBinaryName        = "kubelet"
	DefaultTrackerIgnoreLocalhost = true
)
View Source
const ShimSocketPath = "/run/zeropod/s/"

Variables

View Source
var (
	ContainerPhase_name = map[int32]string{
		0: "SCALED_DOWN",
		1: "RUNNING",
		2: "STOPPING",
		3: "CHECKPOINT_FAILED",
		4: "RESTORE_FAILED",
	}
	ContainerPhase_value = map[string]int32{
		"SCALED_DOWN":       0,
		"RUNNING":           1,
		"STOPPING":          2,
		"CHECKPOINT_FAILED": 3,
		"RESTORE_FAILED":    4,
	}
)

Enum value maps for ContainerPhase.

Functions

func RegisterShimService

func RegisterShimService(srv *ttrpc.Server, svc ShimService)

func WriteAddress added in v0.6.0

func WriteAddress(path, address string) error

WriteAddress writes a address file atomically

Types

type AnnotationConfig added in v0.12.0

type AnnotationConfig struct {
	ZeropodContainerNames []string
	Ports                 []uint16
	ScaleDownDuration     time.Duration
	DisableCheckpointing  bool
	PreDump               bool
	Migrate               []string
	LiveMigrate           string
	ContainerName         string
	ContainerType         string
	PodName               string
	PodNamespace          string
	PodUID                string
	ContainerdNamespace   string
	DisableProbeDetection bool
	ProbeBufferSize       int
	ProxyTimeout          time.Duration
	ConnectTimeout        time.Duration
	DisableMigrateData    bool
	Spec                  *specs.Spec
}

type Config added in v0.12.0

type Config struct {
	ProbeBinaryName        string `json:"probeBinaryName"`
	TrackerIgnoreLocalhost bool   `json:"trackerIgnoreLocalhost"`
	AnnotationConfig       `json:"-"`
}

func NewConfig added in v0.12.0

func NewConfig(ctx context.Context, spec *specs.Spec) (*Config, error)

NewConfig uses the annotations from the container spec to create a new typed ZeropodConfig config.

func (Config) AnyMigrationEnabled added in v0.12.0

func (cfg Config) AnyMigrationEnabled() bool

func (Config) IsZeropodContainer added in v0.12.0

func (cfg Config) IsZeropodContainer() bool

func (Config) LiveMigrationEnabled added in v0.12.0

func (cfg Config) LiveMigrationEnabled() bool

type ContainerMetrics added in v0.6.0

type ContainerMetrics struct {
	Name                   string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	PodName                string                 `protobuf:"bytes,2,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"`
	PodNamespace           string                 `protobuf:"bytes,3,opt,name=pod_namespace,json=podNamespace,proto3" json:"pod_namespace,omitempty"`
	LastCheckpoint         *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=lastCheckpoint,proto3" json:"lastCheckpoint,omitempty"`
	LastRestore            *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=lastRestore,proto3" json:"lastRestore,omitempty"`
	LastCheckpointDuration *durationpb.Duration   `protobuf:"bytes,6,opt,name=lastCheckpointDuration,proto3" json:"lastCheckpointDuration,omitempty"`
	LastRestoreDuration    *durationpb.Duration   `protobuf:"bytes,7,opt,name=lastRestoreDuration,proto3" json:"lastRestoreDuration,omitempty"`
	Running                bool                   `protobuf:"varint,8,opt,name=running,proto3" json:"running,omitempty"`
	CheckpointErrors       int64                  `protobuf:"varint,9,opt,name=checkpoint_errors,json=checkpointErrors,proto3" json:"checkpoint_errors,omitempty"`
	RestoreErrors          int64                  `protobuf:"varint,10,opt,name=restore_errors,json=restoreErrors,proto3" json:"restore_errors,omitempty"`
	// contains filtered or unexported fields
}

func (*ContainerMetrics) Descriptor deprecated added in v0.6.0

func (*ContainerMetrics) Descriptor() ([]byte, []int)

Deprecated: Use ContainerMetrics.ProtoReflect.Descriptor instead.

func (*ContainerMetrics) GetCheckpointErrors added in v0.11.0

func (x *ContainerMetrics) GetCheckpointErrors() int64

func (*ContainerMetrics) GetLastCheckpoint added in v0.6.0

func (x *ContainerMetrics) GetLastCheckpoint() *timestamppb.Timestamp

func (*ContainerMetrics) GetLastCheckpointDuration added in v0.6.0

func (x *ContainerMetrics) GetLastCheckpointDuration() *durationpb.Duration

func (*ContainerMetrics) GetLastRestore added in v0.6.0

func (x *ContainerMetrics) GetLastRestore() *timestamppb.Timestamp

func (*ContainerMetrics) GetLastRestoreDuration added in v0.6.0

func (x *ContainerMetrics) GetLastRestoreDuration() *durationpb.Duration

func (*ContainerMetrics) GetName added in v0.6.0

func (x *ContainerMetrics) GetName() string

func (*ContainerMetrics) GetPodName added in v0.6.0

func (x *ContainerMetrics) GetPodName() string

func (*ContainerMetrics) GetPodNamespace added in v0.6.0

func (x *ContainerMetrics) GetPodNamespace() string

func (*ContainerMetrics) GetRestoreErrors added in v0.11.0

func (x *ContainerMetrics) GetRestoreErrors() int64

func (*ContainerMetrics) GetRunning added in v0.6.0

func (x *ContainerMetrics) GetRunning() bool

func (*ContainerMetrics) ProtoMessage added in v0.6.0

func (*ContainerMetrics) ProtoMessage()

func (*ContainerMetrics) ProtoReflect added in v0.6.0

func (x *ContainerMetrics) ProtoReflect() protoreflect.Message

func (*ContainerMetrics) Reset added in v0.6.0

func (x *ContainerMetrics) Reset()

func (*ContainerMetrics) String added in v0.6.0

func (x *ContainerMetrics) String() string

type ContainerPhase

type ContainerPhase int32
const (
	ContainerPhase_SCALED_DOWN       ContainerPhase = 0
	ContainerPhase_RUNNING           ContainerPhase = 1
	ContainerPhase_STOPPING          ContainerPhase = 2
	ContainerPhase_CHECKPOINT_FAILED ContainerPhase = 3
	ContainerPhase_RESTORE_FAILED    ContainerPhase = 4
)

func (ContainerPhase) Descriptor

func (ContainerPhase) Enum

func (x ContainerPhase) Enum() *ContainerPhase

func (ContainerPhase) EnumDescriptor deprecated

func (ContainerPhase) EnumDescriptor() ([]byte, []int)

Deprecated: Use ContainerPhase.Descriptor instead.

func (ContainerPhase) Number

func (ContainerPhase) String

func (x ContainerPhase) String() string

func (ContainerPhase) Type

type ContainerRequest

type ContainerRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ContainerRequest) Descriptor deprecated

func (*ContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use ContainerRequest.ProtoReflect.Descriptor instead.

func (*ContainerRequest) GetId

func (x *ContainerRequest) GetId() string

func (*ContainerRequest) ProtoMessage

func (*ContainerRequest) ProtoMessage()

func (*ContainerRequest) ProtoReflect

func (x *ContainerRequest) ProtoReflect() protoreflect.Message

func (*ContainerRequest) Reset

func (x *ContainerRequest) Reset()

func (*ContainerRequest) String

func (x *ContainerRequest) String() string

type ContainerStatus

type ContainerStatus struct {
	Id            string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name          string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	PodName       string                 `protobuf:"bytes,3,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"`
	PodNamespace  string                 `protobuf:"bytes,4,opt,name=pod_namespace,json=podNamespace,proto3" json:"pod_namespace,omitempty"`
	Phase         ContainerPhase         `protobuf:"varint,5,opt,name=phase,proto3,enum=zeropod.shim.v1.ContainerPhase" json:"phase,omitempty"`
	EventTime     *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"`
	EventDuration *durationpb.Duration   `protobuf:"bytes,7,opt,name=event_duration,json=eventDuration,proto3" json:"event_duration,omitempty"`
	EventLog      string                 `protobuf:"bytes,8,opt,name=event_log,json=eventLog,proto3" json:"event_log,omitempty"`
	// contains filtered or unexported fields
}

func (*ContainerStatus) Descriptor deprecated

func (*ContainerStatus) Descriptor() ([]byte, []int)

Deprecated: Use ContainerStatus.ProtoReflect.Descriptor instead.

func (*ContainerStatus) GetEventDuration added in v0.7.0

func (x *ContainerStatus) GetEventDuration() *durationpb.Duration

func (*ContainerStatus) GetEventLog added in v0.11.0

func (x *ContainerStatus) GetEventLog() string

func (*ContainerStatus) GetEventTime added in v0.7.0

func (x *ContainerStatus) GetEventTime() *timestamppb.Timestamp

func (*ContainerStatus) GetId

func (x *ContainerStatus) GetId() string

func (*ContainerStatus) GetName

func (x *ContainerStatus) GetName() string

func (*ContainerStatus) GetPhase

func (x *ContainerStatus) GetPhase() ContainerPhase

func (*ContainerStatus) GetPodName

func (x *ContainerStatus) GetPodName() string

func (*ContainerStatus) GetPodNamespace

func (x *ContainerStatus) GetPodNamespace() string

func (*ContainerStatus) ProtoMessage

func (*ContainerStatus) ProtoMessage()

func (*ContainerStatus) ProtoReflect

func (x *ContainerStatus) ProtoReflect() protoreflect.Message

func (*ContainerStatus) Reset

func (x *ContainerStatus) Reset()

func (*ContainerStatus) String

func (x *ContainerStatus) String() string

type MetricsRequest

type MetricsRequest struct {
	Empty *emptypb.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	// contains filtered or unexported fields
}

func (*MetricsRequest) Descriptor deprecated

func (*MetricsRequest) Descriptor() ([]byte, []int)

Deprecated: Use MetricsRequest.ProtoReflect.Descriptor instead.

func (*MetricsRequest) GetEmpty

func (x *MetricsRequest) GetEmpty() *emptypb.Empty

func (*MetricsRequest) ProtoMessage

func (*MetricsRequest) ProtoMessage()

func (*MetricsRequest) ProtoReflect

func (x *MetricsRequest) ProtoReflect() protoreflect.Message

func (*MetricsRequest) Reset

func (x *MetricsRequest) Reset()

func (*MetricsRequest) String

func (x *MetricsRequest) String() string

type MetricsResponse

type MetricsResponse struct {
	Metrics []*ContainerMetrics `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// contains filtered or unexported fields
}

func (*MetricsResponse) Descriptor deprecated

func (*MetricsResponse) Descriptor() ([]byte, []int)

Deprecated: Use MetricsResponse.ProtoReflect.Descriptor instead.

func (*MetricsResponse) GetMetrics

func (x *MetricsResponse) GetMetrics() []*ContainerMetrics

func (*MetricsResponse) ProtoMessage

func (*MetricsResponse) ProtoMessage()

func (*MetricsResponse) ProtoReflect

func (x *MetricsResponse) ProtoReflect() protoreflect.Message

func (*MetricsResponse) Reset

func (x *MetricsResponse) Reset()

func (*MetricsResponse) String

func (x *MetricsResponse) String() string

type ShimClient

func NewShimClient

func NewShimClient(client *ttrpc.Client) ShimClient

type Shim_SubscribeStatusClient

type Shim_SubscribeStatusClient interface {
	Recv() (*ContainerStatus, error)
	ttrpc.ClientStream
}

type Shim_SubscribeStatusServer

type Shim_SubscribeStatusServer interface {
	Send(*ContainerStatus) error
	ttrpc.StreamServer
}

type SubscribeStatusRequest

type SubscribeStatusRequest struct {
	Empty *emptypb.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeStatusRequest) Descriptor deprecated

func (*SubscribeStatusRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubscribeStatusRequest.ProtoReflect.Descriptor instead.

func (*SubscribeStatusRequest) GetEmpty

func (x *SubscribeStatusRequest) GetEmpty() *emptypb.Empty

func (*SubscribeStatusRequest) ProtoMessage

func (*SubscribeStatusRequest) ProtoMessage()

func (*SubscribeStatusRequest) ProtoReflect

func (x *SubscribeStatusRequest) ProtoReflect() protoreflect.Message

func (*SubscribeStatusRequest) Reset

func (x *SubscribeStatusRequest) Reset()

func (*SubscribeStatusRequest) String

func (x *SubscribeStatusRequest) String() string

Jump to

Keyboard shortcuts

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