From a4e6c74d991279a755bc942a269d6a053dbc5625 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Thu, 27 Jul 2023 12:01:36 +0200 Subject: [PATCH] Create keystoneapi route and svc endpoint overrides 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: https://github.com/openstack-k8s-operators/lib-common/pull/313 Depends-On: https://github.com/openstack-k8s-operators/keystone-operator/pull/289 Jira: OSP-26690 --- ....openstack.org_openstackcontrolplanes.yaml | 1245 ++++++++++++----- apis/core/v1beta1/conditions.go | 15 +- .../v1beta1/openstackcontrolplane_types.go | 27 +- apis/core/v1beta1/zz_generated.deepcopy.go | 22 + apis/go.mod | 28 +- apis/go.sum | 56 +- ....openstack.org_openstackcontrolplanes.yaml | 1245 ++++++++++++----- ...nstack-operator.clusterserviceversion.yaml | 18 + config/rbac/role.yaml | 27 + ...controlplane_galera_network_isolation.yaml | 11 +- ...ne_galera_network_isolation_3replicas.yaml | 11 +- ...enstackcontrolplane_network_isolation.yaml | 11 +- ...ckcontrolplane_network_isolation_ceph.yaml | 11 +- .../core/openstackcontrolplane_controller.go | 11 +- go.mod | 32 +- go.sum | 56 +- main.go | 2 + pkg/openstack/common.go | 222 +++ pkg/openstack/keystone.go | 55 +- 19 files changed, 2326 insertions(+), 779 deletions(-) diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index a4faf9a3a..0dc0abd34 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -124,32 +124,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -158,6 +132,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -1227,27 +1252,6 @@ spec: dnsDataLabelSelectorValue: default: dnsdata type: string - externalEndpoints: - items: - properties: - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - - loadBalancerIPs - type: object - type: array nodeSelector: additionalProperties: type: string @@ -1281,6 +1285,53 @@ spec: - values type: object type: array + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -2893,32 +2944,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -2927,6 +2952,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object pvc: type: string replicas: @@ -2989,32 +3063,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -3023,6 +3071,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object pvc: type: string replicas: @@ -3166,6 +3263,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -3226,10 +3374,61 @@ spec: additionalProperties: type: string type: object - replicas: - default: 1 - format: int32 - maximum: 32 + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object + replicas: + default: 1 + format: int32 + maximum: 32 minimum: 0 type: integer resources: @@ -3399,6 +3598,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object preserveJobs: default: false type: boolean @@ -3439,20 +3687,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - route: - properties: - routeLocation: - type: string - routeName: - default: horizon - type: string - routeTLSCA: - type: string - routeTLSEnabled: - type: string - routeTLSKey: - type: string - type: object secret: type: string required: @@ -3929,6 +4163,107 @@ spec: type: object keystone: properties: + apiOverride: + properties: + route: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + alternateBackends: + items: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + maxItems: 3 + type: array + host: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + path: + pattern: ^/ + type: string + port: + properties: + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - targetPort + type: object + subdomain: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + tls: + properties: + caCertificate: + type: string + certificate: + type: string + destinationCACertificate: + type: string + insecureEdgeTerminationPolicy: + type: string + key: + type: string + termination: + enum: + - edge + - reencrypt + - passthrough + type: string + required: + - termination + type: object + to: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + wildcardPolicy: + enum: + - None + - Subdomain + - "" + type: string + type: object + type: object + type: object enabled: default: true type: boolean @@ -3965,32 +4300,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array memcachedInstance: default: memcached type: string @@ -4002,6 +4311,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: admin: AdminPassword @@ -4877,31 +5237,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -4910,6 +5245,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -5203,32 +5589,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array extraMounts: items: properties: @@ -5993,6 +6353,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: database: NeutronDatabasePassword @@ -6092,31 +6503,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6125,6 +6511,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6237,40 +6674,15 @@ spec: metadataServiceTemplate: properties: containerImage: - type: string - customServiceConfig: - type: string - defaultConfigOverwrite: - additionalProperties: - type: string - type: object - enabled: - type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array + type: string + customServiceConfig: + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + enabled: + type: boolean networkAttachments: items: type: string @@ -6279,6 +6691,53 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6329,31 +6788,6 @@ spec: type: object enabled: type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6362,6 +6796,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6455,31 +6938,6 @@ spec: type: object enabled: type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6488,6 +6946,53 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -7021,32 +7526,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -7055,6 +7534,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: database: PlacementDatabasePassword @@ -7493,6 +8023,12 @@ spec: type: object externalEndpoint: properties: + endpoint: + default: internal + enum: + - internal + - public + type: string ipAddressPool: minLength: 1 type: string @@ -11202,6 +11738,57 @@ spec: type: string containerImageProxy: type: string + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: service: SwiftPassword diff --git a/apis/core/v1beta1/conditions.go b/apis/core/v1beta1/conditions.go index c1f4ae512..36ab3d804 100644 --- a/apis/core/v1beta1/conditions.go +++ b/apis/core/v1beta1/conditions.go @@ -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" @@ -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" @@ -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. @@ -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" ) diff --git a/apis/core/v1beta1/openstackcontrolplane_types.go b/apis/core/v1beta1/openstackcontrolplane_types.go index 7349a5ee8..4e32e5b26 100644 --- a/apis/core/v1beta1/openstackcontrolplane_types.go +++ b/apis/core/v1beta1/openstackcontrolplane_types.go @@ -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" ) @@ -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 @@ -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 @@ -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 diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index f04b9b9db..0c0d49b47 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -25,6 +25,7 @@ import ( memcachedv1beta1 "github.com/openstack-k8s-operators/infra-operator/apis/memcached/v1beta1" redisv1beta1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1" "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/storage" apiv1beta1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1" ovn_operatorapiv1beta1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1" @@ -169,6 +170,7 @@ func (in *IronicSection) DeepCopy() *IronicSection { func (in *KeystoneSection) DeepCopyInto(out *KeystoneSection) { *out = *in in.Template.DeepCopyInto(&out.Template) + in.APIOverride.DeepCopyInto(&out.APIOverride) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeystoneSection. @@ -476,6 +478,26 @@ func (in *OpenStackExtraVolMounts) DeepCopy() *OpenStackExtraVolMounts { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Override) DeepCopyInto(out *Override) { + *out = *in + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = new(route.OverrideSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Override. +func (in *Override) DeepCopy() *Override { + if in == nil { + return nil + } + out := new(Override) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OvnResources) DeepCopyInto(out *OvnResources) { *out = *in diff --git a/apis/go.mod b/apis/go.mod index 76b290b1b..4d4102740 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -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 @@ -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 @@ -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 diff --git a/apis/go.sum b/apis/go.sum index d362849b1..647cf6173 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -128,42 +128,40 @@ 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.2-0.20230915101724-27ac1650268d h1:FJkVYIG6hUwSP7zGuSTVi5Tay3EH8d8h6aS5wVAYNw0= -github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230915101724-27ac1650268d/go.mod h1:ntpA98K0eWjVUe32OAogE5NUMXc+CsNeneIlYRaKjd8= -github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230918155018-15e9a91ab099 h1:+B8EqaMrG6zPmH6YkAzA/UsTvlMUtNBPvoZHoibKDUs= -github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230918155018-15e9a91ab099/go.mod h1:EyWZbdyzJM2hEz1dDDo87oQic1HGUdi46vAtH6Y7DnU= -github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230919010505-829b985599de h1:c9AgISgzQLwxfb3WEuDVWfNvu0eVywsA/wDFlEFL77k= -github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230919010505-829b985599de/go.mod h1:cYYINAv7b89hsSvyzsDD5FEN4X0hC0J6tKomTxVrcTo= -github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230919030438-b18e8fb1bcc8 h1:mqZ6oKNoS7ym9xCIDZ43FbUQWpo7zZI52XLh4hMPM44= -github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230919030438-b18e8fb1bcc8/go.mod h1:brUv4XGvLPITO6Tn4fXTk6s4Ts/VMwDuFiypC2xclOc= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230918070031-70498d9b2fec h1:+8EYd1O5SO0wadEc8EYwTI0AdtCOxaAfg/dfS+rq5jM= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230918070031-70498d9b2fec/go.mod h1:G4vJpe0Hr2s1U+tjN8m7Rd9vUIdnwPBJJbjA/r+Dnjw= +github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088 h1:FCEsDNLC9yrHHgjbyKor2dwdA1bQ5g4c7ZY/6wLULZY= +github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088/go.mod h1:72cIiRrj5BcJqtYFQy+fz53Wz/AeLoivIwUO42Ae/aY= +github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230921081203-89164087dac9 h1:KZfGSL/68+wK4jOqbGYtUtPOuQ8TVVO+YPM96Rxm70Y= +github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230921081203-89164087dac9/go.mod h1:JTRoxU5lUkkEQlwwokxw9L52imeneRujRYUrPkdZjC0= +github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230920142821-e84784bede25 h1:DjZyZo2XoWZuZmXVU+P7RGFomVbfDosQuXR8AumN9ss= +github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230920142821-e84784bede25/go.mod h1:O1GPo8nmJ2yM5+xH89M4L9YiMkEAXHE160+tA6d0H+s= +github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230920143411-511d89a0e6cc h1:Y4+0OX8areIATKd/7izNFC2U8PCXZWLWfKhQN79hCyk= +github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230920143411-511d89a0e6cc/go.mod h1:rFtiDTgkoNa+Z+F0q87SIRINWm6gbgeaK3Uyl3bl/Tg= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44 h1:W2HZy+uk5fnVwvw3+/Jd/k7sNiVXCOd8SiV0dMvmjys= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44/go.mod h1:fOJ95wMSymtfoellY/TFKcrzW6bu/nTCTzEnFEgCGCc= github.com/openstack-k8s-operators/ironic-operator/api v0.1.1-0.20230915140049-df437872b34f h1:dDlJMlhvM6csW24Tf3X8SEW3rG2k08SBgV0ORR1Ts6w= github.com/openstack-k8s-operators/ironic-operator/api v0.1.1-0.20230915140049-df437872b34f/go.mod h1:51ig7IbGf7AjxeWi7+qvmRp0C5lp91e+HhXYTYlhVng= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230918093932-0512e2f335dd h1:pCYr/sI5oUA45Ff/tHsQQdKmmU4UoVbyCguJNKGXhHw= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230918093932-0512e2f335dd/go.mod h1:98HNU3wP40DHFI7YBr9nNjf2BdbcdUXlyyIg4odYo68= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230918105853-7a32db095b3d h1:TPj8NdoftSWVT95K8JNAYCQLFYk0pvC2OHxhxgleeks= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230918105853-7a32db095b3d h1:bbVgdhw3heFSSVsxjUHROvNrYaydcW0SbhsHBgUY/JE= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:WP90lfGH3YBS0Ie23Yr9pfzoq2RbWYyg+thYQAgTFz8= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230918105853-7a32db095b3d h1:cPvHbA/N7/zDUgAVxqNBs+7puYMYHGNu11tvgDEK4ys= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:DnsRBWOFEwecwrVAntM4lbgiHRvqfoz/gKYpDjkvCYE= -github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230916214930-2c2b11448ca0 h1:EME+DFx5uOLTr0WdtKTmtcEeLexL3MKdhfbQ3YHPlmo= -github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230916214930-2c2b11448ca0/go.mod h1:ql5AXzavvd29nkvPejuEmfFGyFrwGoAd0ARLzx0dz5c= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3 h1:6VCz/ZBTJEQJTx4+z8UxLv3WITa4Bgx5CSP237wJ5xM= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3/go.mod h1:ta6w/29i4WuWkQp6I4cOLwMGQ5/vJI0y8Em7u+M34jo= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216 h1:arYbQA6bLyXJkHm+6M6gPc4YpWMFjs5qkG16Yii4UDo= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216 h1:h76faqi4WAXBs3D2B0GLUdlCjS0dh78wRL0d5RZUwhk= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:GHi64tgyC75/vuT8Crda0yN5iCIYiSyS4bpzYJjX7MA= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216 h1:1dMwzjuZJSRgHcwblOo6jHrWAe2anwWu4w35Rukz1kw= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:DnsRBWOFEwecwrVAntM4lbgiHRvqfoz/gKYpDjkvCYE= +github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230921081246-996d4e390998 h1:BAxLz7+Bqz0M6INK4xDcod9cB2idOjRYyoPHqIySqK8= +github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230921081246-996d4e390998/go.mod h1:7nnls/xwOqOQWFZ84Orif2UQcWTdN32Xqd56y9TBhYI= github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c h1:9R8T1WRwuPS5KMfsQWxAMSGPuJrGMJ7bODKK9dirhHA= github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c/go.mod h1:xXHF/R/L0XamRHR/UkzlgzSTocBQ6GSQ2U16Q9Mf/bA= -github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230918064409-8ef2e76869c3 h1:j3cxYPlXlmFqSD5jYNnHxfjrKb8SD8ZqgkgB//h8dVk= -github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230918064409-8ef2e76869c3/go.mod h1:hn/5cDgN+hvPlNPZ6e6SIFo5wrjntg+3uGHny7WrrZs= -github.com/openstack-k8s-operators/nova-operator/api v0.1.2-0.20230918133139-6bec6fb25b25 h1:8PmVQMua8538u3M13Q1BGttKQ0vs/p/G94bBqRCfjxA= -github.com/openstack-k8s-operators/nova-operator/api v0.1.2-0.20230918133139-6bec6fb25b25/go.mod h1:FiLYIHuPP1nzEvf/03QG0DGBDXQsQU0OAuGDLxPcJDo= +github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230920145429-537b5afebd07 h1:jCfKZN9smTbdCbfOgDxa1JCzsrgNsO8fyZjikEArugo= +github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230920145429-537b5afebd07/go.mod h1:gyme//YzQKEWSn3i3S0oaNBjnMu/m2m0N13boSShBfE= github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230915083637-79fc51fd4dcf h1:e6peuUus9UjB8qpVH0MAUpwog7pHgSAH80cYpaLVKvU= github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230915083637-79fc51fd4dcf/go.mod h1:r8xZ27TZ5EPgH+EL6VRQRv0tIxlu0zNNvTnz9PjjZUg= github.com/openstack-k8s-operators/ovn-operator/api v0.1.1-0.20230913151226-aab30786ed97 h1:+nrBob4GwmRqhISqPiP7lhMwys2kJz1vYmLzKap+B7E= github.com/openstack-k8s-operators/ovn-operator/api v0.1.1-0.20230913151226-aab30786ed97/go.mod h1:0zpkMBsrFbFP+AfaJKvREHomqsXcPnUCOT0/LzKmga0= -github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230918155857-7af4ec18350b h1:nCpcDEKKVEYosNhmMpmmfDSdC3O8xGmBgpa9aLFcaTM= -github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230918155857-7af4ec18350b/go.mod h1:lsu2XlR/HbYoiUrRPBDbXLBoD+omzhK9zBSk4QJppmU= -github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230915130355-e5c2b0ff0af1 h1:MI+1sJuo+2ekYB/npq9BqMR0Ix03hpRXFOW5NGvL6Zo= -github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230915130355-e5c2b0ff0af1/go.mod h1:jnhL2sWJW7ABY/mQ0Mp95h0aJR6oh90/rgDINg3Sg88= +github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230920125340-3c99d09c7033 h1:/oIWCEllgIXQbjIj6i8NFK3yC5IHkflnMDSmdz2PeCs= +github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230920125340-3c99d09c7033/go.mod h1:gJmnk2QLICVEZXi2wDpr+baNMvey7RA50gJbRXzo0JA= +github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230920144258-a37c476a2829 h1:rUjN/Dfcxw7mqCQhc/BZw/cl4u9keuQsM4KhvMIDLaE= +github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230920144258-a37c476a2829/go.mod h1:YWvPPQwcCRfw5zaFp4KTdBKBiLt1h00LUMcnPkVSNVw= github.com/openstack-k8s-operators/telemetry-operator/api v0.1.1-0.20230914155337-2540bab64b80 h1:XaOUvjDKOfRO0h99Du/sSbzYT6W5g0cc+2JOiopTAEs= github.com/openstack-k8s-operators/telemetry-operator/api v0.1.1-0.20230914155337-2540bab64b80/go.mod h1:nYAEI/2u2DzXtZoMBIRkogHPpjskwrfJAJ/+XeIcosc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -199,6 +197,8 @@ 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.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stuggi/nova-operator/api v0.0.0-20230921063244-6a5e52bc352b h1:DEbawVg4d5py/YXmR4cme1TzXZj/gP1V6A2qr5tzQfk= +github.com/stuggi/nova-operator/api v0.0.0-20230921063244-6a5e52bc352b/go.mod h1:kyi9gsAg4d8hxjUxnjDTMZeps3xTutH2+FcAnz783m8= 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= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index a4faf9a3a..0dc0abd34 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -124,32 +124,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -158,6 +132,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -1227,27 +1252,6 @@ spec: dnsDataLabelSelectorValue: default: dnsdata type: string - externalEndpoints: - items: - properties: - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - - loadBalancerIPs - type: object - type: array nodeSelector: additionalProperties: type: string @@ -1281,6 +1285,53 @@ spec: - values type: object type: array + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -2893,32 +2944,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -2927,6 +2952,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object pvc: type: string replicas: @@ -2989,32 +3063,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -3023,6 +3071,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object pvc: type: string replicas: @@ -3166,6 +3263,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -3226,10 +3374,61 @@ spec: additionalProperties: type: string type: object - replicas: - default: 1 - format: int32 - maximum: 32 + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object + replicas: + default: 1 + format: int32 + maximum: 32 minimum: 0 type: integer resources: @@ -3399,6 +3598,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object preserveJobs: default: false type: boolean @@ -3439,20 +3687,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - route: - properties: - routeLocation: - type: string - routeName: - default: horizon - type: string - routeTLSCA: - type: string - routeTLSEnabled: - type: string - routeTLSKey: - type: string - type: object secret: type: string required: @@ -3929,6 +4163,107 @@ spec: type: object keystone: properties: + apiOverride: + properties: + route: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + alternateBackends: + items: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + maxItems: 3 + type: array + host: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + path: + pattern: ^/ + type: string + port: + properties: + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - targetPort + type: object + subdomain: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + tls: + properties: + caCertificate: + type: string + certificate: + type: string + destinationCACertificate: + type: string + insecureEdgeTerminationPolicy: + type: string + key: + type: string + termination: + enum: + - edge + - reencrypt + - passthrough + type: string + required: + - termination + type: object + to: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + wildcardPolicy: + enum: + - None + - Subdomain + - "" + type: string + type: object + type: object + type: object enabled: default: true type: boolean @@ -3965,32 +4300,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array memcachedInstance: default: memcached type: string @@ -4002,6 +4311,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: admin: AdminPassword @@ -4877,31 +5237,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -4910,6 +5245,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -5203,32 +5589,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array extraMounts: items: properties: @@ -5993,6 +6353,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: database: NeutronDatabasePassword @@ -6092,31 +6503,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6125,6 +6511,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6237,40 +6674,15 @@ spec: metadataServiceTemplate: properties: containerImage: - type: string - customServiceConfig: - type: string - defaultConfigOverwrite: - additionalProperties: - type: string - type: object - enabled: - type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array + type: string + customServiceConfig: + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + enabled: + type: boolean networkAttachments: items: type: string @@ -6279,6 +6691,53 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6329,31 +6788,6 @@ spec: type: object enabled: type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6362,6 +6796,55 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -6455,31 +6938,6 @@ spec: type: object enabled: type: boolean - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -6488,6 +6946,53 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object replicas: default: 1 format: int32 @@ -7021,32 +7526,6 @@ spec: additionalProperties: type: string type: object - externalEndpoints: - items: - properties: - endpoint: - enum: - - internal - - public - type: string - ipAddressPool: - minLength: 1 - type: string - loadBalancerIPs: - items: - type: string - type: array - sharedIP: - default: true - type: boolean - sharedIPKey: - default: "" - type: string - required: - - endpoint - - ipAddressPool - type: object - type: array networkAttachments: items: type: string @@ -7055,6 +7534,57 @@ spec: additionalProperties: type: string type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: database: PlacementDatabasePassword @@ -7493,6 +8023,12 @@ spec: type: object externalEndpoint: properties: + endpoint: + default: internal + enum: + - internal + - public + type: string ipAddressPool: minLength: 1 type: string @@ -11202,6 +11738,57 @@ spec: type: string containerImageProxy: type: string + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + type: object passwordSelectors: default: service: SwiftPassword diff --git a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml index 728fdb11f..68419222a 100644 --- a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml @@ -118,6 +118,24 @@ spec: path: keystone.enabled x-descriptors: - urn:alm:descriptor:com.tectonic.ui:booleanSwitch + - description: IPAddressPool expose VIP via MetalLB on the IPAddressPool + displayName: IPAddress Pool + path: keystone.externalEndpoints[0].ipAddressPool + - description: LoadBalancerIPs, request given IPs from the pool if available. + Using a list to allow dual stack (IPv4/IPv6) support + displayName: Load Balancer IPs + path: keystone.externalEndpoints[0].loadBalancerIPs + - description: SharedIP if true, VIP/VIPs get shared with multiple services + displayName: Shared IP + path: keystone.externalEndpoints[0].sharedIP + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:booleanSwitch + - description: SharedIPKey specifies the sharing key which gets set as the annotation + on the LoadBalancer service. Services which share the same VIP must have + the same SharedIPKey. Defaults to the IPAddressPool if SharedIP is true, + but no SharedIPKey specified. + displayName: Shared IPKey + path: keystone.externalEndpoints[0].sharedIPKey - description: Template - Overrides to use when creating the Keystone service displayName: Template path: keystone.template diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 1da890265..6c13715fa 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -81,6 +81,13 @@ rules: - get - list - watch +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list - apiGroups: - core.openstack.org resources: @@ -355,6 +362,26 @@ rules: - patch - update - watch +- apiGroups: + - route.openshift.io + resources: + - routes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - route.openshift.io + resources: + - routes/custom-host + verbs: + - create + - patch + - update - apiGroups: - security.openshift.io resourceNames: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml index 9c3369b72..52ec6ca86 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml @@ -82,14 +82,9 @@ spec: networkAttachments: - storage keystone: + apiOverride: + route: {} template: - databaseInstance: openstack - secret: osp-secret - externalEndpoints: - - endpoint: internal - ipAddressPool: internalapi - loadBalancerIPs: - - 172.17.0.80 override: service: internal: @@ -100,6 +95,8 @@ spec: metallb.universe.tf/loadBalancerIPs: 172.17.0.80 spec: type: LoadBalancer + databaseInstance: openstack + secret: osp-secret mariadb: enabled: false templates: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml index 42e1b9f21..f564e8981 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml @@ -82,14 +82,9 @@ spec: networkAttachments: - storage keystone: + apiOverride: + route: {} template: - databaseInstance: openstack - secret: osp-secret - externalEndpoints: - - endpoint: internal - ipAddressPool: internalapi - loadBalancerIPs: - - 172.17.0.80 override: service: internal: @@ -100,6 +95,8 @@ spec: metallb.universe.tf/loadBalancerIPs: 172.17.0.80 spec: type: LoadBalancer + databaseInstance: openstack + secret: osp-secret mariadb: enabled: false templates: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml index 19a218afa..3c04363cf 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml @@ -82,14 +82,9 @@ spec: networkAttachments: - storage keystone: + apiOverride: + route: {} template: - databaseInstance: openstack - secret: osp-secret - externalEndpoints: - - endpoint: internal - ipAddressPool: internalapi - loadBalancerIPs: - - 172.17.0.80 override: service: internal: @@ -100,6 +95,8 @@ spec: metallb.universe.tf/loadBalancerIPs: 172.17.0.80 spec: type: LoadBalancer + databaseInstance: openstack + secret: osp-secret mariadb: templates: openstack: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml index 10d6d819d..beffb0a10 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml @@ -127,14 +127,9 @@ spec: networkAttachments: - storage keystone: + apiOverride: + route: {} template: - databaseInstance: openstack - secret: osp-secret - externalEndpoints: - - endpoint: internal - ipAddressPool: internalapi - loadBalancerIPs: - - 172.17.0.80 override: service: internal: @@ -145,6 +140,8 @@ spec: metallb.universe.tf/loadBalancerIPs: 172.17.0.80 spec: type: LoadBalancer + databaseInstance: openstack + secret: osp-secret mariadb: templates: openstack: diff --git a/controllers/core/openstackcontrolplane_controller.go b/controllers/core/openstackcontrolplane_controller.go index 3758d7803..358efac33 100644 --- a/controllers/core/openstackcontrolplane_controller.go +++ b/controllers/core/openstackcontrolplane_controller.go @@ -20,6 +20,7 @@ import ( "context" "fmt" + routev1 "github.com/openshift/api/route/v1" cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" glancev1 "github.com/openstack-k8s-operators/glance-operator/api/v1beta1" heatv1 "github.com/openstack-k8s-operators/heat-operator/api/v1beta1" @@ -30,13 +31,16 @@ import ( 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/helper" + 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" corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" + "github.com/openstack-k8s-operators/openstack-operator/pkg/openstack" + 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" @@ -87,6 +91,9 @@ type OpenStackControlPlaneReconciler struct { //+kubebuilder:rbac:groups=swift.openstack.org,resources=swifts,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=octavia.openstack.org,resources=octavias,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=redis.openstack.org,resources=redises,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete; +//+kubebuilder:rbac:groups=route.openshift.io,resources=routes/custom-host,verbs=create;update;patch +//+kubebuilder:rbac:groups=core,resources=services,verbs=get;list; // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. @@ -152,9 +159,6 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr return ctrl.Result{}, nil } - // Reset all ReadyConditons to 'Unknown' - instance.InitConditions() - return r.reconcileNormal(ctx, instance, helper) } @@ -335,5 +339,6 @@ func (r *OpenStackControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) err Owns(&telemetryv1.Ceilometer{}). Owns(&redisv1.Redis{}). Owns(&octaviav1.Octavia{}). + Owns(&routev1.Route{}). Complete(r) } diff --git a/go.mod b/go.mod index f5554a473..7f6d211be 100644 --- a/go.mod +++ b/go.mod @@ -8,26 +8,26 @@ require ( github.com/imdario/mergo v0.3.16 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/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088 github.com/openstack-k8s-operators/dataplane-operator/api v0.1.1-0.20230919085012-e89d5ef2fafd - 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/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/openstack-ansibleee-operator/api v0.1.1-0.20230918170038-6c1275780727 github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9 github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-20230725141229-4ce90d0120fd 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/operator-framework/api v0.17.3 github.com/rabbitmq/cluster-operator v1.14.0 @@ -74,9 +74,9 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 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 //indirect + github.com/openshift/api v3.9.0+incompatible + 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 //indirect 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 @@ -101,7 +101,7 @@ require ( k8s.io/component-base v0.26.9 //indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515 //indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b //indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd //indirect sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect @@ -112,3 +112,5 @@ replace github.com/openstack-k8s-operators/openstack-operator/apis => ./apis // 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 diff --git a/go.sum b/go.sum index f4f5c5aba..11b4962b1 100644 --- a/go.sum +++ b/go.sum @@ -135,36 +135,34 @@ 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.2-0.20230915101724-27ac1650268d h1:FJkVYIG6hUwSP7zGuSTVi5Tay3EH8d8h6aS5wVAYNw0= -github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230915101724-27ac1650268d/go.mod h1:ntpA98K0eWjVUe32OAogE5NUMXc+CsNeneIlYRaKjd8= +github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088 h1:FCEsDNLC9yrHHgjbyKor2dwdA1bQ5g4c7ZY/6wLULZY= +github.com/openstack-k8s-operators/cinder-operator/api v0.1.2-0.20230921082510-1b9a7de3d088/go.mod h1:72cIiRrj5BcJqtYFQy+fz53Wz/AeLoivIwUO42Ae/aY= github.com/openstack-k8s-operators/dataplane-operator/api v0.1.1-0.20230919085012-e89d5ef2fafd h1:R2TWVLgY7M784L50hz3oVV4ITpNKBCTQjXNH2gwIkNM= github.com/openstack-k8s-operators/dataplane-operator/api v0.1.1-0.20230919085012-e89d5ef2fafd/go.mod h1:LnS0qiX6PvruiLuObi5jub8sbJ4XkMCjHPLak1uNXuQ= -github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230918155018-15e9a91ab099 h1:+B8EqaMrG6zPmH6YkAzA/UsTvlMUtNBPvoZHoibKDUs= -github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230918155018-15e9a91ab099/go.mod h1:EyWZbdyzJM2hEz1dDDo87oQic1HGUdi46vAtH6Y7DnU= -github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230919010505-829b985599de h1:c9AgISgzQLwxfb3WEuDVWfNvu0eVywsA/wDFlEFL77k= -github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230919010505-829b985599de/go.mod h1:cYYINAv7b89hsSvyzsDD5FEN4X0hC0J6tKomTxVrcTo= -github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230919030438-b18e8fb1bcc8 h1:mqZ6oKNoS7ym9xCIDZ43FbUQWpo7zZI52XLh4hMPM44= -github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230919030438-b18e8fb1bcc8/go.mod h1:brUv4XGvLPITO6Tn4fXTk6s4Ts/VMwDuFiypC2xclOc= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230918070031-70498d9b2fec h1:+8EYd1O5SO0wadEc8EYwTI0AdtCOxaAfg/dfS+rq5jM= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230918070031-70498d9b2fec/go.mod h1:G4vJpe0Hr2s1U+tjN8m7Rd9vUIdnwPBJJbjA/r+Dnjw= +github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230921081203-89164087dac9 h1:KZfGSL/68+wK4jOqbGYtUtPOuQ8TVVO+YPM96Rxm70Y= +github.com/openstack-k8s-operators/glance-operator/api v0.1.2-0.20230921081203-89164087dac9/go.mod h1:JTRoxU5lUkkEQlwwokxw9L52imeneRujRYUrPkdZjC0= +github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230920142821-e84784bede25 h1:DjZyZo2XoWZuZmXVU+P7RGFomVbfDosQuXR8AumN9ss= +github.com/openstack-k8s-operators/heat-operator/api v0.1.1-0.20230920142821-e84784bede25/go.mod h1:O1GPo8nmJ2yM5+xH89M4L9YiMkEAXHE160+tA6d0H+s= +github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230920143411-511d89a0e6cc h1:Y4+0OX8areIATKd/7izNFC2U8PCXZWLWfKhQN79hCyk= +github.com/openstack-k8s-operators/horizon-operator/api v0.1.1-0.20230920143411-511d89a0e6cc/go.mod h1:rFtiDTgkoNa+Z+F0q87SIRINWm6gbgeaK3Uyl3bl/Tg= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44 h1:W2HZy+uk5fnVwvw3+/Jd/k7sNiVXCOd8SiV0dMvmjys= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44/go.mod h1:fOJ95wMSymtfoellY/TFKcrzW6bu/nTCTzEnFEgCGCc= github.com/openstack-k8s-operators/ironic-operator/api v0.1.1-0.20230915140049-df437872b34f h1:dDlJMlhvM6csW24Tf3X8SEW3rG2k08SBgV0ORR1Ts6w= github.com/openstack-k8s-operators/ironic-operator/api v0.1.1-0.20230915140049-df437872b34f/go.mod h1:51ig7IbGf7AjxeWi7+qvmRp0C5lp91e+HhXYTYlhVng= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230918093932-0512e2f335dd h1:pCYr/sI5oUA45Ff/tHsQQdKmmU4UoVbyCguJNKGXhHw= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230918093932-0512e2f335dd/go.mod h1:98HNU3wP40DHFI7YBr9nNjf2BdbcdUXlyyIg4odYo68= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230918105853-7a32db095b3d h1:TPj8NdoftSWVT95K8JNAYCQLFYk0pvC2OHxhxgleeks= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230918105853-7a32db095b3d h1:bbVgdhw3heFSSVsxjUHROvNrYaydcW0SbhsHBgUY/JE= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:WP90lfGH3YBS0Ie23Yr9pfzoq2RbWYyg+thYQAgTFz8= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230918105853-7a32db095b3d h1:cPvHbA/N7/zDUgAVxqNBs+7puYMYHGNu11tvgDEK4ys= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230918105853-7a32db095b3d/go.mod h1:DnsRBWOFEwecwrVAntM4lbgiHRvqfoz/gKYpDjkvCYE= -github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230916214930-2c2b11448ca0 h1:EME+DFx5uOLTr0WdtKTmtcEeLexL3MKdhfbQ3YHPlmo= -github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230916214930-2c2b11448ca0/go.mod h1:ql5AXzavvd29nkvPejuEmfFGyFrwGoAd0ARLzx0dz5c= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3 h1:6VCz/ZBTJEQJTx4+z8UxLv3WITa4Bgx5CSP237wJ5xM= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3/go.mod h1:ta6w/29i4WuWkQp6I4cOLwMGQ5/vJI0y8Em7u+M34jo= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216 h1:arYbQA6bLyXJkHm+6M6gPc4YpWMFjs5qkG16Yii4UDo= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216 h1:h76faqi4WAXBs3D2B0GLUdlCjS0dh78wRL0d5RZUwhk= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:GHi64tgyC75/vuT8Crda0yN5iCIYiSyS4bpzYJjX7MA= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216 h1:1dMwzjuZJSRgHcwblOo6jHrWAe2anwWu4w35Rukz1kw= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:DnsRBWOFEwecwrVAntM4lbgiHRvqfoz/gKYpDjkvCYE= +github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230921081246-996d4e390998 h1:BAxLz7+Bqz0M6INK4xDcod9cB2idOjRYyoPHqIySqK8= +github.com/openstack-k8s-operators/manila-operator/api v0.1.1-0.20230921081246-996d4e390998/go.mod h1:7nnls/xwOqOQWFZ84Orif2UQcWTdN32Xqd56y9TBhYI= github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c h1:9R8T1WRwuPS5KMfsQWxAMSGPuJrGMJ7bODKK9dirhHA= github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c/go.mod h1:xXHF/R/L0XamRHR/UkzlgzSTocBQ6GSQ2U16Q9Mf/bA= -github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230918064409-8ef2e76869c3 h1:j3cxYPlXlmFqSD5jYNnHxfjrKb8SD8ZqgkgB//h8dVk= -github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230918064409-8ef2e76869c3/go.mod h1:hn/5cDgN+hvPlNPZ6e6SIFo5wrjntg+3uGHny7WrrZs= -github.com/openstack-k8s-operators/nova-operator/api v0.1.2-0.20230918133139-6bec6fb25b25 h1:8PmVQMua8538u3M13Q1BGttKQ0vs/p/G94bBqRCfjxA= -github.com/openstack-k8s-operators/nova-operator/api v0.1.2-0.20230918133139-6bec6fb25b25/go.mod h1:FiLYIHuPP1nzEvf/03QG0DGBDXQsQU0OAuGDLxPcJDo= +github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230920145429-537b5afebd07 h1:jCfKZN9smTbdCbfOgDxa1JCzsrgNsO8fyZjikEArugo= +github.com/openstack-k8s-operators/neutron-operator/api v0.1.1-0.20230920145429-537b5afebd07/go.mod h1:gyme//YzQKEWSn3i3S0oaNBjnMu/m2m0N13boSShBfE= github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230915083637-79fc51fd4dcf h1:e6peuUus9UjB8qpVH0MAUpwog7pHgSAH80cYpaLVKvU= github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-20230915083637-79fc51fd4dcf/go.mod h1:r8xZ27TZ5EPgH+EL6VRQRv0tIxlu0zNNvTnz9PjjZUg= github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230918170038-6c1275780727 h1:D/FWfsLEWNvIBxXRzJmQmzmwp/jZuap3JNicVWo5Eh4= @@ -173,10 +171,10 @@ github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.202 github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9/go.mod h1:9cWHjNK7MyiWxCx9779Mcieal5N0NLn75yraIlTuI2s= github.com/openstack-k8s-operators/ovn-operator/api v0.1.1-0.20230913151226-aab30786ed97 h1:+nrBob4GwmRqhISqPiP7lhMwys2kJz1vYmLzKap+B7E= github.com/openstack-k8s-operators/ovn-operator/api v0.1.1-0.20230913151226-aab30786ed97/go.mod h1:0zpkMBsrFbFP+AfaJKvREHomqsXcPnUCOT0/LzKmga0= -github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230918155857-7af4ec18350b h1:nCpcDEKKVEYosNhmMpmmfDSdC3O8xGmBgpa9aLFcaTM= -github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230918155857-7af4ec18350b/go.mod h1:lsu2XlR/HbYoiUrRPBDbXLBoD+omzhK9zBSk4QJppmU= -github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230915130355-e5c2b0ff0af1 h1:MI+1sJuo+2ekYB/npq9BqMR0Ix03hpRXFOW5NGvL6Zo= -github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230915130355-e5c2b0ff0af1/go.mod h1:jnhL2sWJW7ABY/mQ0Mp95h0aJR6oh90/rgDINg3Sg88= +github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230920125340-3c99d09c7033 h1:/oIWCEllgIXQbjIj6i8NFK3yC5IHkflnMDSmdz2PeCs= +github.com/openstack-k8s-operators/placement-operator/api v0.1.1-0.20230920125340-3c99d09c7033/go.mod h1:gJmnk2QLICVEZXi2wDpr+baNMvey7RA50gJbRXzo0JA= +github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230920144258-a37c476a2829 h1:rUjN/Dfcxw7mqCQhc/BZw/cl4u9keuQsM4KhvMIDLaE= +github.com/openstack-k8s-operators/swift-operator/api v0.1.1-0.20230920144258-a37c476a2829/go.mod h1:YWvPPQwcCRfw5zaFp4KTdBKBiLt1h00LUMcnPkVSNVw= github.com/openstack-k8s-operators/telemetry-operator/api v0.1.1-0.20230914155337-2540bab64b80 h1:XaOUvjDKOfRO0h99Du/sSbzYT6W5g0cc+2JOiopTAEs= github.com/openstack-k8s-operators/telemetry-operator/api v0.1.1-0.20230914155337-2540bab64b80/go.mod h1:nYAEI/2u2DzXtZoMBIRkogHPpjskwrfJAJ/+XeIcosc= github.com/operator-framework/api v0.17.3 h1:wddE1SLKTNiIzwt28DbBIO+vPG2GOV6dkB9xBkDfT3o= @@ -216,6 +214,8 @@ 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.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stuggi/nova-operator/api v0.0.0-20230921063244-6a5e52bc352b h1:DEbawVg4d5py/YXmR4cme1TzXZj/gP1V6A2qr5tzQfk= +github.com/stuggi/nova-operator/api v0.0.0-20230921063244-6a5e52bc352b/go.mod h1:kyi9gsAg4d8hxjUxnjDTMZeps3xTutH2+FcAnz783m8= 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= diff --git a/main.go b/main.go index 94eb16767..059a24789 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" + routev1 "github.com/openshift/api/route/v1" clientv1 "github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1" corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" clientcontrollers "github.com/openstack-k8s-operators/openstack-operator/controllers/client" @@ -100,6 +101,7 @@ func init() { utilruntime.Must(swiftv1.AddToScheme(scheme)) utilruntime.Must(clientv1.AddToScheme(scheme)) utilruntime.Must(redisv1.AddToScheme(scheme)) + utilruntime.Must(routev1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } diff --git a/pkg/openstack/common.go b/pkg/openstack/common.go index 760a87c0a..b4f9c6ffb 100644 --- a/pkg/openstack/common.go +++ b/pkg/openstack/common.go @@ -2,9 +2,21 @@ package openstack import ( "context" + "fmt" + "time" + routev1 "github.com/openshift/api/route/v1" + "github.com/openstack-k8s-operators/lib-common/modules/common" + "github.com/openstack-k8s-operators/lib-common/modules/common/condition" "github.com/openstack-k8s-operators/lib-common/modules/common/helper" + "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" + corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" + k8s_corev1 "k8s.io/api/core/v1" k8s_errors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -27,3 +39,213 @@ func EnsureDeleted(ctx context.Context, helper *helper.Helper, obj client.Object return ctrl.Result{}, nil } + +// AddServiceComponentLabel - adds component label to the service override to be able to query +// the service labels to check for any route creation +func AddServiceComponentLabel(svcOverride service.RoutedOverrideSpec, value string) service.RoutedOverrideSpec { + if svcOverride.EmbeddedLabelsAnnotations == nil { + svcOverride.EmbeddedLabelsAnnotations = &service.EmbeddedLabelsAnnotations{} + } + svcOverride.EmbeddedLabelsAnnotations.Labels = util.MergeStringMaps( + svcOverride.EmbeddedLabelsAnnotations.Labels, map[string]string{common.AppSelector: value}) + + return svcOverride +} + +// RouteDetails - route details +type RouteDetails struct { + RouteName string + Namespace string + Endpoint service.Endpoint + RouteOverrideSpec *route.OverrideSpec + ServiceLabel map[string]string + ServiceSpec *k8s_corev1.Service + endpointURL string + hostname *string + route *routev1.Route +} + +// GetRoutesListWithLabel - Get all routes in namespace of the obj matching label selector +func GetRoutesListWithLabel( + ctx context.Context, + h *helper.Helper, + namespace string, + labelSelectorMap map[string]string, +) (*routev1.RouteList, error) { + routeList := &routev1.RouteList{} + listOpts := []client.ListOption{ + client.InNamespace(namespace), + client.MatchingLabels(labelSelectorMap), + } + + if err := h.GetClient().List(ctx, routeList, listOpts...); err != nil { + err = fmt.Errorf("Error listing routes for %s: %w", labelSelectorMap, err) + return nil, err + } + + return routeList, nil +} + +// EnsureRoute - +func EnsureRoute( + ctx context.Context, + instance *corev1.OpenStackControlPlane, + helper *helper.Helper, + owner metav1.Object, + svcs *k8s_corev1.ServiceList, + svcOverrides map[service.Endpoint]service.RoutedOverrideSpec, + overrideSpec *route.OverrideSpec, + condType condition.Type, +) (map[service.Endpoint]service.RoutedOverrideSpec, ctrl.Result, error) { + + cleanCondition := true + + for _, svc := range svcs.Items { + rd := RouteDetails{ + RouteName: svc.Name, + Namespace: svc.Namespace, + Endpoint: service.Endpoint(svc.Annotations[service.AnnotationEndpointKey]), + RouteOverrideSpec: overrideSpec, + ServiceSpec: &svc, + } + svcOverride := svcOverrides[rd.Endpoint] + + // check if there is already a route with common.AppSelector from the service + if svcLabelVal, ok := svc.Labels[common.AppSelector]; ok { + routes, err := GetRoutesListWithLabel( + ctx, + helper, + instance.Namespace, + map[string]string{common.AppSelector: svcLabelVal}, + ) + if err != nil { + return svcOverrides, ctrl.Result{}, err + } + + // check the routes if name changed where we are the owner + for _, r := range routes.Items { + instanceRef := metav1.OwnerReference{ + APIVersion: instance.APIVersion, + Kind: instance.Kind, + Name: instance.GetName(), + UID: instance.GetUID(), + BlockOwnerDeletion: ptr.To(true), + Controller: ptr.To(true), + } + + owner := metav1.GetControllerOf(&r.ObjectMeta) + + // Delete the route if the service was changed not to expose a route + if svc.ObjectMeta.Annotations[service.AnnotationIngressCreateKey] == "false" && + r.Spec.To.Name == svc.Name && + owner != nil && owner.UID == instance.GetUID() { + // Delete any other owner refs from ref list to not block deletion until owners are gone + r.SetOwnerReferences([]metav1.OwnerReference{instanceRef}) + + // Delete route + err := helper.GetClient().Delete(ctx, &r) + if err != nil && !k8s_errors.IsNotFound(err) { + err = fmt.Errorf("Error deleting route %s: %w", r.Name, err) + return svcOverrides, ctrl.Result{}, err + } + + if svcOverride.EndpointURL != nil { + svcOverride.EndpointURL = nil + helper.GetLogger().Info(fmt.Sprintf("Service %s override endpointURL removed", svc.Name)) + } + } + } + } + + // If the service has the create ingress annotation and its a default ClusterIP service -> create route + if svc.ObjectMeta.Annotations[service.AnnotationIngressCreateKey] == "true" && svc.Spec.Type == k8s_corev1.ServiceTypeClusterIP { + if instance.Status.Conditions.Get(condType) == nil { + instance.Status.Conditions.Set(condition.UnknownCondition( + condType, + condition.InitReason, + corev1.OpenStackControlPlaneExposeServiceReadyInitMessage, + owner.GetName(), + svc.Name, + )) + } + + if svcOverride.EmbeddedLabelsAnnotations == nil { + svcOverride.EmbeddedLabelsAnnotations = &service.EmbeddedLabelsAnnotations{} + } + + if labelVal, ok := svcOverride.EmbeddedLabelsAnnotations.Labels[common.AppSelector]; ok { + rd.ServiceLabel = map[string]string{common.AppSelector: labelVal} + } + + ctrlResult, err := rd.CreateRoute(ctx, helper, owner) + if err != nil { + instance.Status.Conditions.Set(condition.FalseCondition( + condType, + condition.ErrorReason, + condition.SeverityWarning, + corev1.OpenStackControlPlaneExposeServiceReadyErrorMessage, + owner.GetName(), + rd.RouteName, + err.Error())) + + return svcOverrides, ctrlResult, err + } else if (ctrlResult != ctrl.Result{}) { + return svcOverrides, ctrlResult, nil + } + + cleanCondition = false + + // update override for the service with the route endpoint url + if rd.endpointURL != "" { + // Any trailing path will be added on the service-operator level. + svcOverride.EndpointURL = &rd.endpointURL + instance.Status.Conditions.MarkTrue(condType, corev1.OpenStackControlPlaneExposeServiceReadyMessage, owner.GetName()) + } + } + + svcOverrides[rd.Endpoint] = svcOverride + } + + if cleanCondition { + instance.Status.Conditions.Remove(condType) + } + + return svcOverrides, ctrl.Result{}, nil +} + +// CreateRoute - +func (rd *RouteDetails) CreateRoute( + ctx context.Context, + helper *helper.Helper, + owner metav1.Object, +) (ctrl.Result, error) { + // TODO TLS + route, err := route.NewRoute( + route.GenericRoute(&route.GenericRouteDetails{ + Name: rd.RouteName, + Namespace: rd.Namespace, + Labels: rd.ServiceLabel, + ServiceName: rd.ServiceSpec.Name, + TargetPortName: rd.ServiceSpec.Name, + }), + time.Duration(5)*time.Second, + rd.RouteOverrideSpec, + ) + if err != nil { + return ctrl.Result{}, err + } + route.OwnerReferences = append(route.OwnerReferences, owner) + + ctrlResult, err := route.CreateOrPatch(ctx, helper) + if err != nil { + return ctrlResult, err + } else if (ctrlResult != ctrl.Result{}) { + return ctrlResult, nil + } + + rd.hostname = ptr.To(route.GetHostname()) + rd.endpointURL = "http://" + *rd.hostname + rd.route = route.GetRoute() + + return ctrl.Result{}, nil +} diff --git a/pkg/openstack/keystone.go b/pkg/openstack/keystone.go index b84846c9b..4aa507c12 100644 --- a/pkg/openstack/keystone.go +++ b/pkg/openstack/keystone.go @@ -4,14 +4,19 @@ import ( "context" "fmt" + "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/condition" "github.com/openstack-k8s-operators/lib-common/modules/common/helper" + "github.com/openstack-k8s-operators/lib-common/modules/common/service" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/reconcile" keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1" corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" + k8s_errors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" ) @@ -29,12 +34,61 @@ func ReconcileKeystoneAPI(ctx context.Context, instance *corev1beta1.OpenStackCo return res, err } instance.Status.Conditions.Remove(corev1beta1.OpenStackControlPlaneKeystoneAPIReadyCondition) + instance.Status.Conditions.Remove(corev1beta1.OpenStackControlPlaneExposeKeystoneAPIReadyCondition) return ctrl.Result{}, nil } + // add selector to service overrides + for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} { + if instance.Spec.Keystone.Template.Override.Service == nil { + instance.Spec.Keystone.Template.Override.Service = map[service.Endpoint]service.RoutedOverrideSpec{} + } + instance.Spec.Keystone.Template.Override.Service[endpointType] = + AddServiceComponentLabel( + instance.Spec.Keystone.Template.Override.Service[endpointType], + keystoneAPI.Name) + } + + // When component services got created check if there is the need to create a route + if err := helper.GetClient().Get(ctx, types.NamespacedName{Name: "keystone", Namespace: instance.Namespace}, keystoneAPI); err != nil { + if !k8s_errors.IsNotFound(err) { + return ctrl.Result{}, err + } + } + + if keystoneAPI.Status.Conditions.IsTrue(condition.ExposeServiceReadyCondition) { + svcs, err := service.GetServicesListWithLabel( + ctx, + helper, + instance.Namespace, + map[string]string{common.AppSelector: keystoneAPI.Name}, + ) + if err != nil { + return ctrl.Result{}, err + } + + var ctrlResult reconcile.Result + instance.Spec.Keystone.Template.Override.Service, ctrlResult, err = EnsureRoute( + ctx, + instance, + helper, + keystoneAPI, + svcs, + instance.Spec.Keystone.Template.Override.Service, + instance.Spec.Keystone.APIOverride.Route, + corev1beta1.OpenStackControlPlaneExposeKeystoneAPIReadyCondition, + ) + if err != nil { + return ctrlResult, err + } else if (ctrlResult != ctrl.Result{}) { + return ctrlResult, nil + } + } + helper.GetLogger().Info("Reconciling KeystoneAPI", "KeystoneAPI.Namespace", instance.Namespace, "KeystoneAPI.Name", "keystone") op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), keystoneAPI, func() error { instance.Spec.Keystone.Template.DeepCopyInto(&keystoneAPI.Spec) + if keystoneAPI.Spec.Secret == "" { keystoneAPI.Spec.Secret = instance.Spec.Secret } @@ -76,5 +130,4 @@ func ReconcileKeystoneAPI(ctx context.Context, instance *corev1beta1.OpenStackCo } return ctrl.Result{}, nil - }