Documentation ¶
Index ¶
- Constants
- func DbSyncJob(instance *octaviav1.Octavia, labels map[string]string, ...) *batchv1.Job
- func EncryptPrivateKey(data, password []byte) (*pem.Block, error)
- func EnsureAmpSSHConfig(ctx context.Context, instance *octaviav1.Octavia, h *helper.Helper) error
- func EnsureAmphoraCerts(ctx context.Context, instance *octaviav1.Octavia, h *helper.Helper) error
- func EnsureAmphoraImages(ctx context.Context, instance *octaviav1.Octavia, log *logr.Logger, ...) (bool, error)
- func EnsureQuotas(ctx context.Context, instance *octaviav1.Octavia, log *logr.Logger, ...) error
- func GetAdminServiceClient(ctx context.Context, h *helper.Helper, keystoneAPI *keystonev1.KeystoneAPI) (*openstack.OpenStack, ctrl.Result, error)
- func GetComputeClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
- func GetImageClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
- func GetImageOwnerID(ctx context.Context, instance *octaviav1.Octavia, helper *helper.Helper) (string, error)
- func GetInitVolumeMounts() []corev1.VolumeMount
- func GetLoadBalancerClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
- func GetNetworkClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
- func GetNextIP(predParams *NADIpam, currentValues map[string]bool) (string, error)
- func GetOctaviaSecurityContext() *corev1.SecurityContext
- func GetOpenstackClient(ctx context.Context, ns string, h *helper.Helper) (*openstack.OpenStack, error)
- func GetOpenstackServiceClient(ctx context.Context, instance *octaviav1.Octavia, h *helper.Helper) (*openstack.OpenStack, error)
- func GetOwningOctaviaControllerName(instance client.Object) string
- func GetProject(openstack *openstack.OpenStack, projectName string) (*projects.Project, error)
- func GetRangeFromCIDR(cidr netip.Prefix) (start netip.Addr, end netip.Addr)
- func GetServiceClient(ctx context.Context, h *helper.Helper, octavia *octaviav1.Octavia, ...) (*openstack.OpenStack, ctrl.Result, error)
- func GetUser(openstack *openstack.OpenStack, userName string) (*users.User, error)
- func GetVolumeMounts(serviceName string) []corev1.VolumeMount
- func GetVolumes(name string) []corev1.Volume
- func ImageUploadDeployment(instance *octaviav1.Octavia, labels map[string]string) *appsv1.Deployment
- type AmphoraImage
- type ClientConfig
- type ClientType
- type ImageUploadDetails
- type NADConfig
- type NADIpam
- type NADRoute
- type NetworkParameters
- type NetworkProvisioningSummary
Constants ¶
const ( // ServiceName - ServiceName = "octavia" // ServiceType - ServiceType = "load-balancer" // DatabaseName - Name of the database used in CREATE DATABASE statement // for the main octavia database DatabaseName = "octavia" // PersistenceDatabaseName - Name of the database used in CREATE DATABASE statement // for the persistence database PersistenceDatabaseName = "octavia_persistence" // DatabaseCRName - Name of the MariaDBDatabase CR DatabaseCRName = "octavia" // PersistenceDatabaseCRName - Name of the MariaDBDatabase CR PersistenceDatabaseCRName = "octavia-persistence" // DatabaseUsernamePrefix - used by EnsureMariaDBAccount when a new username // is to be generated, e.g. "octavia_e5a4", "octavia_78bc", etc DatabaseUsernamePrefix = "octavia" // OctaviaPublicPort - OctaviaPublicPort int32 = 9876 // OctaviaInternalPort - OctaviaInternalPort int32 = 9876 // ApacheInternalPort - ApacheInternalPort int32 = 80 // AdminTenantName AdminTenant = "admin" // HmConfigMap ... HmConfigMap = "octavia-hmport-map" )
const ( AmphoraImageTag = "amphora-image" AmphoraImageVertTag = "amphora-image-vert" )
const ( // LbMgmtNetName - LbMgmtNetName = "lb-mgmt-net" // LbMgmtNetNameAZ - LbMgmtNetNameAZ = "lb-mgmt-%s-net" // LbMgmtNetDescription - LbMgmtNetDescription = "LBaaS Management Network" // LbMgmtNetDescriptionAZ - LbMgmtNetDescriptionAZ = "LBaaS Management Network for %s" // LbMgmtSubnetName - LbMgmtSubnetName = "lb-mgmt-subnet" // LbMgmtSubnetNameAZ - LbMgmtSubnetNameAZ = "lb-mgmt-%s-subnet" // LbMgmtSubnetDescription - LbMgmtSubnetDescription = "LBaaS Management Subnet" // LbMgmtSubnetDescriptionAZ - LbMgmtSubnetDescriptionAZ = "LBaaS Management Subnet for %s" // LbMgmtSubnetGatewayIP - LbMgmtSubnetGatewayIP = "" // LbMgmtSubnetIPv6AddressMode - LbMgmtSubnetIPv6AddressMode = "slaac" // LbMgmtSubnetIPv6RAMode - LbMgmtSubnetIPv6RAMode = "slaac" // LbMgmtSubnetIPv6GatewayIP - LbMgmtSubnetIPv6GatewayIP = "" // LbProvNetName - LbProvNetName = "octavia-provider-net" // LbProvNetDescription - LbProvNetDescription = "LBaaS Management Provider Network" // LbProvSubnetName - LbProvSubnetName = "octavia-provider-subnet" // LbProvSubnetDescription - LbProvSubnetDescription = "LBaaS Management Provider Subnet" // LbProvSubnetPoolSize - LbProvSubnetPoolSize = 25 // LbProvPredictablePoolSize - LbProvPredictablePoolSize = 25 // TODO(beagles): support IPv6 for the provider network. // LbRouterName - LbRouterName = "octavia-link-router" // LbProvPhysicalNet - LbProvPhysicalNet = "octavia" // LbMgmtRouterPortName LbMgmtRouterPortName = "lb-mgmt-router-port" // LbMgmtRouterPortNameAZ LbMgmtRouterPortNameAZ = "lb-mgmt-%s-router-port" // Network attachment details // LbNetworkAttachmentName LbNetworkAttachmentName = "octavia" // LbMgmtNetworkSecurityGroup LbMgmtNetworkSecurityGroupName = "lb-mgmt-sec-grp" // LbMgmtHealthManagerSecurityGroup LbMgmtHealthManagerSecurityGroupName = "lb-health-mgr-sec-grp" // LbMgmtNetworkSecurityGroup LbProvNetworkSecurityGroupName = "lb-prov-sec-grp" // LbMgmtHealthManagerSecurityGroup LbProvHealthManagerSecurityGroupName = "lb-health-prov-sec-grp" )
const ( OctaviaUID int64 = 42437 OctaviaGID int64 = 42437 )
const (
// InitContainerCommand -
InitContainerCommand = "/usr/local/bin/container-scripts/init.sh"
)
const NovaKeyPairName string = "octavia-ssh-keypair"
NovaKeyPairName stores the name of the nova keypair that holds the public SSH key for access to the amphorae
const (
// ServiceCommand -
ServiceCommand = "cp -f /usr/local/apache2/conf/httpd.conf /etc/httpd/conf/httpd.conf && /usr/bin/run-httpd"
)
Variables ¶
This section is empty.
Functions ¶
func DbSyncJob ¶
func DbSyncJob( instance *octaviav1.Octavia, labels map[string]string, annotations map[string]string, ) *batchv1.Job
DbSyncJob func
func EncryptPrivateKey ¶
EncryptPrivateKey encrypts given private key data using AES in PKCS#8 format
func EnsureAmpSSHConfig ¶
func EnsureAmpSSHConfig( ctx context.Context, instance *octaviav1.Octavia, h *helper.Helper, ) error
EnsureAmpSSHConfig ensures amphora SSH configuration is set up
func EnsureAmphoraCerts ¶
EnsureAmphoraCerts ensures Amphora certificates exist in the secret store
func EnsureAmphoraImages ¶
func EnsureQuotas ¶
func EnsureQuotas( ctx context.Context, instance *octaviav1.Octavia, log *logr.Logger, helper *helper.Helper, ) error
EnsureQuotas -- set the quotas for the Octavia project
func GetAdminServiceClient ¶
func GetAdminServiceClient( ctx context.Context, h *helper.Helper, keystoneAPI *keystonev1.KeystoneAPI, ) (*openstack.OpenStack, ctrl.Result, error)
GetAdminServiceClient - get a client for the "admin" tenant
func GetComputeClient ¶
func GetComputeClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
GetComputeClient -
func GetImageClient ¶
func GetImageClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
GetImageClient -
func GetImageOwnerID ¶
func GetInitVolumeMounts ¶
func GetInitVolumeMounts() []corev1.VolumeMount
GetInitVolumeMounts - general init task VolumeMounts
func GetLoadBalancerClient ¶
func GetLoadBalancerClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
GetLoadBalancerClient -
func GetNetworkClient ¶
func GetNetworkClient(o *openstack.OpenStack) (*gophercloud.ServiceClient, error)
GetNetworkClient -
func GetNextIP ¶
GetNextIP picks the next available IP from the range defined by a NADIpam, skipping ones that are already used appear as keys in the currentValues map.
func GetOctaviaSecurityContext ¶
func GetOctaviaSecurityContext() *corev1.SecurityContext
func GetOpenstackClient ¶
func GetOpenstackClient( ctx context.Context, ns string, h *helper.Helper, ) (*openstack.OpenStack, error)
GetOpenstackClient returns an openstack admin service client object
func GetOpenstackServiceClient ¶
func GetOpenstackServiceClient( ctx context.Context, instance *octaviav1.Octavia, h *helper.Helper, ) (*openstack.OpenStack, error)
GetOpenstackServiceClient returns an openstack service client object
func GetOwningOctaviaControllerName ¶
GetOwningOctaviaControllerName - Given a OctaviaHousekeeping, OctaviaHealthmanager or OctaviaWorker object, returning the parent Octavia object that created it (if any)
func GetProject ¶
GetProject -
func GetRangeFromCIDR ¶
GetRangeFromCIDR - compute a IP address range from a CIDR
func GetServiceClient ¶
func GetServiceClient( ctx context.Context, h *helper.Helper, octavia *octaviav1.Octavia, keystoneAPI *keystonev1.KeystoneAPI, ) (*openstack.OpenStack, ctrl.Result, error)
GetServiceClient - Get a client for the "service" tenant
func GetVolumeMounts ¶
func GetVolumeMounts(serviceName string) []corev1.VolumeMount
GetVolumeMounts - general VolumeMounts
func ImageUploadDeployment ¶
func ImageUploadDeployment( instance *octaviav1.Octavia, labels map[string]string, ) *appsv1.Deployment
Deployment func
Types ¶
type AmphoraImage ¶
type ClientConfig ¶
type ClientType ¶
type ClientType int
const ( AdminClient ClientType = iota ServiceClient ClientType = iota )
type ImageUploadDetails ¶
type ImageUploadDetails struct { ContainerImage string VolumeMounts []corev1.VolumeMount }
type NADConfig ¶
type NADConfig struct {
IPAM NADIpam `json:"ipam"`
}
NADConfig - IPAM parameters of the NAD
type NADIpam ¶
type NADIpam struct { CIDR netip.Prefix `json:"range"` RangeStart netip.Addr `json:"range_start"` RangeEnd netip.Addr `json:"range_end"` Routes []NADRoute `json:"routes"` }
func GetPredictableIPAM ¶
func GetPredictableIPAM(networkParameters *NetworkParameters) (*NADIpam, error)
GetPredictableIPAM returns a struct describing the available IP range. If the IP pool size does not fit in given networkParameters CIDR it will return an error instead.
type NetworkParameters ¶
type NetworkParameters struct { ProviderCIDR netip.Prefix ProviderAllocationStart netip.Addr ProviderAllocationEnd netip.Addr ProviderGateway netip.Addr TenantCIDR netip.Prefix TenantAllocationStart netip.Addr TenantAllocationEnd netip.Addr }
NetworkParameters - Parameters for the Octavia networks, based on the config of the NAD
func GetNetworkParametersFromNAD ¶
func GetNetworkParametersFromNAD( nad *networkv1.NetworkAttachmentDefinition, instance *octaviav1.Octavia, ) (*NetworkParameters, error)
GetNetworkParametersFromNAD - Extract network information from the Network Attachment Definition
type NetworkProvisioningSummary ¶
type NetworkProvisioningSummary struct { TenantNetworkID string SecurityGroupID string ManagementSubnetCIDR string ManagementSubnetGateway string ManagementSubnetExtraCIDRs []string }
NetworkProvisioningSummary - Type for conveying the results of the EnsureAmphoraManagementNetwork call.
func EnsureAmphoraManagementNetwork ¶
func EnsureAmphoraManagementNetwork( ctx context.Context, ns string, tenantName string, netDetails *octaviav1.OctaviaLbMgmtNetworks, networkParameters *NetworkParameters, log *logr.Logger, helper *helper.Helper, ) (NetworkProvisioningSummary, error)
EnsureAmphoraManagementNetwork - retrieve, create and reconcile the Octavia management network for the in cluster link to the management tenant network.