criproxy

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Copyright 2017 Mirantis

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	BusyboxImageName = "busybox:1.26.2"
)

Variables

This section is empty.

Functions

func GetPidFromSocket added in v0.8.0

func GetPidFromSocket(socketPath string) (int, error)

GetPidFromSocket attempts to connect to the specified unix domain socket and returns the PID of the listening process upon success.

func RemoveKubernetesContainers added in v0.8.0

func RemoveKubernetesContainers(dockerEndpoint string) error

RemoveKubernetesContainers kills kubernetes containers on the node so they get restarted. FIXME: find the actual reason why kube-dns & kubernetes-dashboard fail after the restart.

Types

type Bootstrap

type Bootstrap struct {
	// contains filtered or unexported fields
}

func NewBootstrap

func NewBootstrap(config *BootstrapConfig, cs kubernetes.Interface) *Bootstrap

NewBootstrap creates a new Bootstrap object used for CRI proxy bootstrap using the specified BootstrapConfig. cs argument is used to pass a fake Clientset during tests, it should be nil when performing real bootstrap.

func (*Bootstrap) EnsureCRIProxy

func (b *Bootstrap) EnsureCRIProxy() (bool, error)

EnsureCRIProxy checks whether kubelet configuration file exists and performs CRI proxy bootstrap procedure if it doesn't.

type BootstrapConfig

type BootstrapConfig struct {
	ApiServerHost string
	// TODO: remove this
	ConfigzBaseUrl  string
	ProxyPath       string
	ProxyArgs       []string
	ProxySocketPath string
	NodeInfo        *NodeInfo
}

type NodeInfo added in v0.8.0

type NodeInfo struct {
	KubeletArgs    []string
	NodeName       string
	DockerEndpoint string
	FirstRun       bool
}

NodeInfo represents an information needed by dockershim when it's run from bootstrapped CRI proxy

func LoadNodeInfo added in v0.8.0

func LoadNodeInfo(filename string) (*NodeInfo, error)

func NodeInfoFromCommandLine added in v0.8.0

func NodeInfoFromCommandLine(commandLineFile string) (*NodeInfo, error)

NodeInfoFromCommandLine constructs a NodeInfo from a command line file, formatted like /proc/NNN/cmdline

func (*NodeInfo) Write added in v0.8.0

func (ni *NodeInfo) Write(filename string) error

type RuntimeProxy

type RuntimeProxy struct {
	// contains filtered or unexported fields
}

RuntimeProxy is a gRPC implementation of internalapi.RuntimeService.

func NewRuntimeProxy

func NewRuntimeProxy(addrs []string, connectionTimout time.Duration, hook func()) (*RuntimeProxy, error)

NewRuntimeProxy creates a new internalapi.RuntimeService.

func (*RuntimeProxy) Attach

Attach prepares a streaming endpoint to attach to a running container, and returns the address.

func (*RuntimeProxy) ContainerStats added in v0.8.0

func (*RuntimeProxy) ContainerStatus

ContainerStatus returns the container status.

func (*RuntimeProxy) CreateContainer

CreateContainer creates a new container in the specified PodSandbox.

func (*RuntimeProxy) Exec

Exec prepares a streaming endpoint to execute a command in the container, and returns the address.

func (*RuntimeProxy) ExecSync

ExecSync executes a command in the container, and returns the stdout output. If command exits with a non-zero exit code, an error is returned.

func (*RuntimeProxy) ImageFsInfo added in v0.8.0

TODO: merge infos, test

func (*RuntimeProxy) ImageStatus

ImageStatus returns the status of the image.

func (*RuntimeProxy) ListContainerStats added in v0.8.0

func (*RuntimeProxy) ListContainers

ListContainers lists containers by filters.

func (*RuntimeProxy) ListImages

ListImages lists available images.

func (*RuntimeProxy) ListPodSandbox

ListPodSandbox returns a list of PodSandboxes.

func (*RuntimeProxy) PodSandboxStatus

PodSandboxStatus returns the status of a PodSandbox.

func (*RuntimeProxy) PortForward

PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.

func (*RuntimeProxy) PullImage

PullImage pulls an image with authentication config.

func (*RuntimeProxy) RemoveContainer

RemoveContainer removes the container. If the container is running, the container should be forced to removal.

func (*RuntimeProxy) RemoveImage

RemoveImage removes the image.

func (*RuntimeProxy) RemovePodSandbox

RemovePodSandbox removes the sandbox. If there are any containers in the sandbox, they should be forcibly removed.

func (*RuntimeProxy) RunPodSandbox

RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure the sandbox is in ready state.

func (*RuntimeProxy) Serve

func (r *RuntimeProxy) Serve(addr string, readyCh chan struct{}) error

func (*RuntimeProxy) StartContainer

StartContainer starts the container.

func (*RuntimeProxy) Status

Status returns the status of the runtime.

func (*RuntimeProxy) Stop

func (r *RuntimeProxy) Stop()

func (*RuntimeProxy) StopContainer

StopContainer stops a running container with a grace period (i.e., timeout).

func (*RuntimeProxy) StopPodSandbox

StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be forced to termination.

func (*RuntimeProxy) UpdateRuntimeConfig

UpdateRuntimeConfig updates the config of a runtime service. The only update payload currently supported is the pod CIDR assigned to a node, and the runtime service just proxies it down to the network plugin.

func (*RuntimeProxy) Version

Version returns the runtime name, runtime version and runtime API version.

Directories

Path Synopsis
TODO: credits (based on fake_image_service.go from k8s)
TODO: credits (based on fake_image_service.go from k8s)

Jump to

Keyboard shortcuts

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