Skip to content

Commit

Permalink
Create keystoneapi route and svc endpoint overrides
Browse files Browse the repository at this point in the history
Creates the route for the keystoneapi, also allows to customize the
route via override.

Generats the service override for the env with what is configured in
the externalEndpoints, or specified in the service template override.

Depends-On: openstack-k8s-operators/lib-common#313
Depends-On: openstack-k8s-operators/keystone-operator#289

Jira: OSP-26690
  • Loading branch information
stuggi committed Sep 21, 2023
1 parent 898db99 commit a4e6c74
Show file tree
Hide file tree
Showing 19 changed files with 2,326 additions and 779 deletions.
1,245 changes: 916 additions & 329 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const (
// OpenStackControlPlaneKeystoneAPIReadyCondition Status=True condition which indicates if KeystoneAPI is configured and operational
OpenStackControlPlaneKeystoneAPIReadyCondition condition.Type = "OpenStackControlPlaneKeystoneAPIReady"

// OpenStackControlPlaneExposeKeystoneAPIReadyCondition Status=True condition which indicates if KeystoneAPI is exposed via a route
OpenStackControlPlaneExposeKeystoneAPIReadyCondition condition.Type = "OpenStackControlPlaneExposeKeystoneAPIReady"

// OpenStackControlPlanePlacementAPIReadyCondition Status=True condition which indicates if PlacementAPI is configured and operational
OpenStackControlPlanePlacementAPIReadyCondition condition.Type = "OpenStackControlPlanePlacementAPIReady"

Expand Down Expand Up @@ -75,6 +78,9 @@ const (
// OpenStackControlPlaneCeilometerReadyCondition Status=True condition which indicates if OpenStack Ceilometer service is configured and operational
OpenStackControlPlaneCeilometerReadyCondition condition.Type = "OpenStackControlPlaneCeilometerReady"

// OpenStackControlPlaneServiceOverrideReadyCondition Status=True condition which indicates if OpenStack service override has created ok
OpenStackControlPlaneServiceOverrideReadyCondition condition.Type = "OpenStackControlPlaneServiceOverrideReady"

// OpenStackControlPlaneManilaReadyInitMessage
OpenStackControlPlaneManilaReadyInitMessage = "OpenStackControlPlane Manila not started"

Expand Down Expand Up @@ -107,7 +113,6 @@ const (

// OpenStackControlPlaneRedisReadyCondition Status=True condition which indicates if Redis is configured and operational
OpenStackControlPlaneRedisReadyCondition condition.Type = "OpenStackControlPlaneRedisReady"

)

// OpenStackControlPlane Reasons used by API objects.
Expand Down Expand Up @@ -338,4 +343,12 @@ const (
// OpenStackControlPlaneRedisReadyErrorMessage
OpenStackControlPlaneRedisReadyErrorMessage = "OpenStackControlPlane Redis error occured %s"

// OpenStackControlPlaneExposeServiceReadyInitMessage
OpenStackControlPlaneExposeServiceReadyInitMessage = "OpenStackControlPlane %s exposing service %s not started"

// OpenStackControlPlaneExposeServiceReadyErrorMessage
OpenStackControlPlaneExposeServiceReadyErrorMessage = "OpenStackControlPlane %s exposing service via route %s error occured %s"

// OpenStackControlPlaneExposeServiceReadyMessage
OpenStackControlPlaneExposeServiceReadyMessage = "OpenStackControlPlane %s service exposed"
)
27 changes: 23 additions & 4 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@ import (
horizonv1 "github.com/openstack-k8s-operators/horizon-operator/api/v1beta1"
memcachedv1 "github.com/openstack-k8s-operators/infra-operator/apis/memcached/v1beta1"
networkv1 "github.com/openstack-k8s-operators/infra-operator/apis/network/v1beta1"
redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1"
ironicv1 "github.com/openstack-k8s-operators/ironic-operator/api/v1beta1"
keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/route"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/storage"
manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
novav1 "github.com/openstack-k8s-operators/nova-operator/api/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"
ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
swiftv1 "github.com/openstack-k8s-operators/swift-operator/api/v1beta1"
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"
rabbitmqv1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -190,9 +192,21 @@ type KeystoneSection struct {
Enabled bool `json:"enabled"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// +operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Keystone service
Template keystonev1.KeystoneAPISpec `json:"template,omitempty"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// APIOverride, provides the ability to override the generated manifest of several child resources.
APIOverride Override `json:"apiOverride,omitempty"`
}

// Override to override the generated manifest of several child resources.
type Override struct {
// +kubebuilder:validation:Optional
// Route overrides to use when creating the public service endpoint
Route *route.OverrideSpec `json:"route,omitempty"`
}

// PlacementSection defines the desired state of Placement service
Expand Down Expand Up @@ -308,6 +322,12 @@ type RabbitmqTemplate struct {

// MetalLBConfig to configure the MetalLB loadbalancer service
type MetalLBConfig struct {
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum=internal;public
// +kubebuilder:default=internal
// Endpoint, OpenStack endpoint this service maps to
Endpoint service.Endpoint `json:"endpoint"`

// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
//+operator-sdk:csv:customresourcedefinitions:type=spec
Expand Down Expand Up @@ -501,7 +521,6 @@ type RedisSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Templates - Overrides to use when creating the Redis Resources
Templates map[string]redisv1.RedisSpec `json:"templates,omitempty"`

}

// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane
Expand Down
22 changes: 22 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

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

28 changes: 15 additions & 13 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ go 1.19
require (
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230915101724-27ac1650268d
github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230918155018-15e9a91ab099
github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230919010505-829b985599de
github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230919030438-b18e8fb1bcc8
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230918070031-70498d9b2fec
github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088
github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230921081203-89164087dac9
github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230920142821-e84784bede25
github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230920143411-511d89a0e6cc
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44
github.com/openstack-k8s-operators/ironic-operator/api v0.1.1-0.20230915140049-df437872b34f
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230918093932-0512e2f335dd
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230918105853-7a32db095b3d
github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230916214930-2c2b11448ca0
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230921081246-996d4e390998
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c
github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230918064409-8ef2e76869c3
github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230920145429-537b5afebd07
github.com/openstack-k8s-operators/nova-operator/api v0.1.2-0.20230918133139-6bec6fb25b25
github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230915083637-79fc51fd4dcf
github.com/openstack-k8s-operators/ovn-operator/api v0.1.1-0.20230913151226-aab30786ed97
github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230918155857-7af4ec18350b
github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230915130355-e5c2b0ff0af1
github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230920125340-3c99d09c7033
github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230920144258-a37c476a2829
github.com/openstack-k8s-operators/telemetry-operator/api v0.1.1-0.20230914155337-2540bab64b80
github.com/rabbitmq/cluster-operator v1.14.0
k8s.io/apimachinery v0.26.9
Expand Down Expand Up @@ -65,8 +65,8 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230918105853-7a32db095b3d //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230918105853-7a32db095b3d
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216 //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand Down Expand Up @@ -100,3 +100,5 @@ require (
// mschuppert: map to latest commit from release-4.13 tag
// must consistent within modules and service operators
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging

replace github.com/openstack-k8s-operators/nova-operator/api => github.com/stuggi/nova-operator/api v0.0.0-20230921063244-6a5e52bc352b
Loading

0 comments on commit a4e6c74

Please sign in to comment.