cluster

package
v0.0.0-...-8bfe3b3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateAction = "create"
	UpdateAction = "update"
	DeleteAction = "delete"

	ProvisionProvisioningAction     = "PROVISION"
	UpgradeProvisioningAction       = "UPGRADE"
	ImportProvisioningAction        = "IMPORT"
	AddComputeProvisioningAction    = "ADD_COMPUTE"
	DeleteComputeProvisioningAction = "DELETE_COMPUTE"
	AddCSNProvisioningAction        = "ADD_CSN"
	AddCVFMProvisioningAction       = "ADD_CVFM"
	DestroyAction                   = "DESTROY"

	AnsibleContainerPrefix = "ansible-player"
)

Ansible related constants.

View Source
const (
	DefaultResource                       = "contrail-cluster"
	DefaultResourcePath                   = "/" + DefaultResource
	DefaultFilePermRWOnly                 = 0600
	DefaultWorkRoot                       = "/var/tmp/contrail_cluster"
	DefaultInstanceTemplate               = "instances.tmpl"
	DefaultInstanceFile                   = "instances.yml"
	DefaultVcenterTemplate                = "vcenter_vars.tmpl"
	DefaultVcenterFile                    = "vcenter_vars.yml"
	MCProvisioner                         = "multi-cloud"
	DefaultDeployer                       = "ansible"
	DefaultAnsibleRepo                    = "contrail-ansible-deployer"
	DefaultAnsibleRepoDir                 = "/usr/share/contrail/"
	DefaultAnsibleRepoInContainer         = "/root/contrail-ansible-deployer"
	DefaultvCenterProvPlay                = "playbooks/vcenter.yml"
	DefaultContrailProvPlay               = "playbooks/install_contrail.yml"
	DefaultContrailDestoryPlay            = "playbooks/contrail_destroy.yml"
	DefaultInstanceProvPlay               = "playbooks/provision_instances.yml"
	DefaultInstanceConfPlay               = "playbooks/configure_instances.yml"
	DefaultOpenstackProvPlay              = "playbooks/install_openstack.yml"
	DefaultOpenstackDestoryPlay           = "playbooks/openstack_destroy.yml"
	DefaultKubernetesProvPlay             = "playbooks/install_k8s.yml"
	DefaultAnsibleDatapathEncryptionRepo  = "contrail-datapath-encryption/ansible"
	DefaultContrailDatapathEncryptionPlay = "playbooks/deploy_and_run_all.yml"
	DefaultInventoryTemplate              = "inventory.tmpl"
	DefaultInventoryFile                  = "inventory.yml"

	// TODO (ijohnson): Fix LP#1756958 and remove the status constants
	StatusField          = "provisioning_state"
	StatusNoState        = "NOSTATE"
	StatusCreated        = "CREATED"
	StatusCreateProgress = "CREATE_IN_PROGRESS"
	StatusCreateFailed   = "CREATE_FAILED"
	StatusUpdated        = "UPDATED"
	StatusUpdateProgress = "UPDATE_IN_PROGRESS"
	StatusUpdateFailed   = "UPDATE_FAILED"
)

TODO:(ijohnson) generate constant resources

View Source
const (
	MCWorkDir = "multi-cloud"

	MCConfigurationPath    = "/etc/multicloud"
	DefaultMCInventoryFile = "inventories/inventory.yml"
	DefaultTopologyFile    = "topology.yml"
	DefaultSecretFile      = "secret.yml"
)

Multicloud related constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppformixConfig

type AppformixConfig struct {
	// AppformixVersion is AppFormix Version in deployment
	AppformixVersion string `yaml:"appformix_version"`
}

AppformixConfig is saved defaults

type Cluster

type Cluster struct {
	APIServer *client.HTTP
	// contains filtered or unexported fields
}

Cluster represents contrail cluster manager

func NewCluster

func NewCluster(c *Config, containerExecutor ContainerExecutor) (*Cluster, error)

NewCluster creates Cluster with given configuration.

func (*Cluster) GetDeployer

func (c *Cluster) GetDeployer() (base.Deployer, error)

GetDeployer creates new deployer based on the type TODO(Daniel): this should not be Cluster's method

type Config

type Config struct {
	// http client of api server
	APIServer *client.HTTP
	// UUID of resource to be managed.
	ClusterID string
	// Action to the performed with the cluster (values: create, update, delete).
	Action string
	// Logging level
	LogLevel string
	// Logging  file
	LogFile string
	// Template root directory
	TemplateRoot string
	// Work root directory
	WorkRoot string
	// Service user name for keystone
	ServiceUserID string
	// Service user password for keystone
	ServiceUserPassword string

	// Optional ansible sudo password
	AnsibleSudoPass string
	// Optional ansible deployer cherry pick url
	AnsibleFetchURL string
	// Optional ansible deployer cherry pick revison(commit id)
	AnsibleCherryPickRevision string
	// Optional ansible deployer revision(commit id)
	AnsibleRevision string
	// Optional Test var to run command in test mode
	Test bool
}

Config represents Command configuration.

type ContainerExecutor

type ContainerExecutor interface {
	StartExecuteAndRemove(ctx context.Context, cp *ansible.ContainerParameters, cmd []string) error
}

ContainerExecutor executes command in container.

type ContrailAnsibleDeployer

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

ContrailAnsibleDeployer is a deployer using CAD.

func (*ContrailAnsibleDeployer) CreateInventory

func (a *ContrailAnsibleDeployer) CreateInventory() error

CreateInventory creates an "instances" file and an "inventory" file.

func (*ContrailAnsibleDeployer) Deploy

func (a *ContrailAnsibleDeployer) Deploy() error

Deploy handles create/update/delete deployment action.

Jump to

Keyboard shortcuts

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