Documentation ¶
Index ¶
- func GetContainerId(name string) (string, error)
- func NewContainerClient() (*client.Client, error)
- func NewProvider() *cluster.Provider
- type BadContainerNameError
- type BadImageBuildError
- type BadPodNameError
- type ChartMap
- type ClusterRegistry
- type ClusterStatus
- type Container
- type ContainerOption
- func WithClient(cli *client.Client) ContainerOption
- func WithContainerName(name string) ContainerOption
- func WithImage(image string) ContainerOption
- func WithNetwork(network string) ContainerOption
- func WithPort(imagePort string, hostPort string) ContainerOption
- func WithTag(tag string) ContainerOption
- type ErrorDetail
- type ErrorLine
- type ExceededMaxAttemptError
- type ExistingKubeClusterError
- type ExistingKubeConfigError
- type FailedJobError
- type HelmChart
- type HelmChartManager
- type HelmResourcer
- type ImageRegister
- type KindConfig
- type KubeCluster
- type KubeClusterOption
- func ShouldStartOnCreation(start bool) KubeClusterOption
- func WithControlNodes(count int) KubeClusterOption
- func WithHelmCharts(charts ...*HelmChart) KubeClusterOption
- func WithImages(images ...string) KubeClusterOption
- func WithKubeClient(kubeclient *kubernetes.Clientset) KubeClusterOption
- func WithKubeConfigPath(path string) KubeClusterOption
- func WithMaxAttempts(attempts int) KubeClusterOption
- func WithName(name string) KubeClusterOption
- func WithNamespaces(namespaces ...string) KubeClusterOption
- func WithNodePorts(ports ...*NodePort) KubeClusterOption
- func WithRegistry(registry *ClusterRegistry, port int) KubeClusterOption
- func WithWorkerNodes(count int) KubeClusterOption
- type KubeResourceManager
- func (manager *KubeResourceManager) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
- func (manager *KubeResourceManager) CreateNamespace(ctx context.Context, name string) error
- func (manager *KubeResourceManager) DeleteDeployment(ctx context.Context, namespace string, name string) error
- func (manager *KubeResourceManager) RunJob(ctx context.Context, namespace string, jobSpec *batchv1.Job, ...) error
- type KubeResourcer
- type MissingFieldError
- type NodePort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainerId ¶
func NewContainerClient ¶
func NewProvider ¶
Types ¶
type BadContainerNameError ¶
type BadContainerNameError struct {
// contains filtered or unexported fields
}
func (*BadContainerNameError) Error ¶
func (err *BadContainerNameError) Error() string
type BadImageBuildError ¶
type BadImageBuildError struct {
// contains filtered or unexported fields
}
func (*BadImageBuildError) Error ¶
func (err *BadImageBuildError) Error() string
type BadPodNameError ¶
type BadPodNameError struct {
// contains filtered or unexported fields
}
func (*BadPodNameError) Error ¶
func (err *BadPodNameError) Error() string
type ClusterStatus ¶
type ClusterStatus int
const ( Alive ClusterStatus = iota Dead )
func (ClusterStatus) String ¶
func (status ClusterStatus) String() string
type Container ¶
type Container struct { Client *client.Client Id string Name string Image string Tag string Networks []string Ports map[string]string }
func NewContainer ¶
func NewContainer(ctx context.Context, options ...ContainerOption) (*Container, error)
type ContainerOption ¶
type ContainerOption func(c *Container)
func WithClient ¶
func WithClient(cli *client.Client) ContainerOption
func WithContainerName ¶
func WithContainerName(name string) ContainerOption
func WithImage ¶
func WithImage(image string) ContainerOption
func WithNetwork ¶
func WithNetwork(network string) ContainerOption
func WithPort ¶
func WithPort(imagePort string, hostPort string) ContainerOption
func WithTag ¶
func WithTag(tag string) ContainerOption
type ErrorDetail ¶
type ErrorDetail struct {
Message string `json:"message"`
}
type ErrorLine ¶
type ErrorLine struct { Error string `json:"error"` ErrorDetail ErrorDetail `json:"errorDetail"` }
type ExceededMaxAttemptError ¶
type ExceededMaxAttemptError struct {
// contains filtered or unexported fields
}
func (*ExceededMaxAttemptError) Error ¶
func (err *ExceededMaxAttemptError) Error() string
type ExistingKubeClusterError ¶
type ExistingKubeClusterError struct {
// contains filtered or unexported fields
}
func (*ExistingKubeClusterError) Error ¶
func (err *ExistingKubeClusterError) Error() string
type ExistingKubeConfigError ¶
type ExistingKubeConfigError struct {
// contains filtered or unexported fields
}
func (*ExistingKubeConfigError) Error ¶
func (err *ExistingKubeConfigError) Error() string
type FailedJobError ¶
type FailedJobError struct {
// contains filtered or unexported fields
}
func (*FailedJobError) Error ¶
func (err *FailedJobError) Error() string
type HelmChartManager ¶
func NewHelmChartManager ¶
func NewHelmChartManager(path string) (*HelmChartManager, error)
func (*HelmChartManager) InstallChart ¶
func (hcm *HelmChartManager) InstallChart(name string, namespace string, path string) error
type ImageRegister ¶
type KindConfig ¶
type KindConfig struct { Name string ControlPlaneNodes int WorkerNodes int NodePorts []*NodePort RegistryAddress string RegistryPort string }
func NewKindConfig ¶
func (*KindConfig) String ¶
func (config *KindConfig) String() string
type KubeCluster ¶
type KubeCluster struct { Provider *cluster.Provider Name string KubeConfigPath string WorkerCount int ControlCount int KindConfig *KindConfig MaxStartAttempts int Status ClusterStatus RegistryName string KubeClient *kubernetes.Clientset RegistryPort int NodePorts []*NodePort Namespaces []string Charts []*HelmChart Images []string KubeResourcer HelmResourcer ImageRegister }
func NewKubeCluster ¶
func NewKubeCluster(options ...KubeClusterOption) (*KubeCluster, error)
func (*KubeCluster) Delete ¶
func (kc *KubeCluster) Delete() error
func (*KubeCluster) Start ¶
func (kc *KubeCluster) Start() error
create creates the kind cluster. It will retry up to maxAttempts times
type KubeClusterOption ¶
type KubeClusterOption func(kc *KubeCluster)
func ShouldStartOnCreation ¶
func ShouldStartOnCreation(start bool) KubeClusterOption
func WithControlNodes ¶
func WithControlNodes(count int) KubeClusterOption
func WithHelmCharts ¶
func WithHelmCharts(charts ...*HelmChart) KubeClusterOption
func WithImages ¶
func WithImages(images ...string) KubeClusterOption
func WithKubeClient ¶
func WithKubeClient(kubeclient *kubernetes.Clientset) KubeClusterOption
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeClusterOption
func WithMaxAttempts ¶
func WithMaxAttempts(attempts int) KubeClusterOption
func WithName ¶
func WithName(name string) KubeClusterOption
func WithNamespaces ¶
func WithNamespaces(namespaces ...string) KubeClusterOption
func WithNodePorts ¶
func WithNodePorts(ports ...*NodePort) KubeClusterOption
func WithRegistry ¶
func WithRegistry(registry *ClusterRegistry, port int) KubeClusterOption
func WithWorkerNodes ¶
func WithWorkerNodes(count int) KubeClusterOption
type KubeResourceManager ¶
type KubeResourceManager struct {
Client kubernetes.Clientset
}
func NewKubeResourceManager ¶
func NewKubeResourceManager(kubePath string) (*KubeResourceManager, error)
func (*KubeResourceManager) CreateDeployment ¶
func (manager *KubeResourceManager) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
func (*KubeResourceManager) CreateNamespace ¶
func (manager *KubeResourceManager) CreateNamespace(ctx context.Context, name string) error
func (*KubeResourceManager) DeleteDeployment ¶
type KubeResourcer ¶
type MissingFieldError ¶
type MissingFieldError struct {
// contains filtered or unexported fields
}
func (*MissingFieldError) Error ¶
func (err *MissingFieldError) Error() string
Click to show internal directories.
Click to hide internal directories.