mirror of https://github.com/istio/istio.io.git
zh-translation: cleanup faq/mixer (#9311)
This commit is contained in:
parent
80ddb8f6b3
commit
0a9c5724e0
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
title: Mixer 支持的全部属性表达式有哪些?
|
||||
weight: 20
|
||||
---
|
||||
|
||||
Mixer 支持的全部属性表达式参见[表达式语言参考](/zh/docs/reference/config/policy-and-telemetry/expression-language/)。
|
|
@ -1,12 +0,0 @@
|
|||
---
|
||||
title: 为什么我的规则无法匹配?
|
||||
weight: 50
|
||||
---
|
||||
|
||||
Mixer 的规则必须在运行时验证。这意味着匹配条件的必须是[语言](/zh/docs/reference/config/policy-and-telemetry/expression-language/)中定义良好的表达式,
|
||||
属性是[属性清单](/zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/)中声明过的,
|
||||
并且规则所指向的 handler 和 instance 也必须存在。
|
||||
|
||||
在执行规则之前,属性值通常会被标准化。比如,在 `request.headers` 和 `response.headers` 属性中,HTTP 头的键是小写的。
|
||||
表达式 `request.headers ["X-Forwarded-Proto"] == "http"` 不会匹配任何请求,即使 HTTP 头部是不区分大小写的。
|
||||
相反,应该使用这样的表达式 `request.headers ["x-forwarded-proto"] == "http"`。
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
title: Mixer FAQ
|
||||
linktitle: Mixer
|
||||
description: Mixer Q & A.
|
||||
weight: 40
|
||||
layout: faq
|
||||
icon: faq
|
||||
aliases:
|
||||
- /zh/help/faq/mixer
|
||||
---
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
title: Mixer 是否提供内部监控?
|
||||
weight: 30
|
||||
---
|
||||
|
||||
Mixer 提供了监控端点(默认端口:`15014`)。Mixer 提供的性能和审计功能的服务路径如下:
|
||||
|
||||
- `/metrics` 提供有关 Mixer 处理的 Prometheus 指标、API 调用相关的 gRPC 指标和 adapter 调度指标。
|
||||
- `/debug/pprof` 提供了性能剖析相关的数据,格式为 [pprof](https://golang.org/pkg/net/http/pprof/)。
|
||||
- `/debug/vars` 提供了服务器指标,数据为 JSON 格式。
|
||||
|
||||
可通过 `kubectl logs` 命令访问 Mixer 的日志,如下所示:
|
||||
|
||||
- 关于 `istio-policy` 服务:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl -n istio-system logs -l app=policy -c mixer
|
||||
{{< /text >}}
|
||||
|
||||
- 关于 `istio-telemetry` 服务:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl -n istio-system logs -l app=telemetry -c mixer
|
||||
{{< /text >}}
|
||||
|
||||
Mixer 追踪功能由以下命令行参数控制:`trace_zipkin_url`、`trace_jaeger_url` 和 `trace_log_spans`。如果设置了以上参数中的任何一个,则追踪数据将上报至配置的相关服务地址。如果未提供追踪相关设置参数,则 Mixer 将不会产生应用程序级别的追踪信息。
|
|
@ -1,123 +0,0 @@
|
|||
---
|
||||
title: 如何查看 Mixer 配置?
|
||||
weight: 10
|
||||
---
|
||||
|
||||
*instances* 、*handlers* 和 *rules* 的相关配置以 Kubernetes [CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) 的方式进行存储。其配置可以使用 `kubectl` 访问 Kubernetes API server 获得。
|
||||
|
||||
## Rules
|
||||
|
||||
查看所有的 `rule` 列表,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get rules --all-namespaces
|
||||
NAMESPACE NAME AGE
|
||||
istio-system kubeattrgenrulerule 20h
|
||||
istio-system promhttp 20h
|
||||
istio-system promtcp 20h
|
||||
istio-system stdiohttp 20h
|
||||
istio-system stdiotcp 20h
|
||||
istio-system tcpkubeattrgenrulerule 20h
|
||||
{{< /text >}}
|
||||
|
||||
查看单个 `rule` 配置,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl -n <namespace> get rules <name> -o yaml
|
||||
{{< /text >}}
|
||||
|
||||
## Handlers
|
||||
|
||||
`Handlers` 基于 Kubernetes [CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) 中的 `adapters` 资源进行定义。
|
||||
|
||||
首先,查看所有的 `adapter` 列表,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get crd -listio=mixer-adapter
|
||||
NAME AGE
|
||||
adapters.config.istio.io 20h
|
||||
bypasses.config.istio.io 20h
|
||||
circonuses.config.istio.io 20h
|
||||
deniers.config.istio.io 20h
|
||||
fluentds.config.istio.io 20h
|
||||
kubernetesenvs.config.istio.io 20h
|
||||
listcheckers.config.istio.io 20h
|
||||
memquotas.config.istio.io 20h
|
||||
noops.config.istio.io 20h
|
||||
opas.config.istio.io 20h
|
||||
prometheuses.config.istio.io 20h
|
||||
rbacs.config.istio.io 20h
|
||||
servicecontrols.config.istio.io 20h
|
||||
signalfxs.config.istio.io 20h
|
||||
solarwindses.config.istio.io 20h
|
||||
stackdrivers.config.istio.io 20h
|
||||
statsds.config.istio.io 20h
|
||||
stdios.config.istio.io 20h
|
||||
{{< /text >}}
|
||||
|
||||
然后,对列表中的每个 `adapter` 执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get <adapter kind name> --all-namespaces
|
||||
{{< /text >}}
|
||||
|
||||
`stdios` 将输出以下类似内容:
|
||||
|
||||
{{< text plain >}}
|
||||
NAMESPACE NAME AGE
|
||||
istio-system handler 20h
|
||||
{{< /text >}}
|
||||
|
||||
查看单个 `handler` 配置,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl -n <namespace> get <adapter kind name> <name> -o yaml
|
||||
{{< /text >}}
|
||||
|
||||
## Instances
|
||||
|
||||
`Instances` 基于 Kubernetes [CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) 中的 `instances` 资源进行定义。
|
||||
|
||||
首先,查看所有的 `instance` 列表,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get crd -listio=mixer-instance
|
||||
NAME AGE
|
||||
apikeys.config.istio.io 20h
|
||||
authorizations.config.istio.io 20h
|
||||
checknothings.config.istio.io 20h
|
||||
edges.config.istio.io 20h
|
||||
instances.config.istio.io 20h
|
||||
kuberneteses.config.istio.io 20h
|
||||
listentries.config.istio.io 20h
|
||||
logentries.config.istio.io 20h
|
||||
metrics.config.istio.io 20h
|
||||
quotas.config.istio.io 20h
|
||||
reportnothings.config.istio.io 20h
|
||||
servicecontrolreports.config.istio.io 20h
|
||||
tracespans.config.istio.io 20h
|
||||
{{< /text >}}
|
||||
|
||||
然后,对列表中的每个 `instance` 执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get <instance kind name> --all-namespaces
|
||||
{{< /text >}}
|
||||
|
||||
`metrics` 将输出以下类似内容:
|
||||
|
||||
{{< text plain >}}
|
||||
NAMESPACE NAME AGE
|
||||
istio-system requestcount 20h
|
||||
istio-system requestduration 20h
|
||||
istio-system requestsize 20h
|
||||
istio-system responsesize 20h
|
||||
istio-system tcpbytereceived 20h
|
||||
istio-system tcpbytesent 20h
|
||||
{{< /text >}}
|
||||
|
||||
查看单个 `instance` 配置,执行以下命令:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl -n <namespace> get <instance kind name> <name> -o yaml
|
||||
{{< /text >}}
|
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
title: 为什么 Istio 需要 Mixer?
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Mixer 为 Istio 组件和基于 Istio 的服务之间提供了丰富的中介层。Mixer 作为基础设施后端服务可用于访问控制检查控制和遥测数据采集。Mixer 提供的中介层可在不修改服务二进制的情况下,帮助运维人员获得对服务内部机制的洞悉力和控制力。
|
||||
|
||||
Mixer 被设计为独立组件,这与 Envoy 不同。这样的设计有很多好处:
|
||||
|
||||
- *可伸缩性* 。
|
||||
Mixer 和 Envoy 的功能在本质上有很大不同,这也导致了它们各自对于可伸缩性要求不同。保持组件分离可以实现独立的组件适当伸缩。
|
||||
|
||||
- *资源使用* 。
|
||||
Istio 依赖于能够被部署的代理实例,因此最小化每个代理实例的成本是非常重要的。将 Mixer 的复杂逻辑移动到独立的组件中让 Envoy 保持轻量和灵活变为可能。
|
||||
|
||||
- *可靠性* 。
|
||||
Mixer 及其开放式扩展性模型代表了数据路径处理流水线最复杂部分。之所以在 Mixer 而不是在 Envoy 中实现此功能,是因为这样可以创建不同的故障域,使得 Envoy 即使在 Mixer 发生故障的情况下也能继续运行,从而避免了宕机。
|
||||
|
||||
- *隔离性* 。
|
||||
Mixer 在 Istio 和 基础设施后端之间提供了一定程度的隔离。每个 Envoy 实例都可配置为在非常小范围内进行交互操作,从而限制了潜在攻击的影响。
|
||||
|
||||
- *可扩展性* 。
|
||||
必须设计一个简单的可扩展性模型,使得 Istio 尽可能广泛地与后端进行交互操作。由于其设计和语言选择,Mixer 比 Envoy 具备更好的扩展性。功能点的分离也使得 Istio 策略和遥测处理的功能可以采用不同的代理一起实现,例如 Envoy 和 NGINX 的混合。
|
||||
|
||||
Envoy 实现了复杂的缓存,批处理和预取策略,从而在很大程度上减轻了在请求路径上与 Mixer 交互的延迟影响。
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
title: 如何编写用于 Mixer 的自定义适配器?
|
||||
weight: 40
|
||||
---
|
||||
|
||||
可以阅读
|
||||
[适配器开发指南](https://github.com/istio/istio/wiki/Mixer-Compiled-In-Adapter-Dev-Guide)
|
||||
了解有关如何为 Mixer 实施新适配器。
|
||||
|
||||
{{< idea >}}
|
||||
Istio 1.0 开始支持进程外适配器。这是推荐与 Mixer 持续集成的方法。有关如何开始构建进程外适配器的文档有
|
||||
[进程外适配器开发指南](https://github.com/istio/istio/wiki/Mixer-Out-Of-Process-Adapter-Dev-Guide)
|
||||
和[进程外适配器概览](https://github.com/istio/istio/wiki/Mixer-Out-Of-Process-Adapter-Walkthrough)。
|
||||
{{< /idea >}}
|
Loading…
Reference in New Issue