Skip to content

Support API Gateway #1108

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

Merged
merged 67 commits into from
Jun 15, 2020
Merged

Support API Gateway #1108

merged 67 commits into from
Jun 15, 2020

Conversation

tthebst
Copy link
Contributor

@tthebst tthebst commented Jun 2, 2020

closes #1077


checklist:

  • run make test and make lint
  • test manually (i.e. build/push all images, restart operator, and re-deploy APIs)
  • update examples
  • update docs and add any new files to summary.md (view in gitbook after merging)
  • cherry-pick into release branches if applicable
  • alert the dev team if the dev environment changed

@tthebst tthebst requested a review from deliahu June 2, 2020 19:59
Copy link
Member

@deliahu deliahu left a comment

Choose a reason for hiding this comment

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

This looks really good, nice job figuring out the AWS APIs / CLI!

I added some comments, and I also made some edits. Mostly they were minor edits or rearranging of code. Here are some of the things I changed:

  • I replaced occurrences of e.g. loadBalancerScheme.String() == "internet-facing" with loadBalancerScheme == clusterconfig.InternetFacingLoadBalancerScheme
  • In create_gateway_integration.py, I passed client_elb into the helper functions
  • You can ignore the diff in install.sh, since that was just minor formatting
  • I moved the code around in lib/aws/apigateway.go, it will probably be easier to look at the new file instead of looking at the diff. The main change is that I tried to make everything in that file not cortex-specific, since we try to keep cortex-specific code out of the lib packages. There were some other more minor changes in this file.
  • I updated operator/gateway.go to use the updated functions from lib/aws/apigateway.go. This file will also be easier to see if you open the new version rather than comparing the diff.
  • In operator/api.go, I rearranged it so that it will still attempt to delete all resources even if API gateway deletion fails. I also updated GetSpecForRunningAPI() and getAPIIDForRunningAPI() to return nil/empty if the API is not running (rather than panic)

I didn't try running all of my changes, since I wanted to run them by you first; what do you think, does this all make sense?

Also, I noticed that you decided to query the API Gateway from AWS when necessary, rather than adding the API Gateway information to the config package. Is there a reason you went with this approach instead of loading it in config.Init()?

If you've setup API gateway and want to delete it, please follow these [instructions](../guides/api-gateway.md#cleanup).

If you've configured HTTPS by specifying an SSL Certificate for a subdomain in your cluster configuration, you may wish to remove the SSL Certificate and Hosted Zone for the domain by following these [instructions](../guides/subdomain-https-setup.md#cleanup).
If you've configured a custom domain for your APIs, you may wish to remove the SSL Certificate and Hosted Zone for the domain by following these [instructions](../guides/custom-domain.md#cleanup).
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you may wish to remove -> you may remove

Copy link
Member

@deliahu deliahu left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks again for adding this!

@deliahu deliahu changed the title Api gateway Support API Gateway Jun 15, 2020
@tthebst tthebst merged commit bdf8ccd into master Jun 15, 2020
@tthebst tthebst deleted the api-gateway branch June 15, 2020 16:34
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.

Support API Gateway
3 participants