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

initial support for API Gateway #925

Merged
merged 13 commits into from
Jan 26, 2022
Merged

Conversation

nickethier
Copy link
Member

@nickethier nickethier commented Dec 10, 2021

Changes proposed in this PR:

  • Add support for installing the api-gateway controller from the Consul API Gateway project.
  • Extends server-acl-init to include a new token for the api-gateway controller

How I've tested this PR:

How I expect reviewers to test this PR:

Checklist:

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)

rrondeau pushed a commit to rrondeau/consul-k8s that referenced this pull request Dec 21, 2021
@ishustava ishustava requested review from a team, kschoche and ishustava and removed request for a team January 19, 2022 17:22
@nickethier nickethier marked this pull request as ready for review January 19, 2022 17:23
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

Looking really good, Nick!! I'm excited about this work to be merged 🎉

I'm leaving some comments I have so far mostly about our Helm chart conventions and also some questions/suggestions. I didn't look at the bats tests though.

@@ -0,0 +1,147 @@
{{- if (or (and (ne (.Values.apiGateway.enabled | toString) "-") .Values.apiGateway.enabled) (and (eq (.Values.apiGateway.enabled | toString) "-") .Values.global.enabled)) }}
{{- if not .Values.client.grpc }}{{ fail "client.grpc must be true for api gateway" }}{{ end }}
{{- if and .Values.global.adminPartitions.enabled (not .Values.global.enableConsulNamespaces) }}{{ fail "global.enableConsulNamespaces must be true if global.adminPartitions.enabled=true" }}{{ end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

If the api gw has other prerequisites, it'd be good add those validations here.

charts/consul/values.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Show resolved Hide resolved
charts/consul/values.yaml Show resolved Hide resolved
charts/consul/values.yaml Outdated Show resolved Hide resolved
Co-authored-by: Iryna Shustava <ishustava@users.noreply.github.com>
Copy link
Contributor

@ishustava ishustava 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, just a couple of minor comments.

+1 To Luke's comment about the unit tests for the ACL token.

I know we talked about adding an acceptance test, but I'm curious if you decided not to do it or do it in a separate PR?

Comment on lines 23 to 33
@test "apiGateway/Deployment: enable with global.enabled false, apiGateway.enabled true" {
cd `chart_dir`
local actual=$(helm template \
-s templates/api-gateway-controller-deployment.yaml \
--set 'global.enabled=false' \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=foo' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need this test and disable with global.enabled since the api gw is no longer inheriting from the global.enabled

charts/consul/values.yaml Outdated Show resolved Hide resolved
# @type: string
logLevel: info

managedGatewayClass:
Copy link
Contributor

Choose a reason for hiding this comment

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

This one also needs docs

@nickethier
Copy link
Member Author

Thanks @ishustava.

As far as acceptance test I had planned to follow up once we have release so there is a stable binary to reference from the test.

Co-authored-by: Iryna Shustava <ishustava@users.noreply.github.com>
Copy link
Contributor

@ishustava ishustava 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'm approving assuming the unit tests Luke mentioned are added. All of my recent comments are non-blocking

Copy link
Contributor

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

Just a bunch of drive-by suggestions to sync this PR with #993

@nickethier nickethier merged commit a64c8e7 into main Jan 26, 2022
@nickethier nickethier deleted the api-gateway/initial-support branch January 26, 2022 19:39
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.

5 participants