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

Create list of all ServiceCatalog api-server custom features #2703

Closed
mszostok opened this issue Feb 11, 2019 · 2 comments
Closed

Create list of all ServiceCatalog api-server custom features #2703

mszostok opened this issue Feb 11, 2019 · 2 comments
Assignees
Labels
area/service-management Issues or PRs related to service management kind/feature Categorizes issue or PR as related to a new feature.

Comments

@mszostok
Copy link
Contributor

mszostok commented Feb 11, 2019

Description

We need to remove the Service Catalog api-server and replace it with the CRD
functionality. To do that we need to check the api-server and find all customization. Create a list of them and prepare scenario how they can be addressed by the CRD concept.

Create follow-up tickets for all found customization, like replacing the api-server plugins with proper mutation/validation webhooks.

All restrictions should be documented (e.g. requirement of using the K8s in version 1.11 or higher) and discussed if it's acceptable or not.

Here we also should have the Service Catalog without api-server which is supporting basic scenarios.

AC

  • all customization of Service Catalog api-server are detected
  • follow-up tickets for implementing found customization with CRDs are defined
  • Service Catalog is working with CRD with minimal scope
@mszostok mszostok added kind/feature Categorizes issue or PR as related to a new feature. area/service-management Issues or PRs related to service management labels Feb 11, 2019
@mszostok
Copy link
Contributor Author

mszostok commented Feb 11, 2019

Findings from simple scenario

✅ Ready to implement






⚠️ Needs decision


  • controller-manager is using the FieldSelector. This feature is not supported for CRD. You can query only by name and namespace. Here is the k8s tests documenting that contract.
    Issue: Replace FieldSelector with LabelSelector in SC #2794

    Click for details

    Highlights:

    Using a field selector to look up a single object in a list is extremely inefficient today. We'd likely need a way to build indexes before supporting that query pattern across all objects (especially across namespaces)

    source: Issue about generic fieldSelector

    Based on that comment, maybe the FieldSelector is not a good solution at all ;)

    Solution:

    1. Replace with proper indexer for particular informer. See POC implementation.
    2. Use the LabelSelector and decorate the resource with additional labels, e.g.:

    service-catalog.k8s.io/spec.clusterServiceBrokerName: helm-broker

    It's redundant because you have this information under spec and also in labels but e.g. Prow is using this approach.

    Concerns:

    • We need to choose one approach. Consult someone from k8s. The K8s Office Hours

  • api-server provides the generic subresources on your CR. Service Catalog is using that to store the references.
    Issue: Replace Service Catalog references store #2836

    Click for details

    Unfortunately, this is not supported in CRDs, see CRD docs.

    NOTE: It looks like only the ServiceInstance is using that. Here is PR which introduced that.

    Solution:

    1. Replace sub-resource operation with patch. See POC implementation.

    Concerns:

    • check if this approach is acceptable, cause it's not replacing whole sub-resource functionality, e.g. the RBAC

❓Needs investigation

Additional notes:

  • api-server sets the Finalizers using the PrepareForCreate. Is this the right place to do that?

  • Service Catalog still has the PodPreset functionality in the source code, should we migrate it, or just remove?

  • implementation of the controllers is tightly coupled. IMO we should get rid of it and replace with the pattern introduced by the kubebuilder where each controller has it owns struct and constructor. Check this one to see the pattern.

Still to address:

  • manual check api-server for customization
  • check the features gates. Document those used by api-server and check if they are not deprecated.
  • which packages can be removed after switching to CRDs?

@MHBauer
Copy link

MHBauer commented Mar 5, 2019

I shouted some things out in a Svc-Cat meeting. Can't find the recording. Were there any other questions? @jberkhahn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/service-management Issues or PRs related to service management kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants