Skip to content

Commit

Permalink
Merge branch 'main' into oidc-backendcluster
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohuabing authored Oct 1, 2024
2 parents 9518072 + 0f4cb27 commit 9605e35
Show file tree
Hide file tree
Showing 141 changed files with 6,908 additions and 4,685 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps
# Generate the installation manifests first, so it can check
# for errors while running `make -k lint`
Expand All @@ -31,14 +31,14 @@ jobs:
gen-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps
- run: make -k gen-check

license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps
- run: make -k licensecheck

Expand All @@ -48,7 +48,7 @@ jobs:
contents: read # for actions/checkout
id-token: write # for fetching OIDC token
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

# test
Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
needs: [lint, gen-check, license-check, coverage-test]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Build EG Multiarch Binaries
Expand All @@ -87,7 +87,7 @@ jobs:
matrix:
version: [ v1.28.13, v1.29.8, v1.30.4, v1.31.0 ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Download EG Binaries
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
matrix:
version: [ v1.28.13, v1.29.8, v1.30.4, v1.31.0 ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Download EG Binaries
Expand All @@ -143,7 +143,7 @@ jobs:
if: ${{ ! startsWith(github.event_name, 'push') }}
needs: [build]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Setup Graphviz
Expand All @@ -170,7 +170,7 @@ jobs:
runs-on: ubuntu-latest
needs: [conformance-test, e2e-test]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Download EG Binaries
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Initialize CodeQL
uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -48,7 +48,7 @@ jobs:
contents: write
steps:
- name: Git checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/experimental_conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
version: [ v1.28.13, v1.29.8, v1.30.4, v1.31.0 ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

# gateway api experimental conformance
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/latest_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
benchmark-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Setup Graphviz
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Generate Release Manifests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Run scanner
uses: google/osv-scanner-action/osv-scanner-action@f0e6719deb666cd19a0b56bc56d01161bd848b4f # v1.8.5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
benchmark-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./tools/github-actions/setup-deps

- name: Setup Graphviz
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Extract Release Tag and Commit SHA
id: vars
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
persist-credentials: false

Expand All @@ -40,6 +40,6 @@ jobs:
retention-days: 5

- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Build an image from Dockerfile
run: |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
[![OSV-Scanner](https://github.com/envoyproxy/gateway/actions/workflows/osv-scanner.yml/badge.svg)](https://github.com/envoyproxy/gateway/actions/workflows/osv-scanner.yml)
[![Trivy](https://github.com/envoyproxy/gateway/actions/workflows/trivy.yml/badge.svg)](https://github.com/envoyproxy/gateway/actions/workflows/trivy.yml)

![Envoy Gateway Logo](https://github.com/cncf/artwork/blob/main/projects/envoy/envoy-gateway/horizontal/color/envoy-gateway-horizontal-color.svg)

Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or
Kubernetes-based application gateway.
[Gateway API](https://gateway-api.sigs.k8s.io) resources are used to dynamically provision and configure the managed Envoy Proxies.
Expand Down
22 changes: 22 additions & 0 deletions api/v1alpha1/accesslogging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,30 @@ type ProxyAccessLogSetting struct {
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=50
Sinks []ProxyAccessLogSink `json:"sinks"`
// Type defines the component emitting the accesslog, such as Listener and Route.
// If type not defined, the setting would apply to:
// (1) All Routes.
// (2) Listeners if and only if Envoy does not find a matching route for a request.
// If type is defined, the accesslog settings would apply to the relevant component (as-is).
// +kubebuilder:validation:Enum=Listener;Route
// +optional
// +notImplementedHide
Type *ProxyAccessLogType `json:"type,omitempty"`
}

type ProxyAccessLogType string

const (
// ProxyAccessLogTypeListener defines the accesslog for Listeners.
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-field-config-listener-v3-listener-access-log
ProxyAccessLogTypeListener ProxyAccessLogType = "Listener"
// ProxyAccessLogTypeRoute defines the accesslog for HTTP, GRPC, UDP and TCP Routes.
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto#envoy-v3-api-field-extensions-filters-udp-udp-proxy-v3-udpproxyconfig-access-log
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/tcp_proxy/v3/tcp_proxy.proto#envoy-v3-api-field-extensions-filters-network-tcp-proxy-v3-tcpproxy-access-log
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-field-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-access-log
ProxyAccessLogTypeRoute ProxyAccessLogType = "Route"
)

type ProxyAccessLogFormatType string

const (
Expand Down
7 changes: 7 additions & 0 deletions api/v1alpha1/backendtrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ type BackendTrafficPolicySpec struct {
// +optional
// +notImplementedHide
Compression []*Compression `json:"compression,omitempty"`

// ResponseOverride defines the configuration to override specific responses with a custom one.
// If multiple configurations are specified, the first one to match wins.
//
// +optional
// +notImplementedHide
ResponseOverride []*ResponseOverride `json:"responseOverride,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
13 changes: 11 additions & 2 deletions api/v1alpha1/envoyproxy_metric_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ type ProxyMetrics struct {
Matches []StringMatch `json:"matches,omitempty"`

// EnableVirtualHostStats enables envoy stat metrics for virtual hosts.
EnableVirtualHostStats bool `json:"enableVirtualHostStats,omitempty"`
//
// +optional
EnableVirtualHostStats *bool `json:"enableVirtualHostStats,omitempty"`

// EnablePerEndpointStats enables per endpoint envoy stats metrics.
// Please use with caution.
EnablePerEndpointStats bool `json:"enablePerEndpointStats,omitempty"`
//
// +optional
EnablePerEndpointStats *bool `json:"enablePerEndpointStats,omitempty"`

// EnableRequestResponseSizesStats enables publishing of histograms tracking header and body sizes of requests and responses.
//
// +optional
EnableRequestResponseSizesStats *bool `json:"enableRequestResponseSizesStats,omitempty"`
}

// ProxyMetricSink defines the sink of metrics.
Expand Down
79 changes: 79 additions & 0 deletions api/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,82 @@ type HTTP2Settings struct {
// +optional
OnInvalidMessage *InvalidMessageAction `json:"onInvalidMessage,omitempty"`
}

// ResponseOverride defines the configuration to override specific responses with a custom one.
type ResponseOverride struct {
// Match configuration.
Match CustomResponseMatch `json:"match"`
// Response configuration.
Response CustomResponse `json:"response"`
}

// CustomResponseMatch defines the configuration for matching a user response to return a custom one.
type CustomResponseMatch struct {
// Status code to match on. The match evaluates to true if any of the matches are successful.
StatusCode []StatusCodeMatch `json:"statusCode"`
}

// StatusCodeValueType defines the types of values for the status code match supported by Envoy Gateway.
// +kubebuilder:validation:Enum=Value;Range
type StatusCodeValueType string

type StatusCodeMatch struct {
// Type is the type of value.
//
// +kubebuilder:default=Value
// +unionDiscriminator
Type *StatusCodeValueType `json:"type"`

// Value contains the value of the status code.
//
// +optional
Value *string `json:"value,omitempty"`
// ValueRef contains the contents of the body
// specified as a local object reference.
// Only a reference to ConfigMap is supported.
//
// +optional
Range *StatusCodeRange `json:"range,omitempty"`
}

// StatusCodeRange defines the configuration for define a range of status codes.
type StatusCodeRange struct {
// Start of the range, including the start value.
Start int `json:"start"`
// End of the range, including the end value.
End int `json:"end"`
}

// CustomResponse defines the configuration for returning a custom response.
type CustomResponse struct {
// Content Type of the response. This will be set in the Content-Type header.
//
// +optional
ContentType *string `json:"contentType,omitempty"`

// Body of the Custom Response
Body CustomResponseBody `json:"body"`
}

// ResponseValueType defines the types of values for the response body supported by Envoy Gateway.
// +kubebuilder:validation:Enum=Inline;ValueRef
type ResponseValueType string

// CustomResponseBody
type CustomResponseBody struct {
// Type is the type of method to use to read the body value.
//
// +unionDiscriminator
Type *ResponseValueType `json:"type"`

// Inline contains the value as an inline string.
//
// +optional
Inline *string `json:"inline,omitempty"`
// ValueRef contains the contents of the body
// specified as a local object reference.
// Only a reference to ConfigMap is supported.
//
// +optional
ValueRef *gwapiv1.LocalObjectReference `json:"valueRef,omitempty"`
}
3 changes: 2 additions & 1 deletion api/v1alpha1/tracing_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type TracingProviderType string
const (
TracingProviderTypeOpenTelemetry TracingProviderType = "OpenTelemetry"
TracingProviderTypeZipkin TracingProviderType = "Zipkin"
TracingProviderTypeDatadog TracingProviderType = "Datadog"
)

// TracingProvider defines the tracing provider configuration.
Expand All @@ -37,7 +38,7 @@ const (
type TracingProvider struct {
BackendCluster `json:",inline"`
// Type defines the tracing provider type.
// +kubebuilder:validation:Enum=OpenTelemetry;Zipkin
// +kubebuilder:validation:Enum=OpenTelemetry;Zipkin;Datadog
// +kubebuilder:default=OpenTelemetry
Type TracingProviderType `json:"type"`
// Host define the provider service hostname.
Expand Down
Loading

0 comments on commit 9605e35

Please sign in to comment.