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

Allow Consul API Gateway controller to read ReferencePolicy #1148

Merged
merged 1 commit into from Apr 7, 2022

Conversation

nathancoleman
Copy link
Member

@nathancoleman nathancoleman commented Apr 6, 2022

This is a prerequisite for hashicorp/consul-api-gateway#142 being included in a release.

Changes proposed in this PR:
Allow the Consul API Gateway controller to get, list and watch ReferencePolicy from the k8s Gateway API. This will allow the controller to verify that a route is allowed to send traffic to a service in a different namespace.

In this example, the ReferencePolicy allows any HTTPRoute in the gateway-conformance-infra namespace to attach to the web-backend service in the gateway-conformance-web-backend namespace. Without this policy, cross-namespace routing will be blocked at some point in the future.

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: ReferencePolicy
metadata:
  name: reference-policy
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Service
      name: web-backend

How I've tested this PR:
Consumed in our conformance testing Actions workflow here

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...)

@nathancoleman nathancoleman requested review from mikemorris, sarahalsmiller, a team, jmurret and ishustava and removed request for a team April 6, 2022 19:14
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.

None yet

5 participants