diff --git a/charts/gateway-helm/README.md b/charts/gateway-helm/README.md index 01e32f4dbe00..f5f2b420d21c 100644 --- a/charts/gateway-helm/README.md +++ b/charts/gateway-helm/README.md @@ -69,6 +69,7 @@ To uninstall the chart: | deployment.envoyGateway.resources.requests.memory | string | `"64Mi"` | | | deployment.kubeRbacProxy.image.repository | string | `"gcr.io/kubebuilder/kube-rbac-proxy"` | | | deployment.kubeRbacProxy.image.tag | string | `"v0.11.0"` | | +| deployment.kubeRbacProxy.imagePullPolicy | string | `"IfNotPresent"` | | | deployment.kubeRbacProxy.resources.limits.cpu | string | `"500m"` | | | deployment.kubeRbacProxy.resources.limits.memory | string | `"128Mi"` | | | deployment.kubeRbacProxy.resources.requests.cpu | string | `"5m"` | | diff --git a/charts/gateway-helm/templates/envoy-gateway-deployment.yaml b/charts/gateway-helm/templates/envoy-gateway-deployment.yaml index 6f36ef0a7c69..8bcd26a0b0f7 100644 --- a/charts/gateway-helm/templates/envoy-gateway-deployment.yaml +++ b/charts/gateway-helm/templates/envoy-gateway-deployment.yaml @@ -80,6 +80,7 @@ spec: - name: KUBERNETES_CLUSTER_DOMAIN value: {{ .Values.kubernetesClusterDomain }} image: {{ .Values.deployment.kubeRbacProxy.image.repository }}:{{ .Values.deployment.kubeRbacProxy.image.tag | default .Chart.AppVersion }} + imagePullPolicy: {{ .Values.deployment.kubeRbacProxy.imagePullPolicy }} name: kube-rbac-proxy ports: - containerPort: 8443 diff --git a/charts/gateway-helm/values.tmpl.yaml b/charts/gateway-helm/values.tmpl.yaml index bf4de7a3873f..5dc0e579af0f 100644 --- a/charts/gateway-helm/values.tmpl.yaml +++ b/charts/gateway-helm/values.tmpl.yaml @@ -15,6 +15,7 @@ deployment: image: repository: gcr.io/kubebuilder/kube-rbac-proxy tag: v0.14.1 + imagePullPolicy: IfNotPresent resources: limits: cpu: 500m diff --git a/internal/xds/translator/jsonpatch.go b/internal/xds/translator/jsonpatch.go index 1a94254fd9e4..1b89c14b5ca3 100644 --- a/internal/xds/translator/jsonpatch.go +++ b/internal/xds/translator/jsonpatch.go @@ -68,7 +68,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.ListenerType): temp := &listenerv3.Listener{} if err = protojson.Unmarshal(jsonBytes, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %+v", p.Operation.Value) + msg := fmt.Sprintf("unable to unmarshal xds resource %+v, err:%s", p.Operation.Value, err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -81,7 +81,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.RouteType): temp := &routev3.RouteConfiguration{} if err = protojson.Unmarshal(jsonBytes, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %+v", p.Operation.Value) + msg := fmt.Sprintf("unable to unmarshal xds resource %+v, err:%s", p.Operation.Value, err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -94,7 +94,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.ClusterType): temp := &clusterv3.Cluster{} if err = protojson.Unmarshal(jsonBytes, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %+v", p.Operation.Value) + msg := fmt.Sprintf("unable to unmarshal xds resource %+v, err:%s", p.Operation.Value, err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -107,7 +107,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.EndpointType): temp := &endpointv3.ClusterLoadAssignment{} if err = protojson.Unmarshal(jsonBytes, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %+v", p.Operation.Value) + msg := fmt.Sprintf("unable to unmarshal xds resource %+v, err:%s", p.Operation.Value, err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -214,7 +214,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.ListenerType): temp := &listenerv3.Listener{} if err = protojson.Unmarshal(modifiedJSON, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %s", string(modifiedJSON)) + msg := fmt.Sprintf("unable to unmarshal xds resource %s, err:%s", string(modifiedJSON), err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -231,7 +231,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.RouteType): temp := &routev3.RouteConfiguration{} if err = protojson.Unmarshal(modifiedJSON, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %s", string(modifiedJSON)) + msg := fmt.Sprintf("unable to unmarshal xds resource %s, err:%s", string(modifiedJSON), err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -248,7 +248,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.ClusterType): temp := &clusterv3.Cluster{} if err = protojson.Unmarshal(modifiedJSON, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %s", string(modifiedJSON)) + msg := fmt.Sprintf("unable to unmarshal xds resource %s, err:%s", string(modifiedJSON), err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } @@ -265,7 +265,7 @@ func processJSONPatches(tCtx *types.ResourceVersionTable, envoyPatchPolicies []* case string(resourcev3.EndpointType): temp := &endpointv3.ClusterLoadAssignment{} if err = protojson.Unmarshal(modifiedJSON, temp); err != nil { - msg := fmt.Sprintf("unable to unmarshal xds resource %s", string(modifiedJSON)) + msg := fmt.Sprintf("unable to unmarshal xds resource %s, err:%s", string(modifiedJSON), err.Error()) status.SetEnvoyPatchPolicyInvalid(e.Status, msg) continue } diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml index 47fecd8f8455..a132d6cc613c 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml @@ -3,7 +3,8 @@ status: conditions: - lastTransitionTime: null - message: unable to unmarshal xds resource {"name":"first-listener","address":{"socket_address":{"address":"0.0.0.0","port_value":10080}},"default_filter_chain":{"filters":[{"name":"envoy.filters.network.http_connection_manager","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager","stat_prefix":"http","rds":{"config_source":{"ads":{},"resource_api_version":"V3"},"route_config_name":"first-listener"},"http_filters":[{"name":"envoy.filters.http.router","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"}}],"common_http_protocol_options":{"headers_with_underscores_action":"REJECT_REQUEST"},"http2_protocol_options":{"max_concurrent_streams":100,"initial_stream_window_size":65536,"initial_connection_window_size":1048576},"use_remote_address":true,"upgrade_configs":[{"upgrade_type":"websocket"}],"normalize_path":true,"merge_slashes":true,"path_with_escaped_slashes_action":"UNESCAPE_AND_REDIRECT"}}]},"per_connection_buffer_limit_bytes":32768,"this":{"path":{"never":{"existed":{"name":"envoy.filters.http.ratelimit","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit","domain":"eg-ratelimit","failure_mode_deny":true,"rate_limit_service":{"grpc_service":{"envoy_grpc":{"cluster_name":"rate-limit-cluster"}},"transport_api_version":"V3"},"timeout":"1s"}}}}}} + message: 'unable to unmarshal xds resource {"name":"first-listener","address":{"socket_address":{"address":"0.0.0.0","port_value":10080}},"default_filter_chain":{"filters":[{"name":"envoy.filters.network.http_connection_manager","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager","stat_prefix":"http","rds":{"config_source":{"ads":{},"resource_api_version":"V3"},"route_config_name":"first-listener"},"http_filters":[{"name":"envoy.filters.http.router","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"}}],"common_http_protocol_options":{"headers_with_underscores_action":"REJECT_REQUEST"},"http2_protocol_options":{"max_concurrent_streams":100,"initial_stream_window_size":65536,"initial_connection_window_size":1048576},"use_remote_address":true,"upgrade_configs":[{"upgrade_type":"websocket"}],"normalize_path":true,"merge_slashes":true,"path_with_escaped_slashes_action":"UNESCAPE_AND_REDIRECT"}}]},"per_connection_buffer_limit_bytes":32768,"this":{"path":{"never":{"existed":{"name":"envoy.filters.http.ratelimit","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit","domain":"eg-ratelimit","failure_mode_deny":true,"rate_limit_service":{"grpc_service":{"envoy_grpc":{"cluster_name":"rate-limit-cluster"}},"transport_api_version":"V3"},"timeout":"1s"}}}}}}, + err:proto: (line 1:1023): unknown field "this"' reason: Invalid status: "False" type: Programmed