-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial gateway reconcile logic (#1059)
Add a new GatewayConfig model type to represent all Gateway-defined configuration, and a corresponding GatewayReconciler interface for taking this model and generating Pomerium configuration. Update DataBrokerReconciler to implement this new interface, with initial logic for converting from Gateway-defined routes to Pomerium routes.
- Loading branch information
1 parent
480d02c
commit 29f64f8
Showing
11 changed files
with
380 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ words: | |
- deepcopy | ||
- envtest | ||
- filemgr | ||
- hostnames | ||
- mockgen | ||
- oidc | ||
- pomerium | ||
|
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Package model contains common data structures between the controller and pomerium config reconciler | ||
package model | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
gateway_v1 "sigs.k8s.io/gateway-api/apis/v1" | ||
) | ||
|
||
// GatewayConfig represents the entirety of the Gateway-defined configuration. | ||
type GatewayConfig struct { | ||
Routes []GatewayHTTPRouteConfig | ||
Certificates []*corev1.Secret | ||
} | ||
|
||
// GatewayHTTPRouteConfig represents a single Gateway-defined route together | ||
// with all objects needed to translate it into Pomerium routes. | ||
type GatewayHTTPRouteConfig struct { | ||
*gateway_v1.HTTPRoute | ||
|
||
// Hostnames this route should match. This may differ from the list of Hostnames in the | ||
// HTTPRoute Spec depending on the Gateway configuration. "All" is represented as "*". | ||
Hostnames []gateway_v1.Hostname | ||
|
||
// ValidBackendRefs determines which BackendRefs are allowed to be used for route "To" URLs. | ||
ValidBackendRefs BackendRefChecker | ||
|
||
// Services is a map of all known services in the cluster. | ||
Services map[types.NamespacedName]*corev1.Service | ||
} | ||
|
||
// BackendRefChecker is used to determine which BackendRefs are valid. | ||
type BackendRefChecker interface { | ||
Valid(obj client.Object, r *gateway_v1.BackendRef) bool | ||
} |
Oops, something went wrong.