clustersetup

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeployClusterAutoscalerActivityName = "deploy-cluster-autoscaler"
	RestoreBackupActivityName           = "restore-backup"
	ErrReasonRestoreFailed              = "BACKUP_RESTORE_FAILED"
)
View Source
const ConfigureNodePoolLabelsActivityName = "configure-nodepool-labels"
View Source
const CreatePipelineNamespaceActivityName = "create-pipeline-namespace"
View Source
const DeployAWSEBSCSIDriverActivityName = "deploy-aws-ebs-csi-driver"
View Source
const DeployIngressControllerActivityName = "deploy-ingress-controller"
View Source
const DeployInstanceTerminationHandlerActivityName = "deploy-instance-termination-handler"
View Source
const HelmInstallActivityName = "cluster-setup-helm-install"
View Source
const InitManifestActivityName = "init-manifest"
View Source
const InstallNodePoolLabelSetOperatorActivityName = "install-nodepool-labelset-operator"
View Source
const LabelKubeSystemNamespaceActivityName = "label-kube-system-namespace"
View Source
const WorkflowName = "cluster-setup"

WorkflowName can be used to reference the cluster setup workflow.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory interface {
	// FromSecret creates a Kubernetes client for a cluster from a secret.
	FromSecret(ctx context.Context, secretID string) (kubernetes.Interface, error)
}

ClientFactory returns a Kubernetes client.

type Cluster

type Cluster struct {
	ID           uint
	UID          string
	Name         string
	Distribution string
	Cloud        string
}

Cluster represents a Kubernetes cluster.

type ConfigureNodePoolLabelsActivity

type ConfigureNodePoolLabelsActivity struct {
	// contains filtered or unexported fields
}

func NewConfigureNodePoolLabelsActivity

func NewConfigureNodePoolLabelsActivity(
	namespace string,
	clientFactory DynamicClientFactory,
) ConfigureNodePoolLabelsActivity

NewConfigureNodePoolLabelsActivity returns a new ConfigureNodePoolLabelsActivity.

func (ConfigureNodePoolLabelsActivity) Execute

type ConfigureNodePoolLabelsActivityInput

type ConfigureNodePoolLabelsActivityInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID string

	Labels map[string]map[string]string
}

type CreatePipelineNamespaceActivity

type CreatePipelineNamespaceActivity struct {
	// contains filtered or unexported fields
}

func NewCreatePipelineNamespaceActivity

func NewCreatePipelineNamespaceActivity(
	namespace string,
	clientFactory ClientFactory,
) CreatePipelineNamespaceActivity

NewCreatePipelineNamespaceActivity returns a new CreatePipelineNamespaceActivity.

func (CreatePipelineNamespaceActivity) Execute

type CreatePipelineNamespaceActivityInput

type CreatePipelineNamespaceActivityInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID string
}

type DeployAWSEBSCSIDriverActivity

type DeployAWSEBSCSIDriverActivity struct {
	// contains filtered or unexported fields
}

func NewDeployAWSEBSCSIDriverActivity

func NewDeployAWSEBSCSIDriverActivity(
	config clusterconfig.LabelConfig,
	helmService HelmService,
) DeployAWSEBSCSIDriverActivity

NewDeployAWSEBSCSIDriverActivity returns a new DeployAWSEBSCSIDriverActivity.

func (DeployAWSEBSCSIDriverActivity) Execute

type DeployAWSEBSCSIDriverActivityInput

type DeployAWSEBSCSIDriverActivityInput struct {
	ClusterID         uint
	KubernetesVersion string
	ChartVersion      string
}

type DeployClusterAutoscalerActivityInput

type DeployClusterAutoscalerActivityInput struct {
	ClusterID uint
}

type DeployIngressControllerActivity

type DeployIngressControllerActivity struct {
	// contains filtered or unexported fields
}

func NewDeployIngressControllerActivity

func NewDeployIngressControllerActivity(
	config clusterconfig.LabelConfig,
	helmService HelmService,
) DeployIngressControllerActivity

NewDeployIngressControllerActivity returns a new DeployIngressControllerActivity.

func (DeployIngressControllerActivity) Execute

type DeployIngressControllerActivityInput

type DeployIngressControllerActivityInput struct {
	ClusterID uint
	OrgID     uint
	Cloud     string
}

type DeployInstanceTerminationHandlerActivity

type DeployInstanceTerminationHandlerActivity struct {
	// contains filtered or unexported fields
}

func NewDeployInstanceTerminationHandlerActivity

func NewDeployInstanceTerminationHandlerActivity(
	config clusterconfig.LabelConfig,
	helmService HelmService,
) DeployInstanceTerminationHandlerActivity

NewDeployInstanceTerminationHandlerActivity returns a new DeployInstanceTerminationHandlerActivity.

func (DeployInstanceTerminationHandlerActivity) Execute

type DeployInstanceTerminationHandlerActivityInput

