mirror of
https://github.com/alibaba/higress.git
synced 2026-06-03 17:47:25 +08:00
feat(gzip): add gzip configuration support and update default settings (#2867)
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Higress Core Helm Chart
|
||||
|
||||
Installs the core components of cloud-native gateway [Higress](http://higress.io/)
|
||||
|
||||
**Note:** It is highly recommended to install the whole package of Higress. Please visit https://higress.io/docs/user/quickstart/ for details.
|
||||
# Higress Core Helm Chart
|
||||
|
||||
Installs the core components of cloud-native gateway [Higress](http://higress.io/)
|
||||
|
||||
**Note:** It is highly recommended to install the whole package of Higress. Please visit https://higress.io/docs/user/quickstart/ for details.
|
||||
|
||||
@@ -112,6 +112,9 @@ data:
|
||||
{{- if hasKey .Values "downstream" }}
|
||||
{{- $_ := set $newData "downstream" .Values.downstream }}
|
||||
{{- end }}
|
||||
{{- if hasKey .Values "gzip" }}
|
||||
{{- $_ := set $newData "gzip" .Values.gzip }}
|
||||
{{- end }}
|
||||
{{- if and (hasKey .Values "tracing") .Values.tracing.enable }}
|
||||
{{- $_ := set $newData "tracing" .Values.tracing }}
|
||||
{{- end }}
|
||||
|
||||
@@ -732,6 +732,26 @@ upstream:
|
||||
idleTimeout: 10
|
||||
connectionBufferLimits: 10485760
|
||||
|
||||
# -- Gzip compression settings
|
||||
gzip:
|
||||
enable: true
|
||||
minContentLength: 1024
|
||||
contentType:
|
||||
- "text/html"
|
||||
- "text/css"
|
||||
- "text/plain"
|
||||
- "text/xml"
|
||||
- "application/json"
|
||||
- "application/javascript"
|
||||
- "application/xhtml+xml"
|
||||
- "image/svg+xml"
|
||||
disableOnEtagHeader: true
|
||||
memoryLevel: 5
|
||||
windowBits: 12
|
||||
chunkSize: 4096
|
||||
compressionLevel: "BEST_COMPRESSION"
|
||||
compressionStrategy: "DEFAULT_STRATEGY"
|
||||
|
||||
redis:
|
||||
redis:
|
||||
name: redis-stack-server
|
||||
|
||||
@@ -242,6 +242,7 @@ The command removes all the Kubernetes components associated with the chart and
|
||||
| global.useMCP | bool | `false` | Use the Mesh Control Protocol (MCP) for configuring Istiod. Requires an MCP source. |
|
||||
| global.watchNamespace | string | `""` | If not empty, Higress Controller will only watch resources in the specified namespace. When isolating different business systems using K8s namespace, if each namespace requires a standalone gateway instance, this parameter can be used to confine the Ingress watching of Higress within the given namespace. |
|
||||
| global.xdsMaxRecvMsgSize | string | `"104857600"` | |
|
||||
| gzip | object | `{"chunkSize":4096,"compressionLevel":"BEST_COMPRESSION","compressionStrategy":"DEFAULT_STRATEGY","contentType":["text/html","text/css","text/plain","text/xml","application/json","application/javascript","application/xhtml+xml","image/svg+xml"],"disableOnEtagHeader":true,"enable":true,"memoryLevel":5,"minContentLength":1024,"windowBits":12}` | Gzip compression settings |
|
||||
| hub | string | `"higress-registry.cn-hangzhou.cr.aliyuncs.com/higress"` | |
|
||||
| meshConfig | object | `{"enablePrometheusMerge":true,"rootNamespace":null,"trustDomain":"cluster.local"}` | meshConfig defines runtime configuration of components, including Istiod and istio-agent behavior See https://istio.io/docs/reference/config/istio.mesh.v1alpha1/ for all available options |
|
||||
| meshConfig.rootNamespace | string | `nil` | The namespace to treat as the administrative root namespace for Istio configuration. When processing a leaf namespace Istio will search for declarations in that namespace first and if none are found it will search in the root namespace. Any matching declaration found in the root namespace is processed as if it were declared in the leaf namespace. |
|
||||
|
||||
@@ -144,7 +144,7 @@ func deepCopyGzip(gzip *Gzip) (*Gzip, error) {
|
||||
|
||||
func NewDefaultGzip() *Gzip {
|
||||
gzip := &Gzip{
|
||||
Enable: false,
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
|
||||
@@ -374,7 +374,7 @@ func TestGzipController_AddOrUpdateHigressConfig(t *testing.T) {
|
||||
new: &HigressConfig{
|
||||
Gzip: &Gzip{
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
MinContentLength: 2048, // Changed from 1024 to make it different from default
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
MemoryLevel: 5,
|
||||
@@ -388,7 +388,7 @@ func TestGzipController_AddOrUpdateHigressConfig(t *testing.T) {
|
||||
wantEventPush: "push",
|
||||
wantGzip: &Gzip{
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
MinContentLength: 2048, // Changed from 1024 to make it different from default
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
MemoryLevel: 5,
|
||||
|
||||
@@ -1077,4 +1077,4 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -73,25 +73,12 @@ var testCases = []struct {
|
||||
},
|
||||
},
|
||||
envoyAssertion: envoy.Assertion{
|
||||
Path: "configs.#.dynamic_listeners.#.active_state.listener.filter_chains",
|
||||
Path: "configs.#.dynamic_listeners.#.active_state.listener.filter_chains.#.filters.#.typed_config.http_filters",
|
||||
TargetNamespace: "higress-system",
|
||||
CheckType: envoy.CheckTypeNotExist,
|
||||
ExpectEnvoyConfig: map[string]interface{}{
|
||||
"memory_level": 5,
|
||||
"compression_level": "COMPRESSION_LEVEL_9",
|
||||
"window_bits": 12,
|
||||
"min_content_length": 1024,
|
||||
"disable_on_etag_header": true,
|
||||
"content_type": []interface{}{
|
||||
"text/html",
|
||||
"text/css",
|
||||
"text/plain",
|
||||
"text/xml",
|
||||
"application/json",
|
||||
"application/javascript",
|
||||
"application/xhtml+xml",
|
||||
"image/svg+xml",
|
||||
},
|
||||
"name": "envoy.filters.http.gzip",
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.http.gzip.v3.Gzip",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -323,4 +310,4 @@ var ConfigMapGzipEnvoy = suite.ConformanceTest{
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user