podcfg

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

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishControllerPodConfig

func FinishControllerPodConfig(pcfg *ControllerPodConfig, cfg *config.Config) (err error)

FinishControllerPodConfig sets fields on a ControllerPodConfig that can be determined by inspecting a plain config.Config and the pod constraints at the last moment before creating podspec. It assumes that the supplied Config comes from an environment that has passed through all the validation checks in the Bootstrap func, and that has set an agent-version (via finding the tools to, use for bootstrap, or otherwise).

func PodLabels

func PodLabels(modelUUID, controllerUUID string, tagger tags.ResourceTagger, jobs []multiwatcher.MachineJob) map[string]string

PodLabels returns the minimum set of tags that should be set on a pod, if the provider supports them.

func PopulateControllerPodConfig

func PopulateControllerPodConfig(pcfg *ControllerPodConfig, providerType string) error

PopulateControllerPodConfig is called both from the FinishControllerPodConfig below, which does have access to the environment config, and from the container provisioners, which don't have access to the environment config. Everything that is needed to provision a container needs to be returned to the provisioner in the ContainerConfig structure. Those values are then used to call this function.

Types

type BootstrapConfig

type BootstrapConfig struct {
	instancecfg.BootstrapConfig
}

BootstrapConfig represents bootstrap-specific initialization information for a new juju caas pod. This is only relevant for the bootstrap pod.

func (*BootstrapConfig) VerifyConfig

func (cfg *BootstrapConfig) VerifyConfig() (err error)

VerifyConfig verifies that the BootstrapConfig is valid.

type ControllerConfig

type ControllerConfig struct {
	instancecfg.ControllerConfig
}

ControllerConfig represents controller-specific initialization information for a new juju caas pod. This is only relevant for controller pod.

func (*ControllerConfig) VerifyConfig

func (cfg *ControllerConfig) VerifyConfig() error

VerifyConfig verifies that the ControllerConfig is valid.

type ControllerPodConfig

type ControllerPodConfig struct {
	// Tags is a set of tags/labels to set on the Pod, if supported. This
	// should be populated using the PodLabels method in this package.
	Tags map[string]string

	// Bootstrap contains bootstrap-specific configuration. If this is set,
	// Controller must also be set.
	Bootstrap *BootstrapConfig

	// Controller contains controller-specific configuration. If this is
	// set, then the instance will be configured as a controller pod.
	Controller *ControllerConfig

	// APIInfo holds the means for the new pod to communicate with the
	// juju state API. Unless the new pod is running a controller (Controller is
	// set), there must be at least one controller address supplied.
	// The entity name must match that of the pod being started,
	// or be empty when starting a controller.
	APIInfo *api.Info

	// ControllerTag identifies the controller.
	ControllerTag names.ControllerTag

	// JujuVersion is the juju version.
	JujuVersion version.Number

	// DataDir holds the directory that juju state will be put in the new
	// instance.
	DataDir string

	// LogDir holds the directory that juju logs will be written to.
	LogDir string

	// MetricsSpoolDir represents the spool directory path, where all
	// metrics are stored.
	MetricsSpoolDir string

	// Jobs holds what machine jobs to run.
	Jobs []multiwatcher.MachineJob

	// MachineId identifies the new machine.
	MachineId string // TODO(caas): change it to PodId once we introduced the new tag for pod.

	// AgentEnvironment defines additional configuration variables to set in
	// the pod agent config.
	AgentEnvironment map[string]string
}

ControllerPodConfig represents initialization information for a new juju caas controller pod.

func NewBootstrapControllerPodConfig

func NewBootstrapControllerPodConfig(config controller.Config, series string) (*ControllerPodConfig, error)

NewBootstrapControllerPodConfig sets up a basic pod configuration for a bootstrap pod. You'll still need to supply more information, but this takes care of the fixed entries and the ones that are always needed.

func NewControllerPodConfig

func NewControllerPodConfig(
	controllerTag names.ControllerTag,
	machineID, series string,
	apiInfo *api.Info,
) (*ControllerPodConfig, error)

NewControllerPodConfig sets up a basic pod configuration. You'll still need to supply more information, but this takes care of the fixed entries and the ones that are always needed.

func (*ControllerPodConfig) APIHostAddrs

func (cfg *ControllerPodConfig) APIHostAddrs() []string

APIHostAddrs returns a list of api server addresses.

func (*ControllerPodConfig) APIHosts

func (cfg *ControllerPodConfig) APIHosts() []string

APIHosts returns api a list of server addresses.

func (*ControllerPodConfig) AgentConfig

func (cfg *ControllerPodConfig) AgentConfig(tag names.Tag) (agent.ConfigSetterWriter, error)

AgentConfig returns an agent config.

func (*ControllerPodConfig) VerifyConfig

func (cfg *ControllerPodConfig) VerifyConfig() (err error)

VerifyConfig verifies that the ControllerPodConfig is valid.

Jump to

Keyboard shortcuts

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