Skip to content

Commit

Permalink
Create Octavia Management Network
Browse files Browse the repository at this point in the history
  • Loading branch information
gthiemonge committed Oct 27, 2023
1 parent 9db0a8f commit f51842d
Show file tree
Hide file tree
Showing 16 changed files with 587 additions and 41 deletions.
20 changes: 20 additions & 0 deletions api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ spec:
to add additional files. Those get added to the service config dir
in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -190,6 +205,11 @@ spec:
description: 'ServiceUser - service user name (TODO: beagles, do we
need this at all)'
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
type: string
transportURLSecret:
description: TransportURLSecret - Secret containing RabbitMQ transportURL
type: string
Expand Down
75 changes: 75 additions & 0 deletions api/bases/octavia.openstack.org_octavias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ spec:
to add additional files. Those get added to the service config dir
in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -479,6 +494,21 @@ spec:
also be used to add additional files. Those get added to the
service config dir in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -583,6 +613,11 @@ spec:
description: 'ServiceUser - service user name (TODO: beagles,
do we need this at all)'
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
type: string
transportURLSecret:
description: TransportURLSecret - Secret containing RabbitMQ transportURL
type: string
Expand Down Expand Up @@ -635,6 +670,21 @@ spec:
also be used to add additional files. Those get added to the
service config dir in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -739,6 +789,11 @@ spec:
description: 'ServiceUser - service user name (TODO: beagles,
do we need this at all)'
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
type: string
transportURLSecret:
description: TransportURLSecret - Secret containing RabbitMQ transportURL
type: string
Expand Down Expand Up @@ -791,6 +846,21 @@ spec:
also be used to add additional files. Those get added to the
service config dir in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -895,6 +965,11 @@ spec:
description: 'ServiceUser - service user name (TODO: beagles,
do we need this at all)'
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
type: string
transportURLSecret:
description: TransportURLSecret - Secret containing RabbitMQ transportURL
type: string
Expand Down
15 changes: 12 additions & 3 deletions api/v1beta1/amphoracontroller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (

"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -116,6 +115,16 @@ type OctaviaAmphoraControllerSpec struct {
// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=service
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
// TODO(gthiemonge) same as ServiceAccount?
TenantName string `json:"tenantName"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={manageLbMgmtNetworks: true, subnetIpVersion: 4}
LbMgmtNetworks OctaviaLbMgmtNetworks `json:"lbMgmtNetwork"`
}

// OctaviaAmphoraControllerStatus defines the observed state of the Octavia Amphora Controller
Expand Down Expand Up @@ -144,10 +153,10 @@ type OctaviaAmphoraControllerStatus struct {

// OctaviaAmphoraController is the Schema for the octaviaworkers API
type OctaviaAmphoraController struct {
metav1.TypeMeta `json:",inline"`
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OctaviaAmphoraControllerSpec `json:"spec,omitempty"`
Spec OctaviaAmphoraControllerSpec `json:"spec,omitempty"`
Status OctaviaAmphoraControllerStatus `json:"status,omitempty"`
}

Expand Down
64 changes: 32 additions & 32 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@ const (
//
// OctaviaAPIReady condition messages
//
// OctaviaAPIReadyInitMessage
OctaviaAPIReadyInitMessage = "OctaviaAPI not started"

// OctaviaAPIReadyErrorMessage
OctaviaAPIReadyErrorMessage = "OctaviaAPI error occured %s"

//
// OctaviaHealthManagerReady condition messages
//
// OctaviaHealthManagerReadyInitMessage
OctaviaHealthManagerReadyInitMessage = "OctaviaHealthManager is not started"

// OctaviaHealthManagerReadyErrorMessage
OctaviaHealthManagerReadyErrorMessage = "OctaviaHealthManager error occured %s"

//
// OctaviaHousekeepingReady condition messages
//
// OctaviaHousekeepingReadyInitMessage
OctaviaHousekeepingReadyInitMessage = "OctaviaHousekeeping are not started"

// OctaviaAmphoraControllerReadyErrorMessage
OctaviaHousekeepingReadyErrorMessage = "OctaviaHousekeeping error occured %s"

//
// OctaviaWorkerReady condition messages
//
// OctaviaWorkerReadyInitMessage
OctaviaWorkerReadyInitMessage = "OctaviaWorker are not started"

// OctaviaAmphoraControllerReadyErrorMessage
OctaviaWorkerReadyErrorMessage = "OctaviaWorker error occured %s"
// OctaviaAPIReadyInitMessage
OctaviaAPIReadyInitMessage = "OctaviaAPI not started"

// OctaviaAPIReadyErrorMessage
OctaviaAPIReadyErrorMessage = "OctaviaAPI error occured %s"

//
// OctaviaHealthManagerReady condition messages
//
// OctaviaHealthManagerReadyInitMessage
OctaviaHealthManagerReadyInitMessage = "OctaviaHealthManager is not started"

// OctaviaHealthManagerReadyErrorMessage
OctaviaHealthManagerReadyErrorMessage = "OctaviaHealthManager error occured %s"

//
// OctaviaHousekeepingReady condition messages
//
// OctaviaHousekeepingReadyInitMessage
OctaviaHousekeepingReadyInitMessage = "OctaviaHousekeeping are not started"

// OctaviaAmphoraControllerReadyErrorMessage
OctaviaHousekeepingReadyErrorMessage = "OctaviaHousekeeping error occured %s"

//
// OctaviaWorkerReady condition messages
//
// OctaviaWorkerReadyInitMessage
OctaviaWorkerReadyInitMessage = "OctaviaWorker are not started"

// OctaviaAmphoraControllerReadyErrorMessage
OctaviaWorkerReadyErrorMessage = "OctaviaWorker error occured %s"
)
23 changes: 19 additions & 4 deletions api/v1beta1/octavia_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ type OctaviaSpec struct {
// +kubebuilder:validation:Optional
// OctaviaHousekeeping - Spec definition for the Octavia Housekeeping agent for the Octavia deployment
OctaviaWorker OctaviaAmphoraControllerSpec `json:"octaviaWorker"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={manageLbMgmtNetworks: true, subnetIpVersion: 4}
LbMgmtNetworks OctaviaLbMgmtNetworks `json:"lbMgmtNetwork"`
}