type DeployInstanceTerminationHandlerActivityInput struct {
	ClusterID   uint
	OrgID       uint
	ClusterName string
	Cloud       string
}

type DynamicClientFactory

type DynamicClientFactory interface {
	// FromSecret creates a Kubernetes client for a cluster from a secret.
	FromSecret(ctx context.Context, secretID string) (dynamic.Interface, error)
}

DynamicClientFactory returns a dynamic Kubernetes client.

type DynamicFileClientFactory

type DynamicFileClientFactory interface {
	// FromSecret creates a DynamicFileClient for a cluster from a secret.
	FromSecret(ctx context.Context, secretID string) (k8s.DynamicFileClient, error)
}

DynamicFileClientFactory returns a DynamicFileClient.

type HelmChartInstallParams

type HelmChartInstallParams struct {
	ReleaseName  string
	ChartName    string
	ChartVersion string
	Values       []byte
}

type HelmInstallActivity

type HelmInstallActivity struct {
	// contains filtered or unexported fields
}

func NewHelmInstallActivity

func NewHelmInstallActivity(helmService HelmService) HelmInstallActivity

NewHelmInstallActivity returns a new HelmInstallActivity.

func (HelmInstallActivity) Execute

type HelmInstallActivityInput

type HelmInstallActivityInput struct {
	ClusterID    uint
	Namespace    string
	ReleaseName  string
	ChartName    string
	ChartVersion string
	Values       []byte
}

type HelmService

type HelmService interface {
	InstallDeployment(
		ctx context.Context,
		clusterID uint,
		namespace string,
		chartName string,
		releaseName string,
		values []byte,
		chartVersion string,
		wait bool,
	) error

	ApplyDeployment(
		ctx context.Context,
		clusterID uint,
		namespace string,
		chartName string,
		releaseName string,
		values []byte,
		chartVersion string,
	) error

	ApplyDeploymentReuseValues(
		ctx context.Context,
		clusterID uint,
		namespace string,
		chartName string,
		releaseName string,
		values []byte,
		chartVersion string,
		reuseValues bool,
	) error
}

type InitManifestActivity

type InitManifestActivity struct {
	// contains filtered or unexported fields
}

func NewInitManifestActivity

func NewInitManifestActivity(
	manifest *template.Template,
	clientFactory DynamicFileClientFactory,
) InitManifestActivity

NewInitManifestActivity returns a new InitManifestActivity.

func (InitManifestActivity) Execute

type InitManifestActivityInput

type InitManifestActivityInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID string

	// Cluster information
	Cluster      Cluster
	Organization Organization
}

type InstallNodePoolLabelSetOperatorActivity

type InstallNodePoolLabelSetOperatorActivity struct {
	// contains filtered or unexported fields
}

func NewInstallNodePoolLabelSetOperatorActivity

func NewInstallNodePoolLabelSetOperatorActivity(
	config clusterconfig.LabelConfig,
	helmService HelmService,
) InstallNodePoolLabelSetOperatorActivity

NewInstallNodePoolLabelSetOperatorActivity returns a new InstallNodePoolLabelSetOperatorActivity.

func (InstallNodePoolLabelSetOperatorActivity) Execute

type InstallNodePoolLabelSetOperatorActivityInput

type InstallNodePoolLabelSetOperatorActivityInput struct {
	ClusterID uint
}

type LabelKubeSystemNamespaceActivity

type LabelKubeSystemNamespaceActivity struct {
	// contains filtered or unexported fields
}

func NewLabelKubeSystemNamespaceActivity

func NewLabelKubeSystemNamespaceActivity(
	clientFactory ClientFactory,
) LabelKubeSystemNamespaceActivity

NewLabelKubeSystemNamespaceActivity returns a new LabelKubeSystemNamespaceActivity.

func (LabelKubeSystemNamespaceActivity) Execute

type LabelKubeSystemNamespaceActivityInput

type LabelKubeSystemNamespaceActivityInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID string
}

type Organization

type Organization struct {
	ID   uint
	Name string
}

Organization contains information about the organization a cluster belongs to.

type RestoreBackupActivityInput

type RestoreBackupActivityInput struct {
	ClusterID           uint
	RestoreBackupParams pkgCluster.RestoreFromBackupParams
}

type Workflow

type Workflow struct {
	// InstallInit
	InstallInitManifest bool

	// Drives installation
	IsIntegratedServicesV2 bool

	// Install additional Pipeline components here
	PipelineNamespace string

	InstallHelmCharts []HelmChartInstallParams
}

Workflow orchestrates the post-creation cluster setup flow.

func (Workflow) Execute

func (w Workflow) Execute(ctx workflow.Context, input WorkflowInput) error

Execute executes the cluster setup workflow.

type WorkflowInput

type WorkflowInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID string

	// Cluster information
	Cluster      Cluster
	Organization Organization

	NodePoolLabels      map[string]map[string]string
	RestoreBackupParams *pkgCluster.RestoreFromBackupParams
}

WorkflowInput is the input for a cluster setup workflow.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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