Documentation ¶
Overview ¶
* Copyright Skyramp Authors 2024
Index ¶
- Variables
- func InstallHelmChart(namespace, deploymentName string, helmOptions *types.HelmOptions, ...) error
- func IsInDefaultBridgeNetwork(container *dockerTypes.ContainerJSON) bool
- func NewK8sConfig(configPath, context string) (*restclient.Config, error)
- func RemoveSkyrampWorkerInDocker(containerName string) error
- func RunSkyrampWorkerInDockerNetwork(image, tag string, hostPort int, targetNetworkName string) error
- func UninstallHelmChart(namespace, releaseName, kubeconfigPath string) error
- type DockerLCM
- type K8SLCM
- func (l *K8SLCM) ExecCommand(ctx context.Context, namespace, podName, containerName, dir, command string) (string, error)
- func (l *K8SLCM) GetClientSet() *kubernetes.Clientset
- func (l *K8SLCM) GetDeployments(deployments []string) ([]*apiAppsv1.Deployment, error)
- func (l *K8SLCM) GetPodName(deploymentName string) (string, error)
- func (l *K8SLCM) GetWorkerPodName() (string, error)
- type LCMOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DockerEngineAPIVersion = "1.44"
)
Functions ¶
func InstallHelmChart ¶
func IsInDefaultBridgeNetwork ¶
func IsInDefaultBridgeNetwork(container *dockerTypes.ContainerJSON) bool
func NewK8sConfig ¶
func NewK8sConfig(configPath, context string) (*restclient.Config, error)
func RemoveSkyrampWorkerInDocker ¶
Helper method that will bring down skyramp worker in a docker network
func RunSkyrampWorkerInDockerNetwork ¶
func RunSkyrampWorkerInDockerNetwork(image, tag string, hostPort int, targetNetworkName string) error
Helper method that will bring up skyramp worker in a docker network
func UninstallHelmChart ¶
Types ¶
type DockerLCM ¶
type DockerLCM struct { // docker container object Container *dockerTypes.ContainerJSON // docker network ID that the work is in NetworkID string // docker network name NetworkName string // contains filtered or unexported fields }
func NewDockerLCM ¶
generic docker LCM to communicate with docker API
func (*DockerLCM) FindContainerByBoundAddress ¶
func (d *DockerLCM) FindContainerByBoundAddress(address string) (*dockerTypes.ContainerJSON, error)
find container in docker using address and IP there could be some edges cases that this does not properly handle
func (*DockerLCM) FindNetworkByName ¶
func (d *DockerLCM) FindNetworkByName(networkName string) (*dockerTypes.NetworkResource, error)
func (*DockerLCM) RestartWithNewPorts ¶
func (d *DockerLCM) RestartWithNewPorts(container *dockerTypes.ContainerJSON, ports []int) error
exposing new ports requires recreating container this applies to standalone container, that does not belong to docker network
type K8SLCM ¶
type K8SLCM struct { Namespace string // Namespace to deploy LabelSelector string // labels for filter // Results for cache Deployments []*apiAppsv1.Deployment Services []*apiCorev1.Service ConfigMaps []*apiCorev1.ConfigMap // contains filtered or unexported fields }
func (*K8SLCM) ExecCommand ¶
func (l *K8SLCM) ExecCommand(ctx context.Context, namespace, podName, containerName, dir, command string) (string, error)
exec sh command over k8s api
func (*K8SLCM) GetClientSet ¶
func (l *K8SLCM) GetClientSet() *kubernetes.Clientset
func (*K8SLCM) GetDeployments ¶
func (l *K8SLCM) GetDeployments(deployments []string) ([]*apiAppsv1.Deployment, error)
func (*K8SLCM) GetWorkerPodName ¶
Click to show internal directories.
Click to hide internal directories.