powervs

package
v1.5.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 14 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package powervs contains Power VS-specific structures for installer configuration and management. +k8s:deepcopy-gen=package

Index

Constants

View Source
const Name string = "powervs"

Name is name for the Power VS platform.

Variables

View Source
var Regions = map[string]Region{
	"dal": {
		Description: "Dallas, USA",
		VPCRegion:   "us-south",
		COSRegion:   "us-south",
		Zones: map[string]Zone{
			"dal10": {
				SysTypes: []string{"s922", "s1022", "e980", "e1080"},
			},
			"dal12": {
				SysTypes: []string{"s922", "e980"},
			},
			"dal14": {
				SysTypes: []string{"s1022", "e1080", "s1122"},
			},
		},
		VPCZones: []string{"us-south-1", "us-south-2", "us-south-3"},
	},
	"eu-de": {
		Description: "Frankfurt, Germany",
		VPCRegion:   "eu-de",
		COSRegion:   "eu-de",
		Zones: map[string]Zone{
			"eu-de-1": {
				SysTypes: []string{"s922", "s1022", "e980"},
			},
			"eu-de-2": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"eu-de-1", "eu-de-2", "eu-de-3"},
	},
	"lon": {
		Description: "London, UK",
		VPCRegion:   "eu-gb",
		COSRegion:   "eu-gb",
		Zones: map[string]Zone{
			"lon06": {
				SysTypes: []string{"s922", "e980"},
			},
			"lon04": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"eu-gb-1", "eu-gb-2", "eu-gb-3"},
	},
	"mad": {
		Description: "Madrid, Spain",
		VPCRegion:   "eu-es",
		COSRegion:   "eu-de",
		Zones: map[string]Zone{
			"mad02": {
				SysTypes: []string{"s922", "s1022", "e980"},
			},
			"mad04": {
				SysTypes: []string{"s1022", "e980", "e1080"},
			},
		},
		VPCZones: []string{"eu-es-1", "eu-es-2"},
	},
	"osa": {
		Description: "Osaka, Japan",
		VPCRegion:   "jp-osa",
		COSRegion:   "jp-osa",
		Zones: map[string]Zone{
			"osa21": {
				SysTypes: []string{"s922", "s1022", "e980"},
			},
		},
		VPCZones: []string{"jp-osa-1", "jp-osa-2", "jp-osa-3"},
	},
	"sao": {
		Description: "São Paulo, Brazil",
		VPCRegion:   "br-sao",
		COSRegion:   "br-sao",
		Zones: map[string]Zone{
			"sao01": {
				SysTypes: []string{"s922", "e980"},
			},
			"sao04": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"br-sao-1", "br-sao-2", "br-sao-3"},
	},
	"syd": {
		Description: "Sydney, Australia",
		VPCRegion:   "au-syd",
		COSRegion:   "au-syd",
		Zones: map[string]Zone{
			"syd04": {
				SysTypes: []string{"s922", "e980"},
			},
			"syd05": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"au-syd-1", "au-syd-2", "au-syd-3"},
	},
	"tor": {
		Description: "Toronto, Canada",
		VPCRegion:   "ca-tor",
		COSRegion:   "ca-tor",
		Zones: map[string]Zone{
			"tor01": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"ca-tor-1", "ca-tor-2", "ca-tor-3"},
	},
	"us-east": {
		Description: "Washington DC, USA",
		VPCRegion:   "us-east",
		COSRegion:   "us-east",
		Zones: map[string]Zone{
			"us-east": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"us-east-1", "us-east-2", "us-east-3"},
	},
	"us-south": {
		Description: "Dallas, USA",
		VPCRegion:   "us-south",
		COSRegion:   "us-south",
		Zones: map[string]Zone{
			"us-south": {
				SysTypes: []string{"s922", "e980"},
			},
		},
		VPCZones: []string{"us-south-1", "us-south-2", "us-south-3"},
	},
	"wdc": {
		Description: "Washington DC, USA",
		VPCRegion:   "us-east",
		COSRegion:   "us-east",
		Zones: map[string]Zone{
			"wdc06": {
				SysTypes: []string{"s922", "e980"},
			},
			"wdc07": {
				SysTypes: []string{"s922", "s1022", "e980", "e1080"},
			},
		},
		VPCZones: []string{"us-east-1", "us-east-2", "us-east-3"},
	},
}

