Skip to content

Commit

Permalink
Merge branch 'main' into api-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
guydc authored May 9, 2024
2 parents d9d30f6 + 33443f8 commit 24cee08
Show file tree
Hide file tree
Showing 232 changed files with 412 additions and 402 deletions.
1 change: 0 additions & 1 deletion api/v1alpha1/envoyproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ type EnvoyProxySpec struct {
// - envoy.filters.http.router
//
// +optional
// +notImplementedHide
FilterOrder []FilterPosition `json:"filterOrder,omitempty"`
// BackendTLS is the TLS configuration for the Envoy proxy to use when connecting to backends.
// These settings are applied on backends for which TLS policies are specified.
Expand Down
26 changes: 23 additions & 3 deletions api/v1alpha1/loadbalancer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type LoadBalancer struct {
// "ConsistentHash",
// "LeastRequest",
// "Random",
// "RoundRobin",
// "RoundRobin".
//
// +unionDiscriminator
Type LoadBalancerType `json:"type"`
Expand Down Expand Up @@ -52,18 +52,38 @@ const (
)

// ConsistentHash defines the configuration related to the consistent hash
// load balancer policy
// load balancer policy.
// +union
//
// +kubebuilder:validation:XValidation:rule="self.type == 'Header' ? has(self.header) : !has(self.header)",message="If consistent hash type is header, the header field must be set."
type ConsistentHash struct {
// ConsistentHashType defines the type of input to hash on. Valid Type values are "SourceIP" or "Header".
//
// +unionDiscriminator
Type ConsistentHashType `json:"type"`

// Header configures the header hash policy when the consistent hash type is set to Header.
//
// +optional
Header *Header `json:"header,omitempty"`
}

// Header defines the header hashing configuration for consistent hash based
// load balancing.
type Header struct {
// Name of the header to hash.
Name string `json:"name"`
}

// ConsistentHashType defines the type of input to hash on.
// +kubebuilder:validation:Enum=SourceIP
// +kubebuilder:validation:Enum=SourceIP;Header
type ConsistentHashType string

const (
// SourceIPConsistentHashType hashes based on the source IP address.
SourceIPConsistentHashType ConsistentHashType = "SourceIP"
// HeaderConsistentHashType hashes based on a request header.
HeaderConsistentHashType ConsistentHashType = "Header"
)

// SlowStart defines the configuration related to the slow start load balancer policy.
Expand Down
22 changes: 21 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions charts/gateway-helm/crds/gatewayapi-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: backendlbpolicies.gateway.networking.k8s.io
Expand Down Expand Up @@ -581,7 +581,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
labels:
Expand Down Expand Up @@ -1185,7 +1185,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: gatewayclasses.gateway.networking.k8s.io
Expand Down Expand Up @@ -1737,7 +1737,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: gateways.gateway.networking.k8s.io
Expand Down Expand Up @@ -4223,7 +4223,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: grpcroutes.gateway.networking.k8s.io
Expand Down Expand Up @@ -8909,7 +8909,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: httproutes.gateway.networking.k8s.io
Expand Down Expand Up @@ -15389,7 +15389,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: referencegrants.gateway.networking.k8s.io
Expand Down Expand Up @@ -15776,7 +15776,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: tcproutes.gateway.networking.k8s.io
Expand Down Expand Up @@ -16601,7 +16601,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: tlsroutes.gateway.networking.k8s.io
Expand Down Expand Up @@ -17499,7 +17499,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2997
gateway.networking.k8s.io/bundle-version: v1.1.0-rc2
gateway.networking.k8s.io/bundle-version: v1.1.0
gateway.networking.k8s.io/channel: experimental
creationTimestamp: null
name: udproutes.gateway.networking.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,30 @@ spec:
ConsistentHash defines the configuration when the load balancer type is
set to ConsistentHash
properties:
header:
description: Header configures the header hash policy when
the consistent hash type is set to Header.
properties:
name:
description: Name of the header to hash.
type: string
required:
- name
type: object
type:
description: ConsistentHashType defines the type of input
to hash on.
to hash on. Valid Type values are "SourceIP" or "Header".
enum:
- SourceIP
- Header
type: string
required:
- type
type: object
x-kubernetes-validations:
- message: If consistent hash type is header, the header field
must be set.
rule: 'self.type == ''Header'' ? has(self.header) : !has(self.header)'
slowStart:
description: |-
SlowStart defines the configuration related to the slow start load balancer policy.
Expand All @@ -444,7 +459,7 @@ spec:
"ConsistentHash",
"LeastRequest",
"Random",
"RoundRobin",
"RoundRobin".
enum:
- ConsistentHash
- LeastRequest
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/envoyproxy/gateway

go 1.22.2
go 1.22.3

require (
fortio.org/fortio v1.63.7
Expand Down Expand Up @@ -51,7 +51,7 @@ require (
k8s.io/kubectl v0.30.0
k8s.io/utils v0.0.0-20240423183400-0849a56e8f22
sigs.k8s.io/controller-runtime v0.18.1
sigs.k8s.io/gateway-api v1.1.0-rc2
sigs.k8s.io/gateway-api v1.1.0
sigs.k8s.io/mcs-api v0.1.0
sigs.k8s.io/yaml v1.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gE
sigs.k8s.io/controller-runtime v0.18.1 h1:RpWbigmuiylbxOCLy0tGnq1cU1qWPwNIQzoJk+QeJx4=
sigs.k8s.io/controller-runtime v0.18.1/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw=
sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI=
sigs.k8s.io/gateway-api v1.1.0-rc2 h1:uMHSylqzNHYD4kgp6OCDZv9o7ukzgtjuI6G6/e+TSUo=
sigs.k8s.io/gateway-api v1.1.0-rc2/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs=
sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM=
sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4=
Expand Down
10 changes: 9 additions & 1 deletion internal/cmd/egctl/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (

supportedXPolicyTypes = []string{
gatewayapi.KindBackendTLSPolicy, gatewayapi.KindBackendTrafficPolicy, gatewayapi.KindClientTrafficPolicy,
gatewayapi.KindSecurityPolicy, gatewayapi.KindEnvoyPatchPolicy,
gatewayapi.KindSecurityPolicy, gatewayapi.KindEnvoyPatchPolicy, gatewayapi.KindEnvoyExtensionPolicy,
}

supportedAllTypes = []string{
Expand Down Expand Up @@ -238,6 +238,14 @@ func runStatus(ctx context.Context, cli client.Client, inputResourceType, namesp
resourcesList = &epp
resourceKind = gatewayapi.KindEnvoyPatchPolicy

case "eep", "envoyextensionpolicy":
eep := egv1a1.EnvoyExtensionPolicyList{}
if err := cli.List(ctx, &eep, client.InNamespace(namespace)); err != nil {
return err
}
resourcesList = &eep
resourceKind = gatewayapi.KindEnvoyExtensionPolicy

case "sp", "securitypolicy":
sp := egv1a1.SecurityPolicyList{}
if err := cli.List(ctx, &sp, client.InNamespace(namespace)); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ grpcRoutes:
- method:
method: DoThing
service: com.example.Things
sessionPersistence: null
status:
parents:
- conditions:
Expand Down Expand Up @@ -362,7 +361,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
"port": 3000,
"weight": 1
}
],
"sessionPersistence": null
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ grpcRoutes:
- method:
method: DoThing
service: com.example.Things
sessionPersistence: null
status:
parents:
- conditions:
Expand Down Expand Up @@ -242,7 +241,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ grpcRoutes:
- method:
method: DoThing
service: com.example.Things
sessionPersistence: null
status:
parents:
- conditions:
Expand Down Expand Up @@ -235,7 +234,6 @@ httpRoutes:
- path:
type: PathPrefix
value: /
sessionPersistence: null
status:
parents:
- conditions:
Expand Down
Loading

0 comments on commit 24cee08

Please sign in to comment.