Documentation
¶
Index ¶
- Constants
- Variables
- func GetAppImageID(ctx context.Context) string
- func GetDisableHostCgroup(ctx context.Context) bool
- func GetDisableVMCgroup(ctx context.Context) bool
- func GetFuncType(ctx context.Context) string
- func GetImageCredentials(ctx context.Context) *runtime.AuthConfig
- func GetImageSpec(ctx context.Context) *cubeimages.ImageSpec
- func GetInstanceTypeWithDefault(s string) string
- func GetPreStopType(ctx context.Context) string
- func GetProxySubAccountUin(ctx context.Context) string
- func GetProxyUserAppID(ctx context.Context) int64
- func GetProxyUserUin(ctx context.Context) string
- func GetRegion(ctx context.Context) string
- func GetStartPullImageTime(ctx context.Context) *time.Time
- func IsCollectMemory(ctx context.Context) bool
- func IsCubeRuntime(ctx context.Context) bool
- func IsCubeboxCreated(ctx context.Context) bool
- func IsFailoverOperation(ctx context.Context) bool
- func IsSandboxContainer(ctx context.Context) bool
- func IsTerminatingPod(ctx context.Context) bool
- func MakeContainerIDEnvKey(name string) string
- func SkipRuntimeAPI(ctx context.Context) bool
- func WithAppImageID(ctx context.Context, ID string) context.Context
- func WithCollectMemory(ctx context.Context) context.Context
- func WithCubeRuntimeOption(ctx context.Context, sandboxId string) context.Context
- func WithCubeboxCreated(ctx context.Context) context.Context
- func WithDisableHostCgroup(ctx context.Context, value bool) context.Context
- func WithDisableVMCgroup(ctx context.Context, value bool) context.Context
- func WithFailoverOperation(ctx context.Context) context.Context
- func WithFuncType(ctx context.Context, value string) context.Context
- func WithImageCredentials(ctx context.Context, authConfig *runtime.AuthConfig) context.Context
- func WithImageSpec(ctx context.Context, imageReq *cubeimages.ImageSpec) context.Context
- func WithPreStopType(ctx context.Context, value string) context.Context
- func WithProxySubAccountUin(ctx context.Context, value string) context.Context
- func WithProxyUserAppID(ctx context.Context, value int64) context.Context
- func WithProxyUserUin(ctx context.Context, value string) context.Context
- func WithRegion(ctx context.Context, value string) context.Context
- func WithRuntimeType(ctx context.Context, t string) context.Context
- func WithSandboxContainer(ctx context.Context) context.Context
- func WithSkipRuntimeAPI(ctx context.Context) context.Context
- func WithStartPullImageTime(ctx context.Context, startPullImageTime *time.Time) context.Context
- func WithTerminatingPod(ctx context.Context) context.Context
- type CubeRuntimeOption
- type PluginId
Constants ¶
View Source
const ( AnnotationCFSRootfs = "cube.image.cfs.rootfs" LabelContainerImageMedia = "cube.image.media" LabelContainerImageRootInfo = "cube.image.rootinfo" LabelContainerCubeImageSpec = "cube.image.cube.image.spec" AnnotationCubeletNameSpace = "cube.cubelet/namespace" )
View Source
const ( AnnotationContainerdPrefix = "io.containerd" AnnotationContainerdRefSource = AnnotationContainerdPrefix + ".import.ref-source" AnnotationValueAnnotation = "annotation" )
View Source
const ( AnnotationSnapshotterPrefix = "containerd.io/snapshot/" AnnotationSnapshotterExternalPath = AnnotationSnapshotterPrefix + "external-path" AnnotationSnapshotterUseExternalBind = AnnotationSnapshotterPrefix + "use-external-bind" AnnotationSnapshotUpperdirKey = AnnotationSnapshotterPrefix + "overlay.upperdir" AnnotationSnapshotRefDir = AnnotationSnapshotterPrefix + "overlay.refdir" AnnotationSnapshotRef = "containerd.io/snapshot.ref" AnnotationSnapshotterHostLayerMountDigest = AnnotationSnapshotterPrefix + "layermount.digest" AnnotationSnapshotterHostLayerMountHostPath = AnnotationSnapshotterPrefix + "layermount.hostpath" AnnotationSnapshotterHostLayerMountParent = AnnotationSnapshotterPrefix + "layermount.parent" AnnotationSnapshotterCustomUsage = AnnotationSnapshotterPrefix + "custom-usage" AnnotationSnapshotterTargetManifestDigestLabel = AnnotationSnapshotterPrefix + "cri.manifest-digest" AnnotationImageConfigID = AnnotationSnapshotterPrefix + "image-config-id" )
View Source
const ( AnnotationCubeContainerName = "cube.container.name" AnnotationCubeSandboxImageID = "cube.container.sandbox.image.id" )
View Source
const ( AnnotationCubeletInternalPrefix = "cubelet.internal.param/" AnnotationCubeletInternalRuntimePath = AnnotationCubeletInternalPrefix + "runtime-path" )
View Source
const ( InternalPlugin plugin.Type = "io.cubelet.internal.v1" CubeboxServicePlugin plugin.Type = "io.cubelet.cubebox-service.v1" ImagesServicePlugin plugin.Type = "io.cubelet.images-service.v1" WorkflowPlugin plugin.Type = "io.cubelet.workflow.v1" CubeServicePlugin plugin.Type = "io.cubelet.cube.v1" PluginCfsImage plugin.Type = "io.cubelet.cfs.v1" PluginChi plugin.Type = "io.cubelet.chi.v1" PluginCBRIManager plugin.Type = "io.cubelet.cbrim.v1" PluginCBRI plugin.Type = "io.cubelet.cbri.v1" CubeTransferManager plugin.Type = "io.cubelet.transfer.v1" CubeMetric plugin.Type = "io.cubelet.metric.v1" CubeStorePlugin plugin.Type = "io.cubelet.cubestore.v1" CubeMetaStorePlugin plugin.Type = "io.cubelet.cubemetastore.v1" CubeMountManagerPlugin plugin.Type = "io.cubelet.mount.v1" )
View Source
const ( ControllerConfigPlugin plugin.Type = "io.cubelet.controller.config.v1" ControllerCubeletPlugin plugin.Type = "io.cubelet.controller.cubelet.v1" ControllerPlugin plugin.Type = "io.cubelet.controller.v1" PluginCubelet string = "cubelet" PluginRunTemplateManager PluginId = "run-template-manager" PluginCubeRuntimeTemplateController PluginId = "cube-runtime-template-controller" )
View Source
const ( ExtensionsKey = "extensions" CubeInnerId = "cubebox-inner" CubeRunCgroupId = "cube-inner-cgroup" CubeProbeId = "probe" CubeNewContainerId = "new-metadata" CubeDelContainerId = "del-metadata" CubeShimBinaryStartId = "binarystart" CubeShimCreatetId = "create" CubeImageEnsureId = "image-ensure" CubeImageResolveId = "image-resolve" CubeImageMountCfsId = "image-cfs" CubeImageMountSqfsId = "image-sqfs" CubeImageUpdateSnapId = "image-updatesnap" CubeExecProcessId = "cube-exec-process" CubeFilesPrepareId = "files-prepare" CubeContainerSpecId = "gen-spec" CubeShimWaitId = "wait" CubeShimStartId = "start" CubeDeleteTaskId = "del-task" CubeShimUpdateId = "update" CubePrestopId = "prestop" CubePoststopId = "poststop" LimiterId = "workflow-limiter" DelSandbox = "del-sandbox" DelContainer = "del-container" ProcessExists = "process-exists-check" CubeExtNumaKey = "cube-ext-numa" CubeExtQueueKey = "cube-ext-queue" CubeShimPid = "shim-pid" CubeVmPid = "vm-pid" )
View Source
const ( MasterAnnotationsNetWork = "cube.master.net" MasterAnnotationsBlkQos = "cube.master.blk.qos" MasterAnnotationsFSQos = "cube.master.fs.qos" MasterAnnotationsImageUserName = "cube.master.image.username" MasterAnnotationsImagetoken = "cube.master.image.token" MasterAnnotationsNetCubeVips = "cube.master.vips" MasterAnnotationsPICMode = "cube.master.instance.pic_mode" MasterAnnotationsNumaNode = "cube.master.instance.numa_node" MasterAnnotationsUserData = "cube.master.instance.user_data" MasterAnnotationsDataDisk = "cube.master.instance.data_disk" MasterAnnotationsVPC = "cube.master.instance.virtual_private_cloud" MasterAnnotationsSGIDS = "cube.master.instance.sg_ids" MasterAnnotationsRetainIP = "cube.master.instance.retain_ip" MasterAnnotationsInsRegion = "cube.master.instance.region" MasterAnnotationsInsHostIP = "cube.master.instance.host_ip" MasterAnnotationsInsHostUUID = "cube.master.instance.host_uuid" MasterAnnotationsInsHostCpuTotal = "cube.master.instance.host_cpu_total" MasterAnnotationsInsHostVirtualQuotaArray = "cube.master.instance.host_virtual_quota_array" MasterAnnotationsDisableVmCgroup = "cube.master.disable_vm_cgroup" MasterAnnotationsDisableHostCgroup = "cube.master.disable_host_cgroup" MasterAnnotationsUpdateAction = "cube.master.update_action" MasterAnnotationsFallbackToSlowPath = "cube.master.fallback_to_slow_path" MasterAnnotationsAppSnapshotCreate = "cube.master.appsnapshot.create" MasterAnnotationAppSnapshotTemplateID = "cube.master.appsnapshot.template.id" MasterAnnotationRuntimeSnapshotID = "cube.master.runtime.snapshot.id" MasterAnnotationRuntimeSnapshotAttachedAt = "cube.master.runtime.snapshot.attached_at" // MasterAnnotationRuntimeRestoreSnapshotID tracks the snapshot id whose // memory image the running VM was last *restored* from (set by Create // for restore-from-snapshot path, and by Rollback). Unlike // MasterAnnotationRuntimeSnapshotID, Commit does NOT bump this — Commit // does not restart the VM, so the in-process pagemap_anon bitmap is // still tracking "anon pages dirtied since the last restore", which // matches the memory file recorded here. MasterAnnotationRuntimeRestoreSnapshotID = "cube.master.runtime.restore.snapshot.id" MasterAnnotationRuntimeRestoreSnapshotAttachedAt = "cube.master.runtime.restore.snapshot.attached_at" MasterAnnotationAppSnapshotVersion = "cube.master.appsnapshot.version" MasterAnnotationRootfsArtifactID = "cube.master.rootfs.artifact.id" MasterAnnotationRootfsArtifactJobID = "cube.master.rootfs.artifact.job_id" MasterAnnotationRootfsArtifactURL = "cube.master.rootfs.artifact.url" MasterAnnotationRootfsArtifactToken = "cube.master.rootfs.artifact.token" MasterAnnotationRootfsArtifactSHA256 = "cube.master.rootfs.artifact.sha256" MasterAnnotationRootfsArtifactSizeBytes = "cube.master.rootfs.artifact.size_bytes" MasterAnnotationWritableLayerSize = "cube.master.rootfs.writable_layer_size" MasterAnnotationTemplateSpecFingerprint = "cube.master.template.spec_fingerprint" MasterAnnotationInstanceType = "cube.master.instance.type" MasterAnnotationNetworkPolicyBlockAll = "cube.master.network.policy.block_all" MasterAnnotationNetworkPolicyAllowPublicServices = "cube.master.network.policy.allow_public_services" MasterAnnotationNetworkPolicyDefault = "cube.master.network.policy.default" )
View Source
const ( AnnotationPmem = "cube.pmem" AnnotationsVFIONet = "cube.vfio.net" AnnotationsVFIODisk = "cube.vfio.disk" AnnotationsVFIODiskRM = "cube.vfio.disk.rm" AnnotationsNetWork = "cube.net" AnnotationsSandboxDNS = "cube.sandbox.dns" AnnotationsMountListKey = "cube.disk" AnnotationsFSKey = "cube.fs" AnnotationsVMSpecKey = "cube.vmmres" AnnotationsRootfsKey = "cube.rootfs.info" AnnotationsNetCubeVips = "cube.net.vips" AnnotationsCgroupPath = "cube.sandbox_cgroup_path" AnnotationsRuntimeCfgPath = "cube.runtime.config.path" AnnotationsVMImagePath = "cube.vm.image.path" AnnotationsVMKernelPath = "cube.vm.kernel.path" AnnotationsRootfsWritableKey = "cube.rootfs.wlayer.path" AnnotationsRootfsWlayerSubdir = "cube.rootfs.wlayer.subdir" AnnotationsCubeMsgKey = "cube.msg.dev.path" AnnotationsProduct = "cube.product" AnnotationVMSnapshotPath = "cube.vm.snapshot.base.path" AnnotationVMSnapshotMemoryVolURL = "cube.vm.snapshot.memory_vol_url" AnnotationPmemContainerPrefix = "pmem-cntr" AnnotationPmemLangPrefix = "pmem-lang" AnnotationPmemCubeBoxImageIDPrefix = "pmem-cubebox-image" AnnotationAppSnapshotCreate = "cube.appsnapshot.create" AnnotationAppSnapshotRestore = "cube.appsnapshot.restore" AnnotationAppSnapshotContainerID = "cube.appsnapshot.container.id" AnnotationSnapshotDisable = "cube.snapshot.disable" AnnotationAppSnapshotFinished = "cube.appsnapshot.finished" DefaultSnapshotDir = "/usr/local/services/cubetoolbox/cube-snapshot" AnnotationContaineRootfsPropagation = "cube.container.rootfs.propagation" AnnotationVMKernelCmdlineAppend = "cube.vm.kernel.cmdline.append" AnnotationVirtiofs = "cube.virtiofs" AnnotationPropagationMounts = "cube.propagation.mounts" AnnotationPropagationContainerMounts = "cube.propagation.container.mounts" AnnotationPropagationExecMounts = "cube.propagation.exec.mounts" AnnotationPropagationContainerUmounts = "cube.propagation.container.umounts" )
View Source
const ( LabelPinnedImageKey = "cube.image.pinned" LabelPinnedImageValue = "pinned" AnnotationCollectMemOnExit = "cube.instance.collect_memory" AnnotationUseNetfileCache = "cube.instance.use_netfile_cache" AnnotationsDebugStdout = "com.debug.stdout" AnnotationVideoEnable = "cloud.tencent.com/video/enable" AnnotationVideoResolution = "cloud.tencent.com/video/resolution" AnnotationVideoMaxResolution = "cloud.tencent.com/video/max-resolution" AnnotationVideoFPS = "cloud.tencent.com/video/fps" LabelContainerImagePem = "cube.image.pem" LabelContainerImageCosType = "cube.image.cos" LabelNumaNode = "cube.numa_node" LabelHealthCheckPod = "X-Origin-Caller" )
View Source
const ( MountTypeBind = "bind" MountTypeTmpfs = "tmpfs" MountTypeCgroup = "cgroup" MountTypeLocal = "local" MountPropagationRprivate = "rprivate" MountPropagationRSlave = "rslave" MountPropagationSlave = "slave" MountOptBindRO = "rbind" MountOptBind = "bind" MountOptReadOnly = "ro" MountOptReadWrite = "rw" MountOptNoSuid = "nosuid" MountOptNoExec = "noexec" MountOptNoDev = "nodev" )
View Source
const ( UpdateActionAddDevice = "addDevice" UpdateActionRemoveDevice = "removeDevice" UpdateActionPause = "pause" UpdateActionResume = "resume" PreStopTypePause = "pause" PreStopTypeDestroy = "destroy" )
View Source
const ( PCIModePF = "PF" PCIModeVF = "VF" )
View Source
const ( CubeVersion = "v1" CubeDefaultNamespace = "default" )
View Source
const ( DeviceTypeChar = "c" DeviceTypeBlock = "b" DeviceNamePrefix = "/dev" DeviceNameVsock = DeviceNamePrefix + "/vsock" )
View Source
const ( UserAgentKey = "user-agent" UserAgentDefaultValue = "" UserAgentCubecli = "cubecli" )
View Source
const ( StringTrueValue = "true" StringFalseValue = "false" )
View Source
const ( PropagationVirtioRo = "virtio_ro" PropagationVirtioRw = "virtio_rw" PropagationContainerDirRo = "/.container_ro" PropagationContainerDirRw = "/.container_rw" )
View Source
const ( VirtiofsCacheAuto = 0 VirtiofsCacheAlways = 1 VirtiofsCacheNever = 2 VirtiofsCacheNone = 3 )
View Source
const ( LabelImagePrefix = "io.containerd.image/" LabelImageConvertedCubeSchemaLabelKey = LabelImagePrefix + "converted-cube-schema" LabelImageUidFiles = LabelImagePrefix + "uid-files" LabelImageHostLowerDirs = LabelImagePrefix + "host-lower-dirs" LabelImageHostLowerDirsPrefix = LabelImagePrefix + "host-lower-dirs/prefix" LabelImageNoHostLayers = LabelImagePrefix + "no-host-layers" LabelImageLayerDirs = LabelImagePrefix + "layer/dirs" LabelImageCreateBy = LabelImagePrefix + "create-by" LabelImageCreateByImport = "import" LabelCubeNamespace = "namespace" )
View Source
const ( LabelCriSandboxID = "io.kubernetes.cri.sandbox-id" LabelCriContainerType = "io.cri-containerd.kind" LabelSandboxFirstContainerID = "cube.sandbox.first.container.id" )
View Source
const ( ContainerTypeContainer = "container" ContainerTypeSandBox = "sandbox" ContainerType = "io.kubernetes.cri.container-type" SandboxID = "io.kubernetes.cri.sandbox-id" ContainerName = "io.kubernetes.cri.container-name" )
View Source
const ( CubeConfigBasePath = "/data/cubelet" CubeConfigStatePath = CubeConfigBasePath + "/state" CubeConfigRootPath = CubeConfigBasePath + "/root" )
View Source
const (
AnnotationContentDirectDigest = "containerd.io/content/direct-digest"
)
View Source
const (
AnnotationShimCustomFile = "cube.container.custom.file"
)
View Source
const (
BoltOpenTimeout = "io.containerd.timeout.bolt.open"
)
View Source
const (
CubeMsgDevDefaultName = "/dev/cubemsg0"
)
View Source
const (
KCubeIndexContext contextKey = "kCubeIndex"
)
View Source
const (
LabelInstanceType = "cube.cloud.tencentcloud.com/instance-type"
)
View Source
const (
PrefixSha256 = "sha256:"
)
Variables ¶
View Source
var ( DeviceDefaultFileMode = os.FileMode(0o666) ALLUid uint32 = 0xffffffff )
View Source
var ( DefaultCosProtocol = "https" DefaultUserCodeDownloadRetryNum = 3 DefaultUserCodeDownloadRetrySleepTime = time.Duration(10) * time.Millisecond DefaultCodeSliceSize = int64(5) DefaultCodeSliceMax = 8 )
View Source
var (
RegexContainerName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9-]{0,63}$`)
)
Functions ¶
func GetAppImageID ¶
func GetDisableHostCgroup ¶
func GetDisableVMCgroup ¶
func GetFuncType ¶
func GetImageCredentials ¶
func GetImageCredentials(ctx context.Context) *runtime.AuthConfig
func GetImageSpec ¶
func GetImageSpec(ctx context.Context) *cubeimages.ImageSpec
func GetPreStopType ¶
func GetProxySubAccountUin ¶
func GetProxyUserAppID ¶
func GetProxyUserUin ¶
func IsCollectMemory ¶
func IsCubeRuntime ¶
func IsCubeboxCreated ¶
func IsFailoverOperation ¶
func IsSandboxContainer ¶
func IsTerminatingPod ¶
func MakeContainerIDEnvKey ¶
func SkipRuntimeAPI ¶
func WithCubeRuntimeOption ¶
func WithDisableHostCgroup ¶
func WithDisableVMCgroup ¶
func WithImageCredentials ¶
func WithImageSpec ¶
func WithProxySubAccountUin ¶
func WithStartPullImageTime ¶
Types ¶
type CubeRuntimeOption ¶
func GetCubeRuntimeOption ¶
func GetCubeRuntimeOption(ctx context.Context) *CubeRuntimeOption
type PluginId ¶
type PluginId string
const ( NetworkID PluginId = "network" StorageID PluginId = "storage" MetricID PluginId = "metric" CgroupID PluginId = "cgroup" ImagesID PluginId = "images" CubeboxID PluginId = "cubebox" CreateID PluginId = "createid" APPSnapshotID PluginId = "appsnapshot" ShimLogID PluginId = "shimlog" GCID PluginId = "cleanup" VolumeSourceID PluginId = "volume" BackupID PluginId = "backup" WorkflowID PluginId = "workflow" ImagesServiceID PluginId = "images-service" CubeboxServiceID PluginId = "cubebox-service" GCServiceID PluginId = "gc-service" PluginIDMount PluginId = "mount" PluginSandboxControllerRuncPod = "runc" PluginSandboxControllerCubeShim = "cube-shim" PluginVSocketManger = "vsocket-manager" PluginManager = "manager" SNHostID PluginId = "snhost" PluginImage PluginId = "image" NumaID PluginId = "numa" NetFile PluginId = "netfile" MultiMetaID PluginId = "mutilmeta" )
Click to show internal directories.
Click to hide internal directories.