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

feat(ingress): aws alb #294

Merged

Conversation

Hunter-Thompson
Copy link
Contributor

@Hunter-Thompson Hunter-Thompson commented Jul 21, 2022

TODO:

  • Add tests

Summary

Add option for AWS ALB Ingress

See:

  1. https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/
  2. https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/

Issue Link

Fixes #293

API

apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
  name: mm-example-full                         # Chose the desired name
spec:
  size: 5000users                               # Adjust to your requirements
  awsLoadBalancerController:
    enabled: true
    hosts: 
      - hostName: 'asd.example.com'
    certificateARN: 'asdasd'
    internetFacing: true
  version: 6.0.1
  licenseSecret: ""  

Release Note

Adds an option to configure an AWS ALB instead of the default Nginx Ingress

@mm-cloud-bot mm-cloud-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 21, 2022
@mattermod
Copy link

Hello @Hunter-Thompson,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement?
Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

@Hunter-Thompson
Copy link
Contributor Author

/check-cla

@Hunter-Thompson Hunter-Thompson marked this pull request as draft July 21, 2022 16:24
@mattermod
Copy link

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@gabrieljackson
Copy link
Collaborator

Hey @Hunter-Thompson, just checking in to see if you are still working on this PR. We have been keeping an eye on it while you have had it opened as a draft. Let us know if you want to chat about anything regarding this functionality. Thanks!

@Hunter-Thompson
Copy link
Contributor Author

@gabrieljackson went away for awhile. Il be working on it this week.

Quick question, has apis/mattermost/v1alpha1 been deprecated in favor of apis/mattermost/v1beta1?

Do I have to make changes in both places or is v1beta1 fine?

@gabrieljackson
Copy link
Collaborator

Hey @Hunter-Thompson, yes only updating v1beta is fine here. v1alpha is deprecated as you mentioned.

Let us know if you need any additional support with this.

@Hunter-Thompson Hunter-Thompson marked this pull request as ready for review September 19, 2022 16:05
@Hunter-Thompson
Copy link
Contributor Author

@gabrieljackson could you have a look at the API and let me know if youd like changes? If no changes are required - Il start writing unit tests.

Copy link
Contributor

@Szymongib Szymongib left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Regarding the API, since it impacts both creation of service and ingress, I suppose it makes sense to keep it as a separate spec field. I am a bit worried about complexity implications, but it does look like a useful feature.

apis/mattermost/v1beta1/mattermost_types.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@gabrieljackson gabrieljackson left a comment

Choose a reason for hiding this comment

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

@Hunter-Thompson let us know if you need any support making the change that @Szymongib proposed. Thanks!

@Hunter-Thompson
Copy link
Contributor Author

Hunter-Thompson commented Oct 22, 2022

@gabrieljackson I've made the changes proposed. If the API looks good, I can start testing in my local Kubernetes cluster and also write unit tests.

@Hunter-Thompson Hunter-Thompson requested review from gabrieljackson and Szymongib and removed request for gabrieljackson and Szymongib October 22, 2022 09:47
Hunter-Thompson added 2 commits October 22, 2022 16:36
weird interaction with GetIngressEnabled, it returns true by default
this could be a problem when checking for other ingress options like aws ingress
Copy link
Contributor

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Hey @Hunter-Thompson, thanks a lot for your contribution! It took me a while to get up to speed with everything so apologies for the delayed response!

I've reviewed your contribution and it's good to go for the most part, but I've added some comments regarding naming conventions, some clauses I found confusing and testing coverage. Please check them out and reach out if you have any questions.

Again, thank you for your time on this! Greatly appreciated.

Edited: Actually though about this but didn't wrote it for whatever reason, so just dumping this here for the future: Just wondering since we're going to have one ingress only if we should encapsulate logic for ingresses in our own custom type, same as we do for other things. Right now logic is straightforward for the supported ones, but that would get crazy with time, so just throwing this idea out in the open.

apis/mattermost/v1beta1/mattermost_utils.go Outdated Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
apis/mattermost/v1beta1/mattermost_utils.go Outdated Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Outdated Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Outdated Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Outdated Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost_test.go Outdated Show resolved Hide resolved
@Hunter-Thompson
Copy link
Contributor Author

@fmartingr, thanks for review. Ive pushed a new commit addressing some of the points. Il start working on better tests soon.

@fmartingr
Copy link
Contributor

@fmartingr, thanks for review. Ive pushed a new commit addressing some of the points. Il start working on better tests soon.

Awesome, thanks! Just re-request my review or ping me once you're done so I can take a look :)

@Hunter-Thompson
Copy link
Contributor Author

@fmartingr, thanks for review. Ive pushed a new commit addressing some of the points. Il start working on better tests soon.

Awesome, thanks! Just re-request my review or ping me once you're done so I can take a look :)

@fmartingr, I changed the tests a bit, and added a few new ones.

It covers:

  1. disable aws lb and enable aws lb
  2. check if resources are deleted properly after enabling and disabling

Could you review?

@Hunter-Thompson Hunter-Thompson requested review from fmartingr and removed request for gabrieljackson November 8, 2022 07:52
Copy link
Contributor

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Hey @Hunter-Thompson, thanks for taking care of that! It looks good to me. @gabrieljackson I've re-requested your 👀 's here as well.

@Hunter-Thompson
Copy link
Contributor Author

Did you get a chance to review @gabrieljackson?

@Hunter-Thompson
Copy link
Contributor Author

bump

@fmartingr fmartingr requested review from mirshahriar and removed request for gabrieljackson November 28, 2022 10:46
@fmartingr
Copy link
Contributor

Hey @mirshahriar, since Gabe is pretty busy, would you mind taking a look at this?

@mirshahriar
Copy link
Contributor

Hey @mirshahriar, since Gabe is pretty busy, would you mind taking a look at this?

I'll have a look today.

Copy link
Contributor

@mirshahriar mirshahriar left a comment

Choose a reason for hiding this comment

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

I added a few comments.

controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Outdated Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Show resolved Hide resolved
pkg/mattermost/mattermost_v1beta.go Outdated Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
apis/mattermost/v1beta1/mattermost_utils.go Show resolved Hide resolved
controllers/mattermost/mattermost/mattermost.go Outdated Show resolved Hide resolved
@mirshahriar mirshahriar self-requested a review November 28, 2022 16:09
Copy link
Contributor

@mirshahriar mirshahriar left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for your time and work.

Copy link
Collaborator

@gabrieljackson gabrieljackson left a comment

Choose a reason for hiding this comment

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

Thanks for working with us to get this ready to be merged! It will be included in the next operator release.

@gabrieljackson gabrieljackson added 3: Reviews Complete All reviewers have approved the pull request and removed Lifecycle/1:stale null labels Dec 5, 2022
@gabrieljackson gabrieljackson merged commit aa3dcab into mattermost:master Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS ALB Ingress option
7 participants