Regions holds the regions for IBM Power VS, and descriptions used during the survey.

Functions

func AllKnownSysTypes

func AllKnownSysTypes() sets.Set[string]

AllKnownSysTypes returns aggregated known system types from all regions.

func AvailableSysTypes

func AvailableSysTypes(region string, zone string) ([]string, error)

AvailableSysTypes returns the default system type for the zone.

func AvailableVPCZones added in v0.90.0

func AvailableVPCZones(region string) ([]string, error)

AvailableVPCZones returns the known VPC zones for a specified region.

func COSRegionForPowerVSRegion added in v0.9.153

func COSRegionForPowerVSRegion(region string) (string, error)

COSRegionForPowerVSRegion returns the IBM COS region for the specified PowerVS region.

func COSRegionForVPCRegion added in v0.9.153

func COSRegionForVPCRegion(vpcRegion string) (string, error)

COSRegionForVPCRegion returns the corresponding COS region for the given VPC region.

func EndpointURLForService

func EndpointURLForService(name string, endpoints []configv1.PowerVSServiceEndpoint) string

EndpointURLForService returns the URL override for a named IBM Cloud service from the ServiceEndpoints slice, or an empty string if no override is set. When the SDK receives an empty string URL it uses its own built-in default.

func ParseOSImageURL

func ParseOSImageURL(rawURL string) (bucket, object, region string, err error)

ParseOSImageURL splits an IBM Cloud Object Storage image URL of the form https://s3.<region>.cloud-object-storage.appdomain.cloud/<bucket>/<object> into its bucket, object and region components.

func RegionFromZone

func RegionFromZone(zone string) string

RegionFromZone returns the region name for a given zone name.

func RegionShortNames

func RegionShortNames() []string

RegionShortNames returns the list of region names

func VPCRegionForPowerVSRegion

func VPCRegionForPowerVSRegion(region string) (string, error)

VPCRegionForPowerVSRegion returns the VPC region for the specified PowerVS region.

func VPCZoneForPowerVSZone

func VPCZoneForPowerVSZone(zone string) (string, error)

VPCZoneForPowerVSZone returns the first VPC zone for the VPC region that corresponds to the given PowerVS zone. This is used when the installer needs a single VPC zone to attach a Public Gateway or Routing Table to, and the user has not specified one explicitly.

For example, PowerVS zone "dal12" → PowerVS region "dal" → VPC region "us-south" → first VPC zone "us-south-1".

func VPCZonesForVPCRegion

func VPCZonesForVPCRegion(vpcRegion string) ([]string, error)

VPCZonesForVPCRegion returns the known VPC zones for the specified VPC region. Unlike AvailableVPCZones this is keyed by the VPC region itself, so it stays correct when the user overrides platform.powervs.vpcRegion with a region other than the one derived from the PowerVS region.

func ValidateCOSRegion added in v0.9.153

func ValidateCOSRegion(region string) bool

ValidateCOSRegion validates that given COS region is known/tested.

func ValidateVPCRegion

func ValidateVPCRegion(region string) bool

ValidateVPCRegion validates that given VPC region is known/tested.

func ValidateZone

func ValidateZone(zone string) bool

ValidateZone validates that the given zone is known/tested.

func ZoneNames

func ZoneNames() []string

ZoneNames returns the list of zone names.

Types

type MachinePool

type MachinePool struct {
	// VolumeIDs is the list of volumes attached to the instance.
	//
	// +optional
	VolumeIDs []string `json:"volumeIDs,omitempty"`

	// memoryGiB is the size of a virtual machine's memory, in GiB.
	//
	// +optional
	MemoryGiB int32 `json:"memoryGiB,omitempty"`

	// Processors defines the processing units for the instance.
	//
	// +optional
	Processors intstr.IntOrString `json:"processors,omitempty"`

	// ProcType defines the processor sharing model for the instance.
	// Must be one of {Capped, Dedicated, Shared}.
	//
	// +kubebuilder:validation:Enum:="Dedicated";"Shared";"Capped";""
	// +optional
	ProcType machinev1.PowerVSProcessorType `json:"procType,omitempty"`

	// SMTLevel specifies the level of SMT to set the control plane and worker nodes to.
	//
	// +optional
	SMTLevel string `json:"smtLevel,omitempty"`

	// SysType defines the system type for instance.
	//
	// +optional
	SysType string `json:"sysType,omitempty"`
}

