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

Add helper for setting up MicroCloud proxy #287

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

masnax
Copy link
Contributor

@masnax masnax commented Apr 18, 2024

Should be merged after #259

In response to reviews from #259, I've added some additional commits to update the microcluster dependency, fix contexts, and add 2 new helpers:

  • UseAuthProxy which applies the auth proxy used to manage the API of other services to a microcluster Client. This is now used in place of manually applying the proxy all over the place.
  • AuthProxy which returns the actual proxy implementation, so we can also reduce the duplication for LXD's client which is not the same structure as microcluster's.

microcloud/client/proxy.go Fixed Show fixed Hide fixed
@masnax
Copy link
Contributor Author

masnax commented May 3, 2024

@roosterfish @markylaing This one is now ready for review, thanks.

@masnax
Copy link
Contributor Author

masnax commented May 3, 2024

Ah crap, the microcluster changes clash with MicroCeph. I guess this is blocked on MicroCeph updating to the latest microcluster.

client/proxy.go Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@markylaing markylaing left a comment

Choose a reason for hiding this comment

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

Looks good, I think it'd be worth splitting this into two PRs though. One for the dependency update and another for the auth proxy helpers.

service/microceph.go Outdated Show resolved Hide resolved
cmd/microcloud/waitready.go Outdated Show resolved Hide resolved
Copy link
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

All the comments I had on those changes were already addressed over in #260 as those commits are included over there too.

The changes look good to me :) I'll approve as soon as #320 is merged so this PR contains only the proxy related changes.

service/lxd.go Outdated Show resolved Hide resolved
Copy link
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

This applies a proxy to a microcluster client for a different service,
which instead sends the request to be handled by the MicroCloud daemon,
which then forwards it to the unix socket of the corresponding service.

If a secret is given, it sets `InsecureSkipVerify` so that we can skip
TLS in favour of the pre-cluster-formation auth secret in the request
header.

Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
@masnax masnax dismissed markylaing’s stale review June 24, 2024 14:45

Addressed changes

@masnax masnax merged commit 99bbef6 into canonical:main Jun 24, 2024
15 checks passed
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