// PasswordSelector to identify the DB and AdminUser password from the Secret
Expand All @@ -132,6 +136,18 @@ type PasswordSelector struct {
Service string `json:"service,omitempty"`
}

// OctaviaLbMgmtNetworks Settings for Octavia management networks
type OctaviaLbMgmtNetworks struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=true
ManageLbMgmtNetworks bool `json:"manageLbMgmtNetworks,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=4
// IP Version of the managed subnets
SubnetIPVersion int `json:"subnetIpVersion,omitempty"`
}

// OctaviaStatus defines the observed state of Octavia
type OctaviaStatus struct {

Expand Down Expand Up @@ -199,16 +215,15 @@ func (instance Octavia) IsReady() bool {
func SetupDefaults() {
// Acquire environmental defaults and initialize Octavia defaults with them
octaviaDefaults := OctaviaDefaults{
APIContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_API_IMAGE_URL_DEFAULT", OctaviaAPIContainerImage),
HousekeepingContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT", OctaviaHousekeepingContainerImage),
APIContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_API_IMAGE_URL_DEFAULT", OctaviaAPIContainerImage),
HousekeepingContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT", OctaviaHousekeepingContainerImage),
HealthManagerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_HEALTHMANAGER_IMAGE_URL_DEFAULT", OctaviaHealthManagerContainerImage),
WorkerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT", OctaviaWorkerContainerImage),
WorkerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT", OctaviaWorkerContainerImage),
}

SetupOctaviaDefaults(octaviaDefaults)
}


// RbacConditionsSet - set the conditions for the rbac object
func (instance Octavia) RbacConditionsSet(c *condition.Condition) {
instance.Status.Conditions.Set(c)
Expand Down
17 changes: 17 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ spec:
to add additional files. Those get added to the service config dir
in /etc/<service> . TODO: -> implement'
type: object
lbMgmtNetwork:
default:
manageLbMgmtNetworks: true
subnetIpVersion: 4
description: OctaviaLbMgmtNetworks Settings for Octavia management
networks
properties:
manageLbMgmtNetworks:
default: true
type: boolean
subnetIpVersion:
default: 4
description: IP Version of the managed subnets
type: integer
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -190,6 +205,11 @@ spec:
description: 'ServiceUser - service user name (TODO: beagles, do we
need this at all)'
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
type: string
transportURLSecret:
description: TransportURLSecret - Secret containing RabbitMQ transportURL
type: string
Expand Down
Loading

0 comments on commit f51842d

Please sign in to comment.