MachinePool stores the configuration for a machine pool installed on IBM Power VS.

func (*MachinePool) DeepCopy

func (in *MachinePool) DeepCopy() *MachinePool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool.

func (*MachinePool) DeepCopyInto

func (in *MachinePool) DeepCopyInto(out *MachinePool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MachinePool) Set

func (a *MachinePool) Set(required *MachinePool)

Set stores values from required into a

type Metadata

type Metadata struct {
	BaseDomain           string                            `json:"BaseDomain"`
	CISInstanceCRN       string                            `json:"cisInstanceCRN"`
	COSInstanceCRN       string                            `json:"cosInstanceCRN,omitempty"`
	DNSInstanceCRN       string                            `json:"dnsInstanceCRN"`
	PowerVSResourceGroup string                            `json:"powerVSResourceGroup"`
	Region               string                            `json:"region"`
	VPCRegion            string                            `json:"vpcRegion"`
	Zone                 string                            `json:"zone"`
	ServiceInstanceGUID  string                            `json:"serviceInstanceGUID"`
	ServiceEndpoints     []configv1.PowerVSServiceEndpoint `json:"serviceEndpoints,omitempty"`
	TransitGateway       string                            `json:"transitGatewayName"`
	VPC                  string                            `json:"vpcName"`
}

Metadata contains Power VS metadata (e.g. for uninstalling the cluster).

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkType

type NetworkType string

NetworkType defines which PowerVS network provisioning strategy to use. +kubebuilder:validation:Enum=DHCPSubnet;DHCPServer

const (
	// NetworkTypeDHCPSubnet creates a plain PowerVS network with DHCP natively enabled
	// (NetworkCreate.EnableDHCP). No separate DHCP server VM is created.
	// This is the default and recommended mode for new clusters.
	NetworkTypeDHCPSubnet NetworkType = "DHCPSubnet"

	// NetworkTypeDHCPServer creates a dedicated PowerVS DHCP Service resource (a managed VM)
	// and its associated private network. This is the legacy mode used by clusters created
	// before OPENSHIFTP-855.
	// When this mode is selected the route-mode NLB, VPC Routing Table, and Public Gateway
	// are NOT provisioned, because the DHCP Server handles its own SNAT/egress.
	NetworkTypeDHCPServer NetworkType = "DHCPServer"
)

type Platform

