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 Aug 8, 2023
1 parent bf37c46 commit 3e03408
Show file tree
Hide file tree
Showing 20 changed files with 3,470 additions and 885 deletions.
1,875 changes: 1,459 additions & 416 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,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 @@ -321,4 +324,13 @@ const (

// OpenStackControlPlaneCeilometerReadyErrorMessage
OpenStackControlPlaneCeilometerReadyErrorMessage = "OpenStackControlPlane Ceilometer error occured %s"

// OpenStackControlPlaneServiceOverrideReadyInitMessage
OpenStackControlPlaneServiceOverrideReadyInitMessage = "OpenStackControlPlane service override not started"

// OpenStackControlPlaneServiceOverrideReadyMessage
OpenStackControlPlaneServiceOverrideReadyMessage = "OpenStackControlPlane service overrides completed"

// OpenStackControlPlaneServiceOverrideReadyErrorMessage
OpenStackControlPlaneServiceOverrideReadyErrorMessage = "OpenStackControlPlane %s service endpoint %s override error occured %s"
)
29 changes: 27 additions & 2 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@ import (
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"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -188,9 +190,24 @@ 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"`

// ExternalEndpoints, expose a VIP using a pre-created IPAddressPool
ExternalEndpoints []MetalLBConfig `json:"externalEndpoints,omitempty"`
}

// PlacementSection defines the desired state of Placement service
Expand Down Expand Up @@ -306,6 +323,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 @@ -556,6 +579,8 @@ func (instance *OpenStackControlPlane) InitConditions() {
instance.Status.Conditions = condition.Conditions{}
}
cl := condition.CreateList(
condition.UnknownCondition(OpenStackControlPlaneServiceOverrideReadyCondition, condition.InitReason, OpenStackControlPlaneServiceOverrideReadyInitMessage),
condition.UnknownCondition(condition.ExposeServiceReadyCondition, condition.InitReason, condition.ExposeServiceReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneRabbitMQReadyCondition, condition.InitReason, OpenStackControlPlaneRabbitMQReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneOVNReadyCondition, condition.InitReason, OpenStackControlPlaneOVNReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneNeutronReadyCondition, condition.InitReason, OpenStackControlPlaneNeutronReadyInitMessage),
Expand Down
2 changes: 1 addition & 1 deletion apis/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (r *OpenStackControlPlane) checkDepsEnabled(name string) string {
case "Octavia":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled && r.Spec.Neutron.Enabled && r.Spec.Glance.Enabled && r.Spec.Nova.Enabled &&
r.Spec.Ovn.Enabled) {
r.Spec.Ovn.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone, Glance, Neutron, Nova, OVN"
}
}
Expand Down
29 changes: 29 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.

20 changes: 20 additions & 0 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,23 @@ 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/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20230808072208-e8d9f1a8a0b8

//replace github.com/openstack-k8s-operators/lib-common/modules/common => /home/mschuppe/src/github.com/openstack-k8s-operators/lib-common/modules/common

replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/stuggi/keystone-operator/api v0.0.0-20230808074553-872e7cb2e6f4

//replace github.com/openstack-k8s-operators/keystone-operator/api => /home/mschuppe/src/github.com/openstack-k8s-operators/keystone-operator/api

//replace github.com/openstack-k8s-operators/glance-operator/api => /home/mschuppe/src/github.com/openstack-k8s-operators/glance-operator/api

replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20230808075207-6b14ed16b49b

replace github.com/openstack-k8s-operators/placement-operator/api => github.com/stuggi/placement-operator/api v0.0.0-20230808075127-11794bf73d00

replace github.com/openstack-k8s-operators/cinder-operator/api => github.com/stuggi/cinder-operator/api v0.0.0-20230808075052-d7ecd3000e0a

replace github.com/openstack-k8s-operators/neutron-operator/api => github.com/stuggi/neutron-operator/api v0.0.0-20230807133748-6ed1a0824e3a

replace github.com/openstack-k8s-operators/nova-operator/api => github.com/stuggi/nova-operator/api v0.0.0-20230808075321-5f810c0dcaa0
28 changes: 14 additions & 14 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI=
github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4=
github.com/openstack-k8s-operators/cinder-operator/api v0.1.0 h1:8QsJidoozdGsV9fSFzzgCstxMvi8tKtsY67+G/gWKB0=
github.com/openstack-k8s-operators/cinder-operator/api v0.1.0/go.mod h1:GEZ6VarA74XXRa4SagCymoRrxQQVWvxZ2K7O4/YSxK4=
github.com/openstack-k8s-operators/glance-operator/api v0.1.0 h1:FWYUz5iHzzh6b74eor+3t9h4GQojmLFXD4YzFApEWz4=
github.com/openstack-k8s-operators/glance-operator/api v0.1.0/go.mod h1:I7JjTjU7qvmVr5rqMvlDbhxa3pA3DlCH4ZENGNew6gg=
github.com/openstack-k8s-operators/heat-operator/api v0.1.0 h1:OTYRtRUP3zwm0zg6JG/s2FYU7QT7xQNTFhMcMKpVRVU=
github.com/openstack-k8s-operators/heat-operator/api v0.1.0/go.mod h1:xLPJun/7wSz9vgaoxn6wz9AZsYOVj1LnYexGMgHRAcc=
github.com/openstack-k8s-operators/horizon-operator/api v0.1.0 h1:pwMfL2bZu8/pQ2QWzDT5thdeSvY6fI6P0iJkFeiT7a0=
Expand All @@ -138,10 +134,6 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230807091437-b
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230807091437-ba548589f8e8/go.mod h1:t1xmsiZDqM3wXcLMqgHp7/iilK8ozuOkydV4Vi2Qibk=
github.com/openstack-k8s-operators/ironic-operator/api v0.1.0 h1:Bm0mo2iRT16CG/WNj3stuheDGQDDZY3CGVv52AFDH1w=
github.com/openstack-k8s-operators/ironic-operator/api v0.1.0/go.mod h1:slFWxIEbjO2tkyPR6GoKI0pIDgctKsPVB+Wg6D+CbQ0=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.0 h1:p98vKnS4KzdgU/+vrVKFY3y9n9v1Z6cpo4JvbTNRxlM=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.0/go.mod h1:LNJJdteQG4E2fhWDerE+f8S2/ephEJg8yBkH1eqYYOo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.0 h1:F1iYRBwa0cZ2VHw8Zs4frqSWQ1B/tiCuSwH/DuHb8VM=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.0/go.mod h1:3hAC5Ce0AOSt85BqD6DgTKNkJHmpXwqbwL8mVWRJQqo=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.0 h1:mMeJvCQfZmakssvMyHjzp/ngxKysETDj9GJYhRwydzg=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.0/go.mod h1:+paEFOL5IlJzhg9fy7/1+HSErVkWUgUj1ORLFwgvxnI=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.0 h1:rHn0wlwBBggRl65gWDniF97XW+1XB2+4PsGZS2RIJ5E=
Expand All @@ -150,16 +142,10 @@ github.com/openstack-k8s-operators/manila-operator/api v0.1.0 h1:79TSB3A5+TLpK56
github.com/openstack-k8s-operators/manila-operator/api v0.1.0/go.mod h1:ywLIfMlreyF+19UNZw3ud84/Tlr4WffuopEUSXFTick=
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.0 h1:oM0ZzFHHj+ioCc7NXHIO6+sy7I2yiN29DI9/jh4fe54=
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.0/go.mod h1:m5XuZSa5Zt5uAw3WbJYOIkFAGXy01mybVekcKOq1qHI=
github.com/openstack-k8s-operators/neutron-operator/api v0.1.0 h1:tGlQ4RPeFtgEHOnyqTnTzjzBaPHdpm0ieMMmQHl3XTg=
github.com/openstack-k8s-operators/neutron-operator/api v0.1.0/go.mod h1:5VaQboKxg4t65Xt1xcddjjODrUHkwQo9LCUWiGqbFao=
github.com/openstack-k8s-operators/nova-operator/api v0.1.1 h1:4FHCnUBopafOdnR+JEHyPROdi5wUjOk7G9YcfP3rfIE=
github.com/openstack-k8s-operators/nova-operator/api v0.1.1/go.mod h1:bQWyn3wTGEjbWk6qzyL7IhcIl9xU5WcGBcKBZZiD3Uo=
github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230801112207-bcd92ba349f6 h1:/shGXE4n0F99yX8eDPVzZwDL/lnM5Z/HhUhvBwxnWI8=
github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230801112207-bcd92ba349f6/go.mod h1:SUnvwqdpvGNWSWe11yuu2M5Ns9FG0ge16tfNzwXmz/s=
github.com/openstack-k8s-operators/ovn-operator/api v0.1.0 h1:AnmXOjUJMgxg8cRewjUIHfOCH1o3jTftYfvXiRGBjmA=
github.com/openstack-k8s-operators/ovn-operator/api v0.1.0/go.mod h1:SSNSWIHTf2i/yM2KprT7FZeCuQfGwEf5eHnISi3zMAg=
github.com/openstack-k8s-operators/placement-operator/api v0.1.0 h1:i2UEgkyAommKa3Q3KOwQirbbiLW6EocS457S+3fc46s=
github.com/openstack-k8s-operators/placement-operator/api v0.1.0/go.mod h1:HTgKM7NBqtBKsCQaBbtF9xqNAjLAmaCGoFlCDmIu9I0=
github.com/openstack-k8s-operators/swift-operator/api v0.1.0 h1:4d6o+qFzkm9vmIBiizjnL2D6QCqOIv8YTFVbWK7Dg20=
github.com/openstack-k8s-operators/swift-operator/api v0.1.0/go.mod h1:7Ysj6252KjltNccUosTKbtBhw9NZ+Sys2esq0bKm18M=
github.com/openstack-k8s-operators/telemetry-operator/api v0.1.0 h1:HF3SeZ3x6pbZrLxCmRkF+rIbaV8lISpA3gd2NCqX8D4=
Expand Down Expand Up @@ -197,6 +183,20 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stuggi/cinder-operator/api v0.0.0-20230808075052-d7ecd3000e0a h1:Evy/ItVvgR94Wwlo7o7f2V3DbluJD4AIyFYUGyPNjso=
github.com/stuggi/cinder-operator/api v0.0.0-20230808075052-d7ecd3000e0a/go.mod h1:NiERYYJ4YYbxg2Ry5HyH+UI8pbvKap5GoZtW6Exk1pQ=
github.com/stuggi/glance-operator/api v0.0.0-20230808075207-6b14ed16b49b h1:YRBQHekvk9NHhbNOmNbR0OJZO48RizCfaQ6VyP960y4=
github.com/stuggi/glance-operator/api v0.0.0-20230808075207-6b14ed16b49b/go.mod h1:LD5Y1/RQInUqzluF7RtzPLuOeQjgfq7ek9ecPSkVvWw=
github.com/stuggi/keystone-operator/api v0.0.0-20230808074553-872e7cb2e6f4 h1:qVwSTi3ZDWl8ITLcVBOwJlEDlMi3UyFykZh5qN76BSI=
github.com/stuggi/keystone-operator/api v0.0.0-20230808074553-872e7cb2e6f4/go.mod h1:XdvO78DPVkkGFf5kPLDDb7a8/DGuv/JwxzhmipalUhw=
github.com/stuggi/lib-common/modules/common v0.0.0-20230808072208-e8d9f1a8a0b8 h1:E5EGKIZHyAV1oofcXkcUq4NZfTtgFjjKpU6A0Yv2vls=
github.com/stuggi/lib-common/modules/common v0.0.0-20230808072208-e8d9f1a8a0b8/go.mod h1:2fZFojsJsTA4MfGy50JEwbXaIP7Hr7h7x8hbhlMBedY=
github.com/stuggi/neutron-operator/api v0.0.0-20230807133748-6ed1a0824e3a h1:cWcjdBMFPUg8+JOVVPY+WhKolV/McZIkHscqzDozkvM=
github.com/stuggi/neutron-operator/api v0.0.0-20230807133748-6ed1a0824e3a/go.mod h1:1RwvmP2LrLj/OJvSEl7hu3aYekB1EI79D1p/rfDxDZU=
github.com/stuggi/nova-operator/api v0.0.0-20230808075321-5f810c0dcaa0 h1:7zZX5Pu6Vlc2TLJs4arZK9wndIkeVUzFXjkeNIH8QL0=
github.com/stuggi/nova-operator/api v0.0.0-20230808075321-5f810c0dcaa0/go.mod h1:3Iin2b6jhn6ofsnUhl+WL3KQmC+QpDuimacCZZSUFIw=
github.com/stuggi/placement-operator/api v0.0.0-20230808075127-11794bf73d00 h1:UN2rIEvde98erkUPSUL/5j5KoshueEZZziVvG3d2RVo=
github.com/stuggi/placement-operator/api v0.0.0-20230808075127-11794bf73d00/go.mod h1:tg7n4eZXA5atHBLkUqSvD6EK3omwVN7fa5CSLZNBkFs=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down
Loading

0 comments on commit 3e03408

Please sign in to comment.