Documentation
¶
Index ¶
- func Validate(cfg *APIServerProviderConfiguration) error
- type APIServerProviderConfiguration
- type CommonConfig
- type CompletedAPIServerProviderConfiguration
- type CompletedCommonConfig
- type CompletedGardenerConfiguration
- type CompletedGardenerLandscape
- type CompletedMultiGardenerConfiguration
- type GardenerConfiguration
- type GardenerLandscape
- type GardenerLandscapeWithoutConfig
- type Machine
- type MultiGardenerConfiguration
- type ShootMachineImage
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(cfg *APIServerProviderConfiguration) error
Types ¶
type APIServerProviderConfiguration ¶
type APIServerProviderConfiguration struct { CommonConfig `json:",inline"` // GardenerConfig contains configuration for creating shoot clusters on a Gardener landscape. GardenerConfig *MultiGardenerConfiguration `json:"gardener,omitempty"` }
APIServerProviderConfiguration contains the configuration for the APIServer provider. This is everything which must be configured, should neither be a command-line argument nor be configurable in the ManagedControlPlane resource. For example: Garden cluster kubeconfig and project name for creating Gardener shoots.
func LoadConfig ¶
func LoadConfig(path string) (*APIServerProviderConfiguration, error)
LoadConfig reads the configuration file from a given path and parses it into an APIServerProviderConfiguration object.
func LoadConfigFromBytes ¶
func LoadConfigFromBytes(data []byte) (*APIServerProviderConfiguration, error)
func (*APIServerProviderConfiguration) Complete ¶
func (cfg *APIServerProviderConfiguration) Complete(ctx context.Context) (*CompletedAPIServerProviderConfiguration, error)
Complete transforms the APIServerProviderConfiguration into a CompletedAPIServerProviderConfiguration.
type CommonConfig ¶
type CommonConfig struct { // ServiceAccountNamespace is the namespace on the API Server to be used for serviceaccounts. // Defaults to the cola system namespace (usually 'openmcp-system'). ServiceAccountNamespace *string `json:"serviceAccountNamespace,omitempty"` // AdminServiceAccountName is the name of the serviceaccount used for the admin access. // Defaults to 'admin'. AdminServiceAccountName *string `json:"adminServiceAccountName,omitempty"` }
type CompletedAPIServerProviderConfiguration ¶
type CompletedAPIServerProviderConfiguration struct { *CompletedCommonConfig // ConfiguredTypes contains all types for which configuration was given in the global config. // The APIServerProvider will return an error for an APIServerConfiguration with a type that is not in this set. ConfiguredTypes sets.Set[openmcpv1alpha1.APIServerType] GardenerConfig *CompletedMultiGardenerConfiguration }
CompletedAPIServerProviderConfiguration is a helper struct. It contains the original configuration, enriched with defaults and processed values (e.g. a client constructed from a plaintext kubeconfig).
type CompletedCommonConfig ¶
type CompletedGardenerConfiguration ¶
type CompletedGardenerConfiguration struct { GardenerConfiguration // ProjectNamespace is the namespace belonging to the configured project. ProjectNamespace string // ProviderType is the provider type. It is extracted from the given CloudProfile. ProviderType string // ValidRegions is the set of valid regions. It contains the regions from the given CloudProfile // whose names are listed in the APIServer config. ValidRegions map[string]gardenv1beta1.Region // ValidK8SVersions is the set of valid k8s versions. It is extracted from the given CloudProfile. ValidK8SVersions sets.Set[string] }
type CompletedGardenerLandscape ¶
type CompletedGardenerLandscape struct { // Client for accessing the Gardener landscape. Client client.Client // Kubeconfig contains the kubeconfig the client was constructed from (unless injected for test scenarios). Kubeconfig string // Configurations is a map of Gardener configurations. Configurations map[string]CompletedGardenerConfiguration }
type CompletedMultiGardenerConfiguration ¶
type CompletedMultiGardenerConfiguration struct { // DefaultConfiguration is the name of the default Gardener configuration. DefaultConfiguration string // DefaultLandscape is the name of the default Gardener landscape. DefaultLandscape string // Landscapes is a map of Gardener landscapes. Landscapes map[string]CompletedGardenerLandscape }
func (*CompletedMultiGardenerConfiguration) LandscapeConfiguration ¶
func (ccfg *CompletedMultiGardenerConfiguration) LandscapeConfiguration(data ...string) (*CompletedGardenerLandscape, *CompletedGardenerConfiguration, error)
LandscapeConfiguration returns the Gardener configuration with the given name, or an error if the configuration is unknown. This function can either be called with two separate arguments, or a single combined argument in the format '<landscape-name>/<config-name>'.
In the two-argument case, the first argument is the landscape name and the second argument is the configuration name. An empty landscape or configuration string is interpreted as the respective default value. Note that the default config belongs to the default landscape, so a non-empty landscape string in combination with an empty config string is invalid.
In the single-argument case, the argument is a combined string in the format '<landscape-name>/<config-name>'. A single empty string will be interpreted as default landscape and configuration. Apart from that, neither landscape nor configuration may be empty in this case.
Will default landscape and configuration if called without any arguments.
Any other amount of arguments will result in an error.
type GardenerConfiguration ¶
type GardenerConfiguration struct { // Name is the name of this Gardener configuration. // Only required in multi-config mode. Name string `json:"name,omitempty"` // Project is the Gardener project which should be used to create shoot clusters in it. // The provided kubeconfig must have priviliges for this project. Project string `json:"project,omitempty"` // CloudProfile is the name of the Gardener CloudProfile that should be used for this shoot. CloudProfile string `json:"cloudProfile,omitempty"` // ShootTemplate contains the configuration for shoot clusters with worker nodes. // It is relevant for APIServers for which spec.gardener.enableWorkers is true. ShootTemplate *gardenv1beta1.ShootTemplate `json:"shootTemplate,omitempty"` // Regions contains the supported regions and their zones. Regions []gardenv1beta1.Region `json:"regions,omitempty"` // DefaultRegion is the default region for the workerless shoots. // If not specified, a region must be chosen in the APIServer spec. // If specified, this region will be used if there is none in the APIServer spec. DefaultRegion string `json:"defaultRegion,omitempty"` }
GardenerConfiguration contains configuration for a Gardener.
type GardenerLandscape ¶
type GardenerLandscape struct { GardenerLandscapeWithoutConfig `json:",inline"` // Name is the name of this Gardener landscape. Name string `json:"name,omitempty"` // Configurations is a list of Gardener configurations. Configurations []GardenerConfiguration `json:"configs,omitempty"` }
GardenerLandscape represents a Gardener landscape.
type GardenerLandscapeWithoutConfig ¶
type GardenerLandscapeWithoutConfig struct { // Kubeconfig contains an inline kubeconfig. Kubeconfig string `json:"kubeconfig,omitempty"` // contains filtered or unexported fields }
This type exists only for backward compatibility. It can be merged with GardenerLandscape, if we at one point decide to get rid of the single configuration option.
type Machine ¶
type Machine struct { // Type is the machine type of the worker group. Type string // Image holds information about the machine image to use for all nodes of this pool. It will default to the // latest version of the first image stated in the referenced CloudProfile if no value has been provided. // +optional Image *ShootMachineImage // Architecture is CPU architecture of machines in this worker pool. // +optional Architecture *string }
Machine contains information about the machine type and image.
type MultiGardenerConfiguration ¶
type MultiGardenerConfiguration struct { // GardenerConfiguration accepts a single Gardener configuration. // It is mainly used for backward compatibility. *GardenerConfiguration `json:",inline"` // GardenerLandscapeWithoutConfig takes the fields which have been removed from GardenerConfiguration to preserve backward compatibility. *GardenerLandscapeWithoutConfig `json:",inline"` // DefaultLandscapeAndConfiguration is the name of the default Gardener configuration. // It is expected to follow the format '<landscape-name>/<config-name>'. // Only required in multi-config mode. DefaultLandscapeAndConfiguration string `json:"defaultConfig,omitempty"` // Landscapes is a list of supported Gardener landscapes. // Only required in multi-config mode. Landscapes []GardenerLandscape `json:"landscapes,omitempty"` }
MultiGardenerConfiguration contains configuration for multiple Gardener landscapes.
func (*MultiGardenerConfiguration) InjectGardenClusterClient ¶
func (cfg *MultiGardenerConfiguration) InjectGardenClusterClient(landscape string, fakeClient client.Client)
InjectGardenClusterClient can be used to inject a fake client for testing purposes. It has to be called before calling the 'complete' method. For single config mode, the landscape parameter must be an empty string.
type ShootMachineImage ¶
type ShootMachineImage struct { // Name is the name of the image. Name string // ProviderConfig is the shoot's individual configuration passed to an extension resource. // +optional ProviderConfig *runtime.RawExtension // Version is the version of the shoot's image. // If version is not provided, it will be defaulted to the latest version from the CloudProfile. // +optional Version *string }
ShootMachineImage defines the name and the version of the shoot's machine image in any environment. Has to be defined in the respective CloudProfile.
type Worker ¶
type Worker struct { Name string // Machine contains information about the machine type and image. Machine Machine // Maximum is the maximum number of machines to create. // This value is divided by the number of configured zones for a fair distribution. Maximum int32 // Minimum is the minimum number of machines to create. // This value is divided by the number of configured zones for a fair distribution. Minimum int32 }
Worker is the base definition of a worker group.