Documentation
¶
Overview ¶
* Copyright Skyramp Authors 2024
Index ¶
- Variables
- func DialerToPod(conf *rest.Config, clientSet kubernetes.Interface, podName string, ...) (httpstream.Dialer, error)
- 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)
- func (l *K8SLCM) K8sDashboardPortForward(serviceName, namespace, path string) error
- func (l *K8SLCM) NewK8sPortForward(serviceName, namespace string, dstPort int) (*K8sPortForwarder, error)
- type K8sPortForwarder
- type LCMOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DockerEngineAPIVersion = "1.44"
)
Functions ¶
func DialerToPod ¶
func DialerToPod(conf *rest.Config, clientSet kubernetes.Interface, podName string, namespace string) (httpstream.Dialer, error)
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 (*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 ¶
func (*K8SLCM) K8sDashboardPortForward ¶
func (*K8SLCM) NewK8sPortForward ¶
func (l *K8SLCM) NewK8sPortForward(serviceName, namespace string, dstPort int) (*K8sPortForwarder, error)
type K8sPortForwarder ¶
type K8sPortForwarder struct {
LocalPort int32
// contains filtered or unexported fields
}
func NewK8sPortForwarder ¶
func NewK8sPortForwarder(dialer httpstream.Dialer, localPort, dstPort int32) (*K8sPortForwarder, error)
func (*K8sPortForwarder) Done ¶
func (pf *K8sPortForwarder) Done() <-chan struct{}
func (*K8sPortForwarder) Start ¶
func (pf *K8sPortForwarder) Start(readyFunc func(pf *K8sPortForwarder) error) error
func (*K8sPortForwarder) Stop ¶
func (pf *K8sPortForwarder) Stop()
Click to show internal directories.
Click to hide internal directories.