type Platform struct {

	// PowerVSResourceGroup is the resource group in which Power VS resources will be created.
	PowerVSResourceGroup string `json:"powervsResourceGroup"`

	// Region specifies the IBM Cloud colo region where the cluster will be created.
	Region string `json:"region,omitempty"`

	// Zone specifies the IBM Cloud colo region where the cluster will be created.
	// At this time, only single-zone clusters are supported.
	Zone string `json:"zone"`

	// VPCRegion specifies the IBM Cloud region in which to create VPC resources.
	// Leave unset to allow installer to select the closest VPC region.
	//
	// +optional
	VPCRegion string `json:"vpcRegion,omitempty"`

	// UserID is the login for the user's IBM Cloud account.
	UserID string `json:"userID"`

	// vpcName is the name or id of a pre-created VPC inside IBM Cloud.
	//
	// +optional
	VPC string `json:"vpcName,omitempty"`

	// VPCSubnets specifies existing subnets (by ID) where cluster
	// resources will be created.  Leave unset to have the installer
	// create subnets in a new VPC on your behalf.
	//
	// +optional
	VPCSubnets []string `json:"vpcSubnets,omitempty"`

	// ClusterOSImage is a pre-created Power VS boot image that overrides the
	// default image for cluster nodes.
	//
	// +optional
	ClusterOSImage string `json:"clusterOSImage,omitempty"`

	// DefaultMachinePlatform is the default configuration used when
	// installing on Power VS for machine pools which do not define their own
	// platform configuration.
	//
	// +optional
	DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"`

	// OSImage is the IBM Cloud Object Storage URL of a Power VS image to import into the
	// Power VS Workspace and use for cluster nodes, of the form
	// https://s3.<region>.cloud-object-storage.appdomain.cloud/<bucket>/<object>.
	// When unset, the stock catalog image matching osImageStream is used.
	//
	// +optional
	OSImage string `json:"osImage,omitempty"`

	// ServiceInstanceGUID is the GUID of the Power IAAS instance created from the IBM Cloud Catalog
	// before the cluster is completed.  Leave unset to allow the installer to create a service
	// instance during cluster creation.
	//
	// +optional
	ServiceInstanceGUID string `json:"serviceInstanceGUID,omitempty"`

	// COSInstanceCRN is the CRN of an existing IBM Cloud Object Storage instance
	// to use for storing the RHCOS image and bootstrap ignition data.
	// If not specified, a new COS instance will be created for the cluster.
	// The CRN format is: crn:v1:bluemix:public:cloud-object-storage:global:a/<account_id>:<instance_id>::
	//
	// +optional
	COSInstanceCRN string `json:"cosInstanceCRN,omitempty"`

	// ServiceEndpoints is a list which contains custom endpoints to override default
	// service endpoints of IBM Cloud Services.
	// There must only be one ServiceEndpoint for a service (no duplicates).
	//
	// +optional
	ServiceEndpoints []configv1.PowerVSServiceEndpoint `json:"serviceEndpoints,omitempty"`

	// ProvisionTimeoutMinutes overrides the default machine provisioning timeout.
	// Use this when the target environment provisions machines more slowly than
	// the default 15-minute window (e.g. IBM Cloud staging/test environments).
	// When unset or zero, the default of 15 minutes is used.
	//
	// +optional
	ProvisionTimeoutMinutes int `json:"provisionTimeoutMinutes,omitempty"`

	// tgName is the name or id of a pre-created TransitGateway inside IBM Cloud.
	//
	// +optional
	TransitGateway string `json:"tgName,omitempty"`

	// NetworkType selects the PowerVS network provisioning strategy.
	// Allowed values are "DHCPSubnet" (default) and "DHCPServer" (legacy).
	//
	// DHCPSubnet creates a plain PowerVS network with DHCP natively enabled and is the
	// recommended mode. It enables the full new networking model: route-mode Network Load
	// Balancer, VPC Routing Table advertising 0.0.0.0/0, and a VPC Public Gateway.
	// When an existing VPC is supplied, a Public Gateway already present in the zone is
	// reused, and the Routing Table is not created if the VPC already has one with
	// Transit Gateway ingress enabled (IBM Cloud allows only one); in that case that
	// table must route outbound traffic to the cluster.
	//
	// DHCPServer creates a dedicated DHCP Service VM (legacy). When this mode is selected
	// the route-mode NLB, Routing Table, and Public Gateway are suppressed because the
	// DHCP Server manages its own SNAT and egress.
	//
	// Leave unset to use DHCPSubnet.
	//
	// +optional
	NetworkType NetworkType `json:"networkType,omitempty"`
}

Platform stores all the global configuration that all machinesets use.

func (*Platform) DeepCopy

func (in *Platform) DeepCopy() *Platform

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Platform.

func (*Platform) DeepCopyInto

func (in *Platform) DeepCopyInto(out *Platform)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Region

type Region struct {
	Description string
	VPCRegion   string
	COSRegion   string
	Zones       map[string]Zone
	VPCZones    []string
}

Region describes resources associated with a region in Power VS. We're using a few items from the IBM Cloud VPC offering. The region names for VPC are different so another function of this is to correlate those.

func (*Region) DeepCopy

func (in *Region) DeepCopy() *Region

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Region.

func (*Region) DeepCopyInto

func (in *Region) DeepCopyInto(out *Region)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Zone

type Zone struct {
	SysTypes []string
}

Zone holds the sysTypes for a zone in a IBM Power VS region.

func (*Zone) DeepCopy

func (in *Zone) DeepCopy() *Zone

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Zone.

func (*Zone) DeepCopyInto

func (in *Zone) DeepCopyInto(out *Zone)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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