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

Remove last remaining connection to kubeops from dashboard. #3812

Merged
merged 5 commits into from
Nov 25, 2021

Conversation

absoludity
Copy link
Contributor

@absoludity absoludity commented Nov 24, 2021

Signed-off-by: Michael Nelson minelson@vmware.com

Description of the change

Now that the dashboard is using the helm plugin for all helm-related functionality, we have no need for the connection to the kubeops service.

This PR just removes the two small references which are unused afaict.

With this, I believe we can indeed remove the kubeops (and already assetsvc) services? Not sure if we want to do that as part of this release. We'd have to update the internal content team tests I assume. What do you think Antonio?

I've additionally removed the config from the frontend so that no requests are forwarded to the kubeops or assetsvc services to see if anything breaks.

Benefits

Less moving parts :)

Possible drawbacks

None here, but if we remove the kubeops/assetsvc from the code and chart, we'll need to update the content teams tests or similar.

Applicable issues

Additional information

Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

I have a slight preference for avoiding "breaking" changes in a patch release. Considering a possible scenario where someone is using the kubeops API directly, dropping support for it in the upcoming version is too heavy, IMO.
I'd just conditionally render the nginx rules based on the enabled property of the kubeops deployment (or sth similar). See what you think!

Re: removing it from the UI code, 100% agree

# Ex: from "/api/assetsvc/what$2Fever?param=value"
# it matches as $1="/what$2Fever" and $args="param=value"
# downstream services will receive "/assetsvc/what$2Fever?param=value"
location ~* /api/assetsvc {
Copy link
Contributor

Choose a reason for hiding this comment

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

Although, in theory, it is safe to remove this piece of code, I wouldn't do it in a soon-to-be patch release. What if we just render this excerpt if assetsvc.enabled=true ? And it is in the next minor that we effectively remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah true. I'd forgotten that people could potentially be using the current kubeops outside of our dashboard usage. +1 for just putting it behind a flag like you've done for assetsvc.

proxy_pass {{ include "kubeapps.frontend-config.proxy_pass" . -}};
}

location ~* /api/kubeops {
Copy link
Contributor

Choose a reason for hiding this comment

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

Idem here. I'd conditionally render that part based on a kubeops.enabled thing rather than removing it.


proxy_pass {{ include "kubeapps.frontend-config.proxy_pass" . -}};
}

location ~* /apis {
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, this is also a reminiscence of our beloved Kubeops service, I guess, but it is mostly aimed at handling can-i and other auth stuff mainly, I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I think it's the one further down (/api/ not /apis/, the latter being kubeapps-apis)? But yes, you're right - that one has a proxy_pass of:

        proxy_pass {{ include "kubeapps.frontend-config.proxy_pass" . -}};

which I missed because I was grepping for kubeops in the config. But this helper does indeed just proxy to the kubeops service (not sure why it's labeled frontend-config).

@@ -100,16 +98,4 @@ export class App {
installedPackageRef,
} as DeleteInstalledPackageRequest);
}

// TODO(agamez): remove it once we return the generated resources as part of the InstalledPackageDetail.
Copy link
Contributor

Choose a reason for hiding this comment

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

Great 🎉

Also conditionally removes kubeops from install.

Signed-off-by: Michael Nelson <minelson@vmware.com>
@absoludity
Copy link
Contributor Author

I have a slight preference for avoiding "breaking" changes in a patch release. Considering a possible scenario where someone is using the kubeops API directly, dropping support for it in the upcoming version is too heavy, IMO. I'd just conditionally render the nginx rules based on the enabled property of the kubeops deployment (or sth similar). See what you think!

PTAL, I've done this instead (as well as updated the assetsvc frontend config stanza to be conditional on its similar enabled flag). Also put all the kubeops resources within a similar condition (matching assetsvc). Only difference is that kubeops.enabled of course currently defaults to true.

Thanks Antonio.

## @param kubeops.enabled Specifies whether this component should be installed.
## In a future release we will be setting this to default to false.
##
enabled: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, new param... let me re-run the readme generator to also add it here

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia
Copy link
Contributor

PTAL, I've done this instead (as well as updated the assetsvc frontend config stanza to be conditional on its similar enabled flag). Also put all the kubeops resources within a similar condition (matching assetsvc). Only difference is that kubeops.enabled of course currently defaults to true.

Awesome, thank you for taking it into account. I mean, I really want to get rid of the old kubeops code (and some logic it calls under pkg/...), but we have to be good citizens :P
That said... next release... 🔥

I've added a commit after executing the readminator .

@antgamdia antgamdia merged commit b44dcc9 into vmware-tanzu:master Nov 25, 2021
@absoludity absoludity deleted the 3779-delete-get-release branch November 25, 2021 22:32
@mecampbellsoup
Copy link
Contributor

Are there docs anywhere on migrating from old versions where we relied on kubeops, to newer versions that use kubeappasapis?

@absoludity
Copy link
Contributor Author

The migration at the time was transparent to the user... we'd gradually moved API calls from the Kubeapps dashboard client across to the new apis service during a few releases until this PR where we removed the last API call.

Unless you're calling APIs on the kubeops service yourself explicitly from your own client or something, there should be no migration needed? If you are doing so, let us know your usage, happy to point you in the right direction to use the new API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants