common

package
v0.0.0-...-e1c17e3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Provider configuration defaults.
	DefaultCPUCapacity    = "20"
	DefaultMemoryCapacity = "100Gi"
	DefaultPodCapacity    = "20"

	// Values used in tracing as attribute keys.
	NamespaceKey            = "namespace"
	NameKey                 = "name"
	ContainerNameKey        = "containerName"
	PodVolRoot              = ".knoc/"
	PodSecretVolPerms       = 0755
	PodSecretVolDir         = "/secrets"
	PodSecretFilePerms      = 0644
	PodConfigMapVolPerms    = 0755
	PodConfigMapVolDir      = "/configmaps"
	PodConfigMapFilePerms   = 0644
	PodDownwardApiVolPerms  = 0755
	PodDownwardApiVolDir    = "/downwardapis"
	PodDownwardApiFilePerms = 0644
	CREATE                  = 0
	DELETE                  = 1
)

Variables

This section is empty.

Functions

func BuildKey

func BuildKey(pod *v1.Pod) (string, error)

buildKey is a helper for building the "key" for the providers pod store.

func BuildKeyFromNames

func BuildKeyFromNames(namespace string, name string) (string, error)

func NormalizeImageName

func NormalizeImageName(instance_name string) string

func UploadData

func UploadData(client *simplessh.Client, data []byte, remote string, mode fs.FileMode) error

func UploadFile

func UploadFile(client *simplessh.Client, local string, remote string, mode fs.FileMode) error

Types

type DoorContainer

type DoorContainer struct {
	Name          string                  `json:"name" protobuf:"bytes,1,opt,name=name"`
	Image         string                  `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"`
	Command       []string                `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"`
	Args          []string                `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"`
	WorkingDir    string                  `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"`
	Ports         []v1.ContainerPort      `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"`
	EnvFrom       []v1.EnvFromSource      `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"`
	Env           []v1.EnvVar             `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"`
	Resources     v1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
	VolumeMounts  []v1.VolumeMount        `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"`
	VolumeDevices []v1.VolumeDevice       `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"`
	Metadata      metav1.ObjectMeta       `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}

type KNOCConfig

type KNOCConfig struct {
	CPU    string `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
	Pods   string `json:"pods,omitempty"`
}

type KNOCProvider

type KNOCProvider struct {
	NodeName           string
	OperatingSystem    string
	InternalIP         string
	DaemonEndpointPort int32
	Pods               map[string]*v1.Pod
	Config             KNOCConfig
	StartTime          time.Time
	ResourceManager    *manager.ResourceManager
	Notifier           func(*v1.Pod)
}

Jump to

Keyboard shortcuts

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