cluster

package
v0.0.0-...-cb886e6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIngressNotFound = errors.New("ingress not found")

Functions

func Deploy

func Deploy(ctx context.Context, client Client, env *ClusterEnv) (err error)

func NewK8sClient

func NewK8sClient() (*k8sClient, error)

Types

type Client

type Client interface {
	CreateNamespace(ctx context.Context, namespace string) error
	DeleteNamespace(ctx context.Context, namespace string) error
	CreateService(ctx context.Context, service *corev1.Service) error
	CreateDeployment(ctx context.Context, deployment *appsv1.Deployment) error
	CreateConfigMap(ctx context.Context, configMap *corev1.ConfigMap) error
	CreateIngress(ctx context.Context, ingress *networkingv1.Ingress) error
	CreateJob(ctx context.Context, job *batchv1.Job) (*batchv1.Job, error)
	CreateSecret(ctx context.Context, secret *corev1.Secret) error
	CreateServiceAccount(ctx context.Context, svcAcc *corev1.ServiceAccount) error
	GetPreviewNamespaces(ctx context.Context) ([]corev1.Namespace, error)
	GetIngress(ctx context.Context, namespace, name string) (*networkingv1.Ingress, error)
	GetIngressUrl(ctx context.Context, namespace string, serviceName string, protocol string) (string, error)
	UpdateIngress(ctx context.Context, ingress *networkingv1.Ingress) error
	GetDeployment(ctx context.Context, namespace string, deploymentName string) (*appsv1.Deployment, error)
	ScaleDeployment(ctx context.Context, namespace string, deploymentName string, replicas int32) error
	WaitJobs(ctx context.Context, jobs []*batchv1.Job) (*WaitJobsResult, error)
	WaitDeployments(ctx context.Context, namespace string) error
	GetJobLogs(ctx context.Context, job *batchv1.Job, size int64) (string, error)
	ListJobs(ctx context.Context, namespace string) ([]*batchv1.Job, error)
	AreServicesAlive(ctx context.Context, namespace string) (bool, error)
	WatchServiceLogs(ctx context.Context, namespace, name string, sinceSeconds int64) (<-chan string, <-chan error, error)
	ApplyKPackBuilds(ctx context.Context, builds []*kpack.Build) error
	WatchResource(ctx context.Context, gvr schema.GroupVersionResource, handler cache.ResourceEventHandlerFuncs) (Starter, error)
	CopySecret(ctx context.Context, fromNS, toNS, name string) (*corev1.Secret, error)
}

type ClusterEnv

type ClusterEnv struct {
	Namespace string
	Objects   []runtime.Object
}

type Starter

type Starter interface {
	Start(stopCh <-chan struct{})
}

type WaitJobsResult

type WaitJobsResult struct {
	Failed    []*batchv1.Job
	Succeeded []*batchv1.Job
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL