-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ReferenceGrant from Gateway to Secret (#791)
Problem: NKG does not support cross-namespace Secret references on Gateway. Solution: Add support for ReferenceGrants that permit Gateways to reference Secrets in different namespaces. NKG now processes ReferenceGrants and verifies that Gateways with references to Secrets in different Namespaces have a corresponding ReferenceGrant. If no ReferenceGrant exists, the RefNotPermitted reason is used in all the listener conditions (Accepted, Programmed, and ResolvedRefs), and the listener is marked invalid. Secrets will only be resolved if the reference is permitted. No additional validation is needed for ReferenceGrant as it does not correspond to any nginx config. We treat every upsert/delete of a ReferenceGrant as a change. This means we will regenerate nginx config every time a ReferenceGrant is created, updated (generation must change), or deleted, even if it does not apply to the accepted Gateway.
- Loading branch information
1 parent
bae93c1
commit e6e149d
Showing
22 changed files
with
714 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ rules: | |
- gatewayclasses | ||
- gateways | ||
- httproutes | ||
- referencegrants | ||
verbs: | ||
- list | ||
- watch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
examples/https-termination/cafe-secret.yaml → ...ation/certificate-ns-and-cafe-secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ spec: | |
certificateRefs: | ||
- kind: Secret | ||
name: cafe-secret | ||
namespace: default | ||
namespace: certificate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: ReferenceGrant | ||
metadata: | ||
name: allow-default-to-cafe-secret | ||
namespace: certificate | ||
spec: | ||
to: | ||
- group: "" | ||
kind: Secret | ||
name: cafe-secret # if you omit this name, then Gateways in default ns can access all Secrets in the certificate ns | ||
from: | ||
- group: gateway.networking.k8s.io | ||
kind: Gateway | ||
namespace: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.