Documentation
¶
Index ¶
- Constants
- Variables
- func IsPidHost() bool
- func ShortContainerId(id string) string
- func TrimContainerImageRepo(image string) string
- func TrimContainerImageVersion(image string) string
- func TrimImageID(in string) string
- type ContainerMeta
- type ContainerMetaExtra
- type Event
- type EventCallback
- type ImageHistory
- type ImageMeta
- type MsgEventCallback
- type Network
- type NetworkEndpoint
- type Runtime
- type Service
Constants ¶
View Source
const ( DockerUCPInstanceIDKey string = "com.docker.ucp.InstanceID" DockerUCPVersionKey string = "com.docker.ucp.version" DockerUCPCollectionKey string = "com.docker.ucp.collection" DockerSwarmServiceKey string = "com.docker.swarm.service.name" DockerSwarmTaskName string = "com.docker.swarm.task.name" DockerSwarmTaskID string = "com.docker.swarm.task.id" DockerComposeProjectKey string = "com.docker.compose.project" DockerComposeServiceKey string = "com.docker.compose.service" DockerIngressNetworkName string = "ingress" DockerIngressSandboxName string = "ingress-sbox" DockerIngressEPName string = "ingress-endpoint" )
View Source
const ( RancherCNINetwork string = "io.rancher.cni.network" RancherContainerNetwork string = "io.rancher.container.network" RancherKeyContainerIP string = "io.rancher.container.ip" RancherKeyContainerSystem string = "io.rancher.container.system" RancherKeyContainerName string = "io.rancher.container.name" RancherKeyStackName string = "io.rancher.stack.name" RancherKeyStackServiceName string = "io.rancher.stack_service.name" )
View Source
const ( KubeKeyPodNamespace string = "io.kubernetes.pod.namespace" KubeKeyPodName string = "io.kubernetes.pod.name" KubeKeyDeployConfig string = "deploymentconfig" KubeKeyPodHash string = "pod-template-hash" KubeKeyComponent string = "component" KubeKeyJobName string = "job-name" KubeKeyContainerName string = "io.kubernetes.container.name" KubeNamespaceSystem string = "kube-system" KubeNamespaceCatalog string = "kube-service-catalog" KubeContainerNamePod string = "POD" KubeContainerNameProxy string = "kube-proxy" KubePodNamePrefixProxy string = "kube-proxy" KubeKeyAppName string = "app" )
View Source
const ( KubeLinkerdProxyName string = "linkerd-proxy" KubeLinkerdSysPodNamespace string = "linkerd" KubeIstioProxyName string = "istio-proxy" KubeProxyMeshLoMacStr string = "6c:6b:73:74:%02x:%02x" KubeProxyMeshLoMacPrefix string = "6c:6b:73:74" KubeIstioSystemPodNamespace string = "istio-system" KubeIstioSystemIngGwPrefix string = "istio-ingressgateway" KubeIstioSystemEgGwPrefix string = "istio-egressgateway" KubeAwsProxyName string = "envoy" )
View Source
const ( OpenShiftPodImage string = "openshift/origin-pod" OpenShiftPodTag string = "io.openshift.tags" )
View Source
const ( KubeRancherPodNamespace string = "cattle-system" KubeRancherKeyStackName string = "annotation.io.rancher.stack.name" KubeRancherIngressNamespace string = "ingress-nginx" )
View Source
const ( AliyunSystem string = "aliyun.system" AliyunAddon string = "aliyun.addon" )
View Source
const ( ECSAgentImagePrefix string = "amazon/amazon-ecs-agent:" ECSTaskDefinition string = "com.amazonaws.ecs.task-definition-family" ECSContainerName string = "com.amazonaws.ecs.container-name" ECSCluster string = "com.amazonaws.ecs.cluster" )
View Source
const ( IbmCloudProviderIP = "ibm-cloud-provider-ip" IbmCloudClusterID = "clusterID" )
View Source
const ( PlatformContainerNone = "" PlatformContainerNeuVector = "NeuVector" PlatformContainerDockerUCPCtrl = "Docker-UCP-Controller" PlatformContainerDockerUCPSwarm = "Docker-UCP-Swarm" PlatformContainerDockerUCPOther = "Docker-UCP-Other" PlatformContainerDockerDTR = "Docker-DTR" PlatformContainerDockerSystem = "Docker-System" // generic PlatformContainerRancherInfra = "Rancher" PlatformContainerRancherAgent = "Rancher-Agent" PlatformContainerRancherNetworkAgent = "Rancher-Network-Agent" PlatformContainerOpenshift = "Openshift" PlatformContainerKubeInfra = "Kubernetes" PlatformContainerKubeInfraPause = "Kubernetes-System-POD" PlatformContainerAliyunAgent = "Aliyu-Agent" PlatformContainerAliyunAddon = "Aliyu-Addon" PlatformContainerECSAgent = "ECS-Agent" PlatformContainerIstioInfra = "Istio-System-POD" PlatformContainerLinkerdInfra = "Linkerd-System-POD" )
View Source
const ( RuntimeDocker = "docker" RuntimeContainerd = "containerd" RuntimeCriO = "cri-o" RuntimeUnknown = "unknown" )
View Source
const ( DockerNetworkGlobal = "global" DockerNetworkSwarm = "swarm" DockerNetworkLocal = "local" )
View Source
const ( EventContainerStart = "start" EventContainerStop = "stop" EventContainerDelete = "delete" EventContainerCopyIn = "copy-in" EventContainerCopyOut = "copy-out" EventSocketError = "socket-err" EventServiceCreate = "create-service" EventServiceUpdate = "update-service" EventServiceDelete = "delete-service" EventNetworkCreate = "create-network" EventNetworkDelete = "delete-network" )
View Source
const (
NeuvectorSetServiceName = "io.neuvector.service.name"
)
View Source
const (
RancherOverlayNetworkName string = "rancher"
)
View Source
const StubRtName = "stubRtDriver"
This is a virtual runtime device driver. It supports the limited device information when the runtime driver is not available.
Variables ¶
Functions ¶
func ShortContainerId ¶
func TrimContainerImageRepo ¶
func TrimImageID ¶
Types ¶
type ContainerMeta ¶
type ContainerMetaExtra ¶
type ContainerMetaExtra struct {
ContainerMeta
ImageID string
ImageDigest string
ImgCreateAt time.Time
Author string
Privileged bool
ExitCode int
Running bool
CreatedAt time.Time
StartedAt time.Time
FinishedAt time.Time
MemoryLimit int64
CPUs string
ProxyMesh bool
Sidecar bool
RunAsRoot bool
// network
IPAddress string
IPPrefixLen int
MappedPorts map[share.CLUSProtoPort]*share.CLUSMappedPort
Networks utils.Set
LogPath string
Healthcheck []string
}
func SortContainers ¶
func SortContainers(cs []*ContainerMetaExtra) []*ContainerMetaExtra
type EventCallback ¶
type ImageHistory ¶
type MsgEventCallback ¶
type MsgEventCallback func(e dockerEvent.Message)
type NetworkEndpoint ¶
type Runtime ¶
type Runtime interface {
String() string
MonitorEvent(cb EventCallback, cpath bool) error
StopMonitorEvent()
GetHost() (*share.CLUSHost, error)
GetSelfID() string
GetDevice(id string) (*share.CLUSDevice, *ContainerMetaExtra, error)
GetContainer(id string) (*ContainerMetaExtra, error)
ListContainers(runningOnly bool) ([]*ContainerMeta, error)
ListContainerIDs() (utils.Set, utils.Set)
GetImageHistory(name string) ([]*ImageHistory, error)
GetImage(name string) (*ImageMeta, error)
GetImageFile(id string) (io.ReadCloser, error)
GetNetworkEndpoint(netName, container, epName string) (*NetworkEndpoint, error)
ListNetworks() (map[string]*Network, error)
GetService(id string) (*Service, error)
ListServices() ([]*Service, error)
// Return if container is child and parent container id. If pidMap is nil, only return if it's child.
GetParent(meta *ContainerMetaExtra, pidMap map[int]string) (bool, string)
IsDaemonProcess(proc string, cmds []string) bool
IsRuntimeProcess(proc string, cmds []string) bool
GetProxy() (string, string, string)
GetDefaultRegistries() []string
GetStorageDriver() string
}
func ConnectDocker ¶
func ConnectDocker(endpoint string, sys *system.SystemTools) (Runtime, error)
Click to show internal directories.
Click to hide internal directories.