criproxy

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 38 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 LoadKubeletConfig

func LoadKubeletConfig(path string) (*cfg.KubeletConfiguration, error)

LoadKubeletConfig loads kubelet configuration from a json file

func RemoveContainersFromDefaultDockerRuntime

func RemoveContainersFromDefaultDockerRuntime(kubeCfg *cfg.KubeletConfiguration) error

func StartDockerShim

func StartDockerShim(kubeCfg *cfg.KubeletConfiguration) (string, error)

StartDockerShim starts in-process docker-shim using the specified kubelet configuration

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
	ConfigzBaseUrl  string
	StatsBaseUrl    string
	SavedConfigPath string
	ProxyPath       string
	ProxyArgs       []string
	ProxySocketPath string
}

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) 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) ImageStatus

ImageStatus returns the status of the image.

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