Back to godoc.org

Package clustersetup

v0.0.0 (bd4055e)
Latest Go to latest
Published: 5 days ago | License: Apache-2.0 | Module: github.com/banzaicloud/pipeline

Index

Package Files

Constants

const ConfigureNodePoolLabelsActivityName = "configure-nodepool-labels"
const CreatePipelineNamespaceActivityName = "create-pipeline-namespace"
const InitManifestActivityName = "init-manifest"
const InstallNodePoolLabelSetOperatorActivityName = "install-nodepool-labelset-operator"
const LabelKubeSystemNamespaceActivityName = "label-kube-system-namespace"
const WorkflowName = "cluster-setup"

WorkflowName can be used to reference the cluster setup workflow.

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
}

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

func (a ConfigureNodePoolLabelsActivity) Execute(ctx context.Context, input ConfigureNodePoolLabelsActivityInput) error

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

func (a CreatePipelineNamespaceActivity) Execute(ctx context.Context, input CreatePipelineNamespaceActivityInput) error

type CreatePipelineNamespaceActivityInput

type CreatePipelineNamespaceActivityInput struct {
	// Kubernetes cluster config secret ID.
	ConfigSecretID 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 HelmService

type HelmService interface {
	InstallDeployment(
		ctx context.Context,
		clusterID uint,
		namespace string,
		chartName string,
		releaseName string,
		values []byte,
		chartVersion string,
		wait 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

func (a InitManifestActivity) Execute(ctx context.Context, input InitManifestActivityInput) error

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

func (a InstallNodePoolLabelSetOperatorActivity) Execute(ctx context.Context, input InstallNodePoolLabelSetOperatorActivityInput) error

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

func (a LabelKubeSystemNamespaceActivity) Execute(ctx context.Context, input LabelKubeSystemNamespaceActivityInput) error

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 Workflow

type Workflow struct {
	// InstallInit
	InstallInitManifest bool
}

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
}

WorkflowInput is the input for a cluster setup workflow.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier