protocol

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HooksProtocolBuilder = hooksProtocolBuilder{
	KubeQOS: func(kubeQOS corev1.PodQOSClass) HooksProtocol {
		k := &KubeQOSContext{}
		k.FromReconciler(kubeQOS)
		return k
	},
	Pod: func(podMeta *statesinformer.PodMeta) HooksProtocol {
		p := &PodContext{}
		p.FromReconciler(podMeta)
		return p
	},
	Container: func(podMeta *statesinformer.PodMeta, containerName string) HooksProtocol {
		c := &ContainerContext{}
		c.FromReconciler(podMeta, containerName)
		return c
	},
}

Functions

This section is empty.

Types

type ContainerContext

type ContainerContext struct {
	Request  ContainerRequest
	Response ContainerResponse
}

func (*ContainerContext) FromProxy

func (*ContainerContext) FromReconciler

func (c *ContainerContext) FromReconciler(podMeta *statesinformer.PodMeta, containerName string)

func (*ContainerContext) ProxyDone

func (*ContainerContext) ReconcilerDone

func (c *ContainerContext) ReconcilerDone()

type ContainerMeta

type ContainerMeta struct {
	Name string
	ID   string // docker://xxx; containerd://
}

func (*ContainerMeta) FromProxy

func (c *ContainerMeta) FromProxy(containerMeta *runtimeapi.ContainerMetadata, podAnnotations map[string]string)

type ContainerRequest

type ContainerRequest struct {
	PodMeta        PodMeta
	ContainerMeta  ContainerMeta
	PodLabels      map[string]string
	PodAnnotations map[string]string
	CgroupParent   string
	ContainerEnvs  map[string]string
}

func (*ContainerRequest) FromProxy

func (*ContainerRequest) FromReconciler

func (c *ContainerRequest) FromReconciler(podMeta *statesinformer.PodMeta, containerName string)

type ContainerResponse

type ContainerResponse struct {
	Resources     Resources
	ContainerEnvs map[string]string
}

func (*ContainerResponse) ProxyDone

type HooksProtocol

type HooksProtocol interface {
	ReconcilerDone()
}

type KubeQOSContext

type KubeQOSContext struct {
	Request  KubeQOSRequet
	Response KubeQOSResponse
}

func (*KubeQOSContext) FromReconciler

func (k *KubeQOSContext) FromReconciler(kubeQOS corev1.PodQOSClass)

func (*KubeQOSContext) ReconcilerDone

func (k *KubeQOSContext) ReconcilerDone()

type KubeQOSRequet

type KubeQOSRequet struct {
	KubeQOSClass corev1.PodQOSClass
	CgroupParent string
}

func (*KubeQOSRequet) FromReconciler

func (r *KubeQOSRequet) FromReconciler(kubeQOS corev1.PodQOSClass)

type KubeQOSResponse

type KubeQOSResponse struct {
	Resources Resources
}

type PodContext

type PodContext struct {
	Request  PodRequest
	Response PodResponse
}

func (*PodContext) FromProxy

func (p *PodContext) FromProxy(req *runtimeapi.PodSandboxHookRequest)

func (*PodContext) FromReconciler

func (p *PodContext) FromReconciler(podMeta *statesinformer.PodMeta)

func (*PodContext) ProxyDone

func (p *PodContext) ProxyDone(resp *runtimeapi.PodSandboxHookResponse)

func (*PodContext) ReconcilerDone

func (p *PodContext) ReconcilerDone()

type PodMeta

type PodMeta struct {
	Namespace string
	Name      string
	UID       string
}

func (*PodMeta) FromProxy

func (p *PodMeta) FromProxy(meta *runtimeapi.PodSandboxMetadata)

func (*PodMeta) FromReconciler

func (p *PodMeta) FromReconciler(meta metav1.ObjectMeta)

type PodRequest

type PodRequest struct {
	PodMeta      PodMeta
	Labels       map[string]string
	Annotations  map[string]string
	CgroupParent string
}

func (*PodRequest) FromProxy

func (p *PodRequest) FromProxy(req *runtimeapi.PodSandboxHookRequest)

func (*PodRequest) FromReconciler

func (p *PodRequest) FromReconciler(podMeta *statesinformer.PodMeta)

type PodResponse

type PodResponse struct {
	Resources Resources
}

func (*PodResponse) ProxyDone

func (p *PodResponse) ProxyDone(resp *runtimeapi.PodSandboxHookResponse)

type Resources

type Resources struct {
	// origin resources
	CPUShares *int64
	CFSQuota  *int64
	CPUSet    *string

	// extended resources
	CPUBvt *int64
}

func (*Resources) IsOriginResSet added in v0.7.0

func (r *Resources) IsOriginResSet() bool

Jump to

Keyboard shortcuts

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