juju: github.com/juju/juju/cloudconfig/podcfg Index | Files

package podcfg

import "github.com/juju/juju/cloudconfig/podcfg"

Index

Package Files

image.go podcfg.go

func FinishControllerPodConfig Uses

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 GetJujuOCIImagePath Uses

func GetJujuOCIImagePath(controllerCfg controller.Config, ver version.Number) string

GetJujuOCIImagePath returns the jujud oci image path.

func IsJujuOCIImage Uses

func IsJujuOCIImage(imagePath string) bool

IsJujuOCIImage returns true if the image path is for a Juju operator.

func PodLabels Uses

func PodLabels(modelUUID, controllerUUID string, tagger tags.ResourceTagger, jobs []model.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 Uses

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.

func RebuildOldOperatorImagePath Uses

func RebuildOldOperatorImagePath(imagePath string, ver version.Number) string

RebuildOldOperatorImagePath returns a updated image path for the specified juju version.

type BootstrapConfig Uses

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 Uses

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

VerifyConfig verifies that the BootstrapConfig is valid.

type ControllerConfig Uses

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 Uses

func (cfg *ControllerConfig) VerifyConfig() error

VerifyConfig verifies that the ControllerConfig is valid.

type ControllerPodConfig Uses

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

    // ControllerName is the controller name.
    ControllerName string

    // 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

    // ControllerId identifies the new controller.
    ControllerId string

    // 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 Uses

func NewBootstrapControllerPodConfig(
    config controller.Config,
    controllerName,
    series string,
    bootstrapConstraints constraints.Value,
) (*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 Uses

func NewControllerPodConfig(
    controllerTag names.ControllerTag,
    podID,
    controllerName,
    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 Uses

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

APIHostAddrs returns a list of api server addresses.

func (*ControllerPodConfig) AgentConfig Uses

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

AgentConfig returns an agent config.

func (*ControllerPodConfig) GetControllerImagePath Uses

func (cfg *ControllerPodConfig) GetControllerImagePath() string

GetControllerImagePath returns oci image path of jujud for a controller.

func (*ControllerPodConfig) GetHostedModel Uses

func (cfg *ControllerPodConfig) GetHostedModel() (string, bool)

GetHostedModel checks if hosted model was requested to create.

func (*ControllerPodConfig) GetJujuDbOCIImagePath Uses

func (cfg *ControllerPodConfig) GetJujuDbOCIImagePath() string

GetJujuDbOCIImagePath returns the juju-db oci image path.

func (*ControllerPodConfig) GetPodName Uses

func (cfg *ControllerPodConfig) GetPodName() string

GetPodName returns pod name.

func (*ControllerPodConfig) VerifyConfig Uses

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

VerifyConfig verifies that the ControllerPodConfig is valid.

Package podcfg imports 19 packages (graph) and is imported by 10 packages. Updated 2019-11-12. Refresh now. Tools for package owners.