Documentation
¶
Index ¶
- func YAMLForComponentSource(ctx context.Context, source ComponentSource) ([]byte, error)
- type ComponentConfig
- type ComponentGenerator
- type ComponentReplacement
- type ComponentSource
- type ComponentSourceType
- type ComponentWaiter
- type ComponentWaiterType
- type ContainerImage
- type Files
- type LoadMetal3CtlConfigInput
- type Metal3CtlConfig
- type ProviderConfig
- type ProviderWaiter
- type ProviderWaiterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func YAMLForComponentSource ¶
func YAMLForComponentSource(ctx context.Context, source ComponentSource) ([]byte, error)
YAMLForComponentSource returns the YAML for the provided component source.
Types ¶
type ComponentConfig ¶
type ComponentConfig struct { // Name is the name of the component. // This field is primarily used for logging. Name string `json:"name"` // Sources is an optional list of component YAML to apply to the management // cluster. // This field may be omitted when wanting only to block progress via one or // more Waiters. Sources []ComponentSource `json:"sources,omitempty"` // Waiters is an optional list of checks to perform in order to determine // whether or not the installed components are ready. Waiters []ComponentWaiter `json:"waiters,omitempty"` }
ComponentConfig describes a required component.
type ComponentGenerator ¶
type ComponentGenerator interface { // GetName returns the name of the component. GetName() string // Manifests return the YAML bundle. Manifests(context.Context) ([]byte, error) }
ComponentGenerator is used to install components, generally any YAML bundle.
func ComponentGeneratorForComponentSource ¶
func ComponentGeneratorForComponentSource(source ComponentSource) ComponentGenerator
ComponentGeneratorForComponentSource returns a ComponentGenerator for the provided ComponentSource.
type ComponentReplacement ¶
type ComponentReplacement struct { // Old is the pattern to replace. // A regular expression may be used. Old string `json:"old"` // New is the string used to replace the old pattern. // An empty string is valid. New string `json:"new,omitempty"` }
ComponentReplacement is used to replace some of the generated YAML prior to application.
type ComponentSource ¶
type ComponentSource struct { // Name is used for logging when a component has multiple sources. Name string `json:"name,omitempty"` // Value is the source of the component's YAML. // May be a URL or a kustomization root (specified by Type). // If a Type=url then Value may begin with file://, http://, or https://. // If a Type=kustomize then Value may be any valid go-getter URL. For // more information please see https://github.com/hashicorp/go-getter#url-format. Value string `json:"value"` // Type describes how to process the source of the component's YAML. // // Defaults to "kustomize". Type ComponentSourceType `json:"type,omitempty"` // Replacements is a list of patterns to replace in the component YAML // prior to application. Replacements []ComponentReplacement `json:"replacements,omitempty"` }
ComponentSource describes how to obtain a component's YAML.
type ComponentSourceType ¶
type ComponentSourceType string
ComponentSourceType indicates how a component's source should be obtained.
const ( // URLSource is component YAML available directly via a URL. // The URL may begin with file://, http://, or https://. URLSource ComponentSourceType = "url" // KustomizeSource is a valid kustomization root that can be used to produce // the component YAML. KustomizeSource ComponentSourceType = "kustomize" )
type ComponentWaiter ¶
type ComponentWaiter struct { // Value varies depending on the specified Type. // Please see the documentation for the different WaiterType constants to // understand the valid values for this field. Value string `json:"value"` // Type describes the type of check to perform. // // Defaults to "pods". Type ComponentWaiterType `json:"type,omitempty"` }
ComponentWaiter contains information to help determine whether installed components are ready.
type ComponentWaiterType ¶
type ComponentWaiterType string
ComponentWaiterType indicates the type of check to use to determine if the installed components are ready.
const ( // ServiceWaiter indicates to wait until a service's condition is Available. // When ComponentWaiter.Value is set to "service", the ComponentWaiter.Value // should be set to the name of a Service resource. ServiceWaiter ComponentWaiterType = "service" // PodsWaiter indicates to wait until all the pods in a namespace have a // condition of Ready. // When ComponentWaiter.Value is set to "pods", the ComponentWaiter.Value // should be set to the name of a Namespace resource. PodsWaiter ComponentWaiterType = "pods" )
type ContainerImage ¶
type ContainerImage struct { // Name is the fully qualified name of the image. Name string }
ContainerImage describes an image to load into a cluster and the behavior when loading the image.
type Files ¶
type Files struct { // SourcePath path of the file. SourcePath string `json:"sourcePath"` // TargetName name of the file copied into the local repository. if empty, the source name // Will be preserved TargetName string `json:"targetName,omitempty"` }
Files contains information about files to be copied into the local repository
type LoadMetal3CtlConfigInput ¶
type LoadMetal3CtlConfigInput struct {
ConfigData []byte
}
LoadMetal3CtlConfig is the input for LoadMetal3CtlConfig.
type Metal3CtlConfig ¶
type Metal3CtlConfig struct { // Name is the name of the management cluster. ManagementClusterName string `json:"managementClusterName,omitempty"` // Path to kubeconfig of the mgmt cluster. Kubeconfig string `json:"kubeconfig,omitempty"` // Path to where all the generated artifacts will be stored. ArtifactsPath string `json:"artifactsPath,omitempty"` // Images is a list of container images to load into the mgmt cluster. Images []ContainerImage `json:"images,omitempty"` // CAPIProviders is a list of cluster-api providers to be configured in the local repository that will then be created on the mgmt cluster. // It is required to provide following providers // - cluster-api // - bootstrap kubeadm // - control-plane kubeadm // - cluster-api-provider--metal3 CAPIProviders []ProviderConfig `json:"capiProviders,omitempty"` // baremetal-operator configuration BMOProvider ProviderConfig `json:"bmoProvider,omitempty"` // Variables to be added to the clusterctl config file // Please not that clusterctl read variables from the os environment variables as well, so you can avoid to hard code // sensitive data in the config file. Variables map[string]string `json:"variables,omitempty"` }
Metal3CtlConfig is the input used to configure a metal3 mgmt cluster.
func LoadMetal3CtlConfig ¶
func LoadMetal3CtlConfig(ctx context.Context, input LoadMetal3CtlConfigInput) (*Metal3CtlConfig, error)
LoadMetal3CtlConfig will load the metal3ctl config.
func (*Metal3CtlConfig) Defaults ¶
func (c *Metal3CtlConfig) Defaults()
Defaults assigns default values to the object.
func (*Metal3CtlConfig) InfraProvider ¶
func (c *Metal3CtlConfig) InfraProvider() string
func (*Metal3CtlConfig) Validate ¶
func (c *Metal3CtlConfig) Validate() error
Validate validates the configuration.
type ProviderConfig ¶
type ProviderConfig struct { // Name is the name of the provider. Name string `json:"name"` // Type is the type of the provider. Type string `json:"type"` // Versions is a list of component YAML to be added to the local repository, one for each release. // Please note that the first source will be used as a default release for this provider. Versions []ComponentSource `json:"versions,omitempty"` // Files is a list of files to be copied into the local repository for the default release of this provider. Files []Files `json:"files,omitempty"` // Waiters is list of waiters to be used to check if the installed provider are ready. Waiters []ProviderWaiter `json:"waiters,omitempty"` }
ProviderConfig describes a provider to be configured in the local repository that will be created.
type ProviderWaiter ¶
type ProviderWaiter struct { // Type describes the type of check to perform. // Defaults to "deployment". Type ProviderWaiterType `json:"type,omitempty"` // Namespace varies depending on the specified Type. // Please see the documentation for the different WaiterType constants to // understand the valid values for this field. Namespace string `json:"namespace,omitempty"` // DefaultNamespace varies depending on the specified Type. // Please see the documentation for the different WaiterType constants to // understand the valid values for this field. DefaultNamespace string `json:"defaultNamespace,omitempty"` // Name varies depending on the specified Type. // Please see the documentation for the different WaiterType constants to // understand the valid values for this field. Name string `json:"name"` }
ProviderWaiter contains information to help determine whether installed provider are ready.
type ProviderWaiterType ¶
type ProviderWaiterType string
ProviderWaiterType indicates the type of check to use to determine if the installed provider are ready.
const ( // ApiServiceWaiter indicates to wait until an apiservice have a // condition of Ready. // When ComponentWaiter.Value is set to "apiservice", the ComponentWaiter.Name // should be set to the name of a api resource resource. ApiServiceWaiter ProviderWaiterType = "apiservice" // DeploymentWaiter indicates to wait until a deployment have a // condition of Ready. // When ComponentWaiter.Value is set to "deployment", the ComponentWaiter.Name // should be set to the name of a deployment resource. // You should use one of ComponentWaiter.Namespace or ComponentWaiter.DefaultNamespace to specify the target // namespace of the deployment; if the target namespace passed to clusterctl init is not empty, it will override // ComponentWaiter.DefaultNamespace. DeploymentWaiter ProviderWaiterType = "deployment" )