octavia

package
v0.0.0-...-09252a0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	AmphoraImageTag     = "amphora-image"
	AmphoraImageVertTag = "amphora-image-vert"
)
View Source
const (

	// LbMgmtNetName -
	LbMgmtNetName = "lb-mgmt-net"

	// LbMgmtNetDescription -
	LbMgmtNetDescription = "LBaaS Management Network"

	// LbMgmtSubnetName -
	LbMgmtSubnetName = "lb-mgmt-subnet"

	// LbMgmtSubnetDescription -
	LbMgmtSubnetDescription = "LBaaS Management Subnet"

	// LbMgmtSubnetCIDR -
	LbMgmtSubnetCIDR = "172.24.0.0/16"

	// LbMgmtSubnetAllocationPoolStart -
	LbMgmtSubnetAllocationPoolStart = "172.24.0.5"

	// LbMgmtSubnetAllocationPoolEnd -
	LbMgmtSubnetAllocationPoolEnd = "172.24.255.254"

	// LbMgmtSubnetGatewayIP -
	LbMgmtSubnetGatewayIP = ""

	// LbMgmtSubnetIPv6CIDR -
	LbMgmtSubnetIPv6CIDR = "fd6c:6261:6173:0001::/64"

	// LbMgmtSubnetIPv6AllocationPoolStart -
	LbMgmtSubnetIPv6AllocationPoolStart = "fd6c:6261:6173:0001::5"

	// LbMgmtSubnetIPv6AllocationPoolEnd -
	LbMgmtSubnetIPv6AllocationPoolEnd = "fd6c:6261:6173:0001:ffff:ffff:ffff:ffff"

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

	// LbProvSubnetCIDR -
	LbProvSubnetCIDR = "172.23.0.0/24"

	// LbProvSubnetAllocationPoolStart -
	LbProvSubnetAllocationPoolStart = "172.23.0.100"

	// LbProvSubnetAllocationPoolEnd -
	LbProvSubnetAllocationPoolEnd = "172.23.0.125"

	// LbProvSubnetGatewayIP -
	LbProvSubnetGatewayIP = ""

	// TODO(beagles): support IPv6 for the provider network.
	// LbRouterName -
	LbRouterName = "octavia-link-router"

	// LbProvPhysicalNet -
	LbProvPhysicalNet = "octavia"

	// LbRouterFixedIPAddress
	LbRouterFixedIPAddress = "172.23.0.150"

	// LbMgmtRouterPortName
	LbMgmtRouterPortName = "lb-mgmt-router-port"

	// LbMgmtRouterPortIPv4
	LbMgmtRouterPortIPv4 = "172.24.0.3"

	// LbMgmtRouterPortIPv6
	LbMgmtRouterPortIPv6 = "fd6c:6261:6173:0001::3"

	// 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"
)
View Source
const (
	// DBSyncCommand -
	DBSyncCommand = "/usr/local/bin/kolla_set_configs && /usr/local/bin/kolla_start"
)
View Source
const (
	// InitContainerCommand -
	InitContainerCommand = "/usr/local/bin/container-scripts/init.sh"
)
View Source
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

View Source
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 EnsureAmpSSHConfig

func EnsureAmpSSHConfig(
	ctx context.Context,
	instance *octaviav1.Octavia,
	h *helper.Helper,
) error

EnsureAmpSSHConfig ensures amphora SSH configuration is set up

func EnsureAmphoraCerts

func EnsureAmphoraCerts(
	ctx context.Context,
	instance *octaviav1.Octavia,
	h *helper.Helper,
	log *logr.Logger) error

EnsureAmphoraCerts ensures Amphora certificates exist in the secret store

func EnsureAmphoraImages

func EnsureAmphoraImages(
	ctx context.Context,
	instance *octaviav1.Octavia,
	log *logr.Logger,
	helper *helper.Helper,
	imageList []AmphoraImage,
) (bool, error)

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 GetImageOwnerID(
	ctx context.Context,
	instance *octaviav1.Octavia,
	helper *helper.Helper,
) (string, error)

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 GetOpenstackClient

func GetOpenstackClient(
	ctx context.Context,
	ns string,
	h *helper.Helper,
) (*openstack.OpenStack, error)

GetOpenstackClient returns an openstack admin service client object

func GetOwningOctaviaControllerName

func GetOwningOctaviaControllerName(instance client.Object) string

GetOwningOctaviaControllerName - Given a OctaviaHousekeeping, OctaviaHealthmanager or OctaviaWorker object, returning the parent Octavia object that created it (if any)

func GetProject

func GetProject(openstack *openstack.OpenStack, projectName string) (*projects.Project, error)

GetProject -

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 GetUser

func GetUser(openstack *openstack.OpenStack, userName string) (*users.User, error)

GetUser -

func GetVolumeMounts

func GetVolumeMounts(serviceName string) []corev1.VolumeMount

GetVolumeMounts - general VolumeMounts

func GetVolumes

func GetVolumes(name string) []corev1.Volume

GetVolumes - service volumes

func ImageUploadDeployment

func ImageUploadDeployment(
	instance *octaviav1.Octavia,
	labels map[string]string,
) *appsv1.Deployment

Deployment func

func InitContainer

func InitContainer(init APIDetails) []corev1.Container

InitContainer - init container for octavia api pods

Types

type APIDetails

type APIDetails struct {
	ContainerImage          string
	DatabaseHost            string
	DatabaseName            string
	PersistenceDatabaseName string
	TransportURLSecret      string
	OSPSecret               string
	UserPasswordSelector    string
	VolumeMounts            []corev1.VolumeMount
}

APIDetails information

type AmphoraImage

type AmphoraImage struct {
	ID       string
	URL      string
	Checksum string
	Name     string
	Status   images.ImageStatus
}

type ImageUploadDetails

type ImageUploadDetails struct {
	ContainerImage string
	VolumeMounts   []corev1.VolumeMount
}

type NetworkProvisioningSummary

type NetworkProvisioningSummary struct {
	TenantNetworkID    string
	TenantSubnetID     string
	TenantRouterPortID string
	ProviderNetworkID  string
	RouterID           string
	SecurityGroupID    string
}

func EnsureAmphoraManagementNetwork

func EnsureAmphoraManagementNetwork(
	ctx context.Context,
	ns string,
	tenantName string,
	netDetails *octaviav1.OctaviaLbMgmtNetworks,
	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.

Jump to

Keyboard shortcuts

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