Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update glanceapi to use service override #309

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

stuggi
Copy link
Contributor

@stuggi stuggi commented Sep 7, 2023

Removes creation of routes.Those get done in the openstack-operator. Via service overrides the service can be customized. The service operator adds annotation to the service which needs to be exposed as a route.

Jira: OSP-26690

Depends-On: openstack-k8s-operators/lib-common#332
Depends-On: openstack-k8s-operators/keystone-operator#307

@openshift-ci openshift-ci bot requested review from abays and dprince September 7, 2023 07:50
@stuggi
Copy link
Contributor Author

stuggi commented Sep 7, 2023

/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

})

// add Annotation to whether creating an ingress is required or not
if endpointType == service.EndpointPublic && svc.GetServiceType() == corev1.ServiceTypeClusterIP {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuggi I think I understand the main change here: we create the service at the service operator level, we annotate the service with AnnotationIngressCreateKey = "core.openstack.org/ingress_create" in case we need to build an ingress.
E.g. :

apiVersion: v1
kind: Service
metadata:
  annotations:
    core.openstack.org/ingress_create: "true"
    core.openstack.org/ingress_name: glance

Does the openstack-operator watches for the Service resources and create the Routes for the services that are created with those annotations ?
In the Glance use case this would end up having a Route only for the GlanceAPIExternal, while the internal endpoint is still tied to metalLB ipaddresspool, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuggi I think I understand the main change here: we create the service at the service operator level, we annotate the service with AnnotationIngressCreateKey = "core.openstack.org/ingress_create" in case we need to build an ingress. E.g. :

apiVersion: v1
kind: Service
metadata:
  annotations:
    core.openstack.org/ingress_create: "true"
    core.openstack.org/ingress_name: glance

Does the openstack-operator watches for the Service resources and create the Routes for the services that are created with those annotations ?

It does not watch the services, it watches the service CR it creates, e.g. glance. When glance updates its status because of condition update, or so, the openstack-operator reconciles and checks the services of glance. For those with the annotation it creates the route and passes in the endpointURL for the service. In a follow up for TLS it then passes the https url to be used for register in keystone. For TLS-E it then will then also create the cert ans passes in the secret name to be used by glance api.

In the Glance use case this would end up having a Route only for the GlanceAPIExternal, while the internal endpoint is still tied to metalLB ipaddresspool, right?

yes correct. the internal endpoint can be customized using the service override, but for now we don't expect to create a route for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack it works from me, I'm overall +1 with this change, I was trying to properly understand the interaction between the openstack-operator (that is supposed to create the Route) and the <Service>operator, that is supposed to build the service and register endpoints in keystone.

- "172.17.0.202"
sharedIP: true
sharedIPKey: ""
override:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to provide a sample file in config/samples? It can be a follow up though, so we can have a final working solution w/ tls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we don't have a sample for the current one, I planned to only have a network-isolation sample in the openstack-operator as it is today. but we can also add a sample here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, we can provide a sample based on the basic openstackcontrolplane in a follow up, the description in the Readme is enough.

// APIOverrideSpec to override the generated manifest of several child resources.
type APIOverrideSpec struct {
// Override configuration for the Service created to serve traffic to the cluster.
Service *service.RoutedOverrideSpec `json:"service,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this replace actually the way we used to config services w/ metallb and we're going to provide RouteOverrides under annotations form:

        override:
          service:
            metadata:
              annotations:
                metallb.universe.tf/address-pool: internalapi
                metallb.universe.tf/allow-shared-ip: internalapi
                metallb.universe.tf/loadBalancerIPs: 172.17.0.90
            spec:
              type: LoadBalancer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, via the overrides you pass in the annotation used for the LoadBalancer you use, metallb here (but could be also a different one. The benefit is that its native k8s service style and probably known by users if they already are familiar with k8s

@stuggi stuggi force-pushed the handle_ingress_v3 branch 4 times, most recently from 2656dbf to aa05d80 Compare September 20, 2023 09:24
@abays
Copy link
Contributor

abays commented Sep 20, 2023

@stuggi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
Test name Commit Details Required Rerun command
ci/prow/glance-operator-build-deploy-tempest aa05d80 link true /test glance-operator-build-deploy-tempest
ci/prow/glance-operator-build-deploy-kuttl aa05d80 link true /test glance-operator-build-deploy-kuttl

Full PR test history. Your PR dashboard.

Hiccup

  - lastTransitionTime: "2023-09-20T10:21:52Z"
    message: 'OpenStackControlPlane OVN error occured Internal error occurred: failed
      calling webhook "movndbcluster.kb.io": failed to call webhook: Post "https://ovn-operator-controller-manager-service.openstack-operators.svc:443/mutate-ovn-openstack-org-v1beta1-ovndbcluster?timeout=10s":
      no endpoints available for service "ovn-operator-controller-manager-service"'
    reason: Error
    severity: Warning
    status: "False"

/test glance-operator-build-deploy-kuttl

@stuggi
Copy link
Contributor Author

stuggi commented Sep 20, 2023

/test functional

@stuggi
Copy link
Contributor Author

stuggi commented Sep 20, 2023

The issue we right now is that the we are building the new operator with the current version of the openstack-operator which has not the functionality to create the route for the new service operator version. With this the public endpoint will be a ClusterIP service and is not reachable by the tempest job which is running outside the OCP env.

I think we have two options:

  • update the current samples in the openstack-operator for network-isolation (if that is used by tempest) to also use a LoadBalancer type service for the public endpoint and see if that works for the tempest job
  • force merge with failed tempest job result until we merged the openstack-operator PR

@stuggi
Copy link
Contributor Author

stuggi commented Sep 20, 2023

The issue we right now is that the we are building the new operator with the current version of the openstack-operator which has not the functionality to create the route for the new service operator version. With this the public endpoint will be a ClusterIP service and is not reachable by the tempest job which is running outside the OCP env.

I think we have two options:

  • update the current samples in the openstack-operator for network-isolation (if that is used by tempest) to also use a LoadBalancer type service for the public endpoint and see if that works for the tempest job

This would only work if the host tempest is running is using our DNS server where the service endpoint gets registered

  • force merge with failed tempest job result until we merged the openstack-operator PR

Removes creation of routes.Those get done in the openstack-operator.
Via service overrides the service can be customized. The service operator
adds annotation to the service which needs to be exposed as a route.

Jira: OSP-26690

Depends-On: openstack-k8s-operators/lib-common#332
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2023

@stuggi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/glance-operator-build-deploy-tempest 82f0dc7 link true /test glance-operator-build-deploy-tempest

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@fmount
Copy link
Contributor

fmount commented Sep 21, 2023

The issue we right now is that the we are building the new operator with the current version of the openstack-operator which has not the functionality to create the route for the new service operator version. With this the public endpoint will be a ClusterIP service and is not reachable by the tempest job which is running outside the OCP env.

I think we have two options:

* update the current samples in the openstack-operator for network-isolation (if that is used by tempest) to also use a LoadBalancer type service for the public endpoint and see if that works for the tempest job

* force merge with failed tempest job result until we merged the openstack-operator PR

I agree we should force-merge these patches and avoid growing the patch series to get the Routes creation moved at the openstack-operator level.
I'm going to force-merge this and work with @stuggi to land the whole patch chain, otherwise any other patch will be stuck failing in CI.

@fmount fmount merged commit 8916408 into openstack-k8s-operators:main Sep 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants