to be clear with how to apply custom metrics (#12247)

* to be clear with how to apply custom metrics

Signed-off-by: oops-oom <734819342@qq.com>

* fix test error

Signed-off-by: oops-oom <734819342@qq.com>

* fix for test

Signed-off-by: oops-oom <734819342@qq.com>

Signed-off-by: oops-oom <734819342@qq.com>
This commit is contained in:
oops-oom 2022-11-16 22:24:17 +08:00 committed by GitHub
parent da81c5b587
commit ae8bae962c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

View File

@ -59,16 +59,14 @@ parameters, rather than passing a configuration file with `-f`. This is done to
The two methods are equivalent, but `-f` is strongly recommended for production. The above command would be written as
follows using `-f`:
{{< text yaml >}}
# my-config.yaml
{{< text bash >}}
$ cat <<EOF > ./my-config.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
meshConfig:
accessLogFile: /dev/stdout
{{< /text >}}
{{< text bash >}}
EOF
$ istioctl install -f my-config.yaml
{{< /text >}}

View File

@ -80,7 +80,8 @@ the example application throughout this task.
settings will retain the default configuration, equivalent to the explicit settings shown above.
{{< /tip >}}
{{< text yaml >}}
{{< text bash >}}
$ cat <<EOF > ./custom_metrics.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
@ -107,6 +108,8 @@ the example application throughout this task.
dimensions:
destination_port: string(destination.port)
request_host: request.host
EOF
# istioctl install -f custom_metrics.yaml
{{< /text >}}
1. Apply the following annotation to all injected pods with the list of the

View File

@ -37,7 +37,8 @@ spec:
disable_host_header_fallback: true
ENDSNIP
! read -r -d '' snip_enable_custom_metrics_2 <<\ENDSNIP
snip_enable_custom_metrics_2() {
cat <<EOF > ./custom_metrics.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
@ -64,6 +65,11 @@ spec:
dimensions:
destination_port: string(destination.port)
request_host: request.host
EOF
}
! read -r -d '' snip_enable_custom_metrics_2_out <<\ENDSNIP
# istioctl install -f custom_metrics.yaml
ENDSNIP
! read -r -d '' snip_enable_custom_metrics_3 <<\ENDSNIP

View File

@ -46,7 +46,7 @@ send_productpage_requests
_verify_not_contains snip_verify_the_results_2 "destination_port"
_verify_not_contains snip_verify_the_results_2 "request_host"
echo "$snip_enable_custom_metrics_2" | istioctl install --set tag="$TAG" --set hub="$HUB" -y -f -
snip_enable_custom_metrics_2 && istioctl install --set tag="$TAG" --set hub="$HUB" -y -f custom_metrics.yaml
kubectl get istiooperator installed-state -n istio-system -o yaml
_wait_for_istio envoyfilter istio-system stats-filter-1.8