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
- func LoadKubeletConfig(path string) (*cfg.KubeletConfiguration, error)
- func RemoveContainersFromDefaultDockerRuntime(kubeCfg *cfg.KubeletConfiguration) error
- func StartDockerShim(kubeCfg *cfg.KubeletConfiguration) (string, error)
- type Bootstrap
- type BootstrapConfig
- type RuntimeProxy
- func (r *RuntimeProxy) Attach(ctx context.Context, in *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
- func (r *RuntimeProxy) ContainerStatus(ctx context.Context, in *runtimeapi.ContainerStatusRequest) (*runtimeapi.ContainerStatusResponse, error)
- func (r *RuntimeProxy) CreateContainer(ctx context.Context, in *runtimeapi.CreateContainerRequest) (*runtimeapi.CreateContainerResponse, error)
- func (r *RuntimeProxy) Exec(ctx context.Context, in *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
- func (r *RuntimeProxy) ExecSync(ctx context.Context, in *runtimeapi.ExecSyncRequest) (*runtimeapi.ExecSyncResponse, error)
- func (r *RuntimeProxy) ImageStatus(ctx context.Context, in *runtimeapi.ImageStatusRequest) (*runtimeapi.ImageStatusResponse, error)
- func (r *RuntimeProxy) ListContainers(ctx context.Context, in *runtimeapi.ListContainersRequest) (*runtimeapi.ListContainersResponse, error)
- func (r *RuntimeProxy) ListImages(ctx context.Context, in *runtimeapi.ListImagesRequest) (*runtimeapi.ListImagesResponse, error)
- func (r *RuntimeProxy) ListPodSandbox(ctx context.Context, in *runtimeapi.ListPodSandboxRequest) (*runtimeapi.ListPodSandboxResponse, error)
- func (r *RuntimeProxy) PodSandboxStatus(ctx context.Context, in *runtimeapi.PodSandboxStatusRequest) (*runtimeapi.PodSandboxStatusResponse, error)
- func (r *RuntimeProxy) PortForward(ctx context.Context, in *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
- func (r *RuntimeProxy) PullImage(ctx context.Context, in *runtimeapi.PullImageRequest) (*runtimeapi.PullImageResponse, error)
- func (r *RuntimeProxy) RemoveContainer(ctx context.Context, in *runtimeapi.RemoveContainerRequest) (*runtimeapi.RemoveContainerResponse, error)
- func (r *RuntimeProxy) RemoveImage(ctx context.Context, in *runtimeapi.RemoveImageRequest) (*runtimeapi.RemoveImageResponse, error)
- func (r *RuntimeProxy) RemovePodSandbox(ctx context.Context, in *runtimeapi.RemovePodSandboxRequest) (*runtimeapi.RemovePodSandboxResponse, error)
- func (r *RuntimeProxy) RunPodSandbox(ctx context.Context, in *runtimeapi.RunPodSandboxRequest) (*runtimeapi.RunPodSandboxResponse, error)
- func (r *RuntimeProxy) Serve(addr string, readyCh chan struct{}) error
- func (r *RuntimeProxy) StartContainer(ctx context.Context, in *runtimeapi.StartContainerRequest) (*runtimeapi.StartContainerResponse, error)
- func (r *RuntimeProxy) Status(ctx context.Context, in *runtimeapi.StatusRequest) (*runtimeapi.StatusResponse, error)
- func (r *RuntimeProxy) Stop()
- func (r *RuntimeProxy) StopContainer(ctx context.Context, in *runtimeapi.StopContainerRequest) (*runtimeapi.StopContainerResponse, error)
- func (r *RuntimeProxy) StopPodSandbox(ctx context.Context, in *runtimeapi.StopPodSandboxRequest) (*runtimeapi.StopPodSandboxResponse, error)
- func (r *RuntimeProxy) UpdateRuntimeConfig(ctx context.Context, in *runtimeapi.UpdateRuntimeConfigRequest) (*runtimeapi.UpdateRuntimeConfigResponse, error)
- func (r *RuntimeProxy) Version(ctx context.Context, in *runtimeapi.VersionRequest) (*runtimeapi.VersionResponse, error)
Constants ¶
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 ¶
EnsureCRIProxy checks whether kubelet configuration file exists and performs CRI proxy bootstrap procedure if it doesn't.
type BootstrapConfig ¶
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 ¶
func (r *RuntimeProxy) Attach(ctx context.Context, in *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
Attach prepares a streaming endpoint to attach to a running container, and returns the address.
func (*RuntimeProxy) ContainerStatus ¶
func (r *RuntimeProxy) ContainerStatus(ctx context.Context, in *runtimeapi.ContainerStatusRequest) (*runtimeapi.ContainerStatusResponse, error)
ContainerStatus returns the container status.
func (*RuntimeProxy) CreateContainer ¶
func (r *RuntimeProxy) CreateContainer(ctx context.Context, in *runtimeapi.CreateContainerRequest) (*runtimeapi.CreateContainerResponse, error)
CreateContainer creates a new container in the specified PodSandbox.
func (*RuntimeProxy) Exec ¶
func (r *RuntimeProxy) Exec(ctx context.Context, in *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
func (*RuntimeProxy) ExecSync ¶
func (r *RuntimeProxy) ExecSync(ctx context.Context, in *runtimeapi.ExecSyncRequest) (*runtimeapi.ExecSyncResponse, error)
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 ¶
func (r *RuntimeProxy) ImageStatus(ctx context.Context, in *runtimeapi.ImageStatusRequest) (*runtimeapi.ImageStatusResponse, error)
ImageStatus returns the status of the image.
func (*RuntimeProxy) ListContainers ¶
func (r *RuntimeProxy) ListContainers(ctx context.Context, in *runtimeapi.ListContainersRequest) (*runtimeapi.ListContainersResponse, error)
ListContainers lists containers by filters.
func (*RuntimeProxy) ListImages ¶
func (r *RuntimeProxy) ListImages(ctx context.Context, in *runtimeapi.ListImagesRequest) (*runtimeapi.ListImagesResponse, error)
ListImages lists available images.
func (*RuntimeProxy) ListPodSandbox ¶
func (r *RuntimeProxy) ListPodSandbox(ctx context.Context, in *runtimeapi.ListPodSandboxRequest) (*runtimeapi.ListPodSandboxResponse, error)
ListPodSandbox returns a list of PodSandboxes.
func (*RuntimeProxy) PodSandboxStatus ¶
func (r *RuntimeProxy) PodSandboxStatus(ctx context.Context, in *runtimeapi.PodSandboxStatusRequest) (*runtimeapi.PodSandboxStatusResponse, error)
PodSandboxStatus returns the status of a PodSandbox.
func (*RuntimeProxy) PortForward ¶
func (r *RuntimeProxy) PortForward(ctx context.Context, in *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (*RuntimeProxy) PullImage ¶
func (r *RuntimeProxy) PullImage(ctx context.Context, in *runtimeapi.PullImageRequest) (*runtimeapi.PullImageResponse, error)
PullImage pulls an image with authentication config.
func (*RuntimeProxy) RemoveContainer ¶
func (r *RuntimeProxy) RemoveContainer(ctx context.Context, in *runtimeapi.RemoveContainerRequest) (*runtimeapi.RemoveContainerResponse, error)
RemoveContainer removes the container. If the container is running, the container should be forced to removal.
func (*RuntimeProxy) RemoveImage ¶
func (r *RuntimeProxy) RemoveImage(ctx context.Context, in *runtimeapi.RemoveImageRequest) (*runtimeapi.RemoveImageResponse, error)
RemoveImage removes the image.
func (*RuntimeProxy) RemovePodSandbox ¶
func (r *RuntimeProxy) RemovePodSandbox(ctx context.Context, in *runtimeapi.RemovePodSandboxRequest) (*runtimeapi.RemovePodSandboxResponse, error)
RemovePodSandbox removes the sandbox. If there are any containers in the sandbox, they should be forcibly removed.
func (*RuntimeProxy) RunPodSandbox ¶
func (r *RuntimeProxy) RunPodSandbox(ctx context.Context, in *runtimeapi.RunPodSandboxRequest) (*runtimeapi.RunPodSandboxResponse, error)
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 ¶
func (r *RuntimeProxy) StartContainer(ctx context.Context, in *runtimeapi.StartContainerRequest) (*runtimeapi.StartContainerResponse, error)
StartContainer starts the container.
func (*RuntimeProxy) Status ¶
func (r *RuntimeProxy) Status(ctx context.Context, in *runtimeapi.StatusRequest) (*runtimeapi.StatusResponse, error)
Status returns the status of the runtime.
func (*RuntimeProxy) Stop ¶
func (r *RuntimeProxy) Stop()
func (*RuntimeProxy) StopContainer ¶
func (r *RuntimeProxy) StopContainer(ctx context.Context, in *runtimeapi.StopContainerRequest) (*runtimeapi.StopContainerResponse, error)
StopContainer stops a running container with a grace period (i.e., timeout).
func (*RuntimeProxy) StopPodSandbox ¶
func (r *RuntimeProxy) StopPodSandbox(ctx context.Context, in *runtimeapi.StopPodSandboxRequest) (*runtimeapi.StopPodSandboxResponse, error)
StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be forced to termination.
func (*RuntimeProxy) UpdateRuntimeConfig ¶
func (r *RuntimeProxy) UpdateRuntimeConfig(ctx context.Context, in *runtimeapi.UpdateRuntimeConfigRequest) (*runtimeapi.UpdateRuntimeConfigResponse, error)
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 ¶
func (r *RuntimeProxy) Version(ctx context.Context, in *runtimeapi.VersionRequest) (*runtimeapi.VersionResponse, error)
Version returns the runtime name, runtime version and runtime API version.