Skip to content

Commit ad5e74c

Browse files
author
Martin Taillefer
committed
Apply mixer config doc feedback.
1 parent 652813e commit ad5e74c

File tree

5 files changed

+37
-22
lines changed

5 files changed

+37
-22
lines changed
File renamed without changes.
File renamed without changes.

docs/concepts/mixer-config.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ Mixer is an attribute processing machine. Requests arrive at Mixer with a set of
4949
and based on these attributes, Mixer generates calls to a variety of backend systems. The set of
5050
attributes determines which backend systems Mixer calls for a given request and what parameters
5151
each is given. In order to hide the details of individual backend systems, Mixer uses modules
52-
known as [*adapters*]({{site.baseurl}}/docs/concepts/mixer.html#adapters) which you can think of as
53-
*device drivers* for backend systems.
52+
known as [*adapters*]({{site.baseurl}}/docs/concepts/mixer.html#adapters).
5453

5554
Mixer's configuration has two central responsibilities:
5655

@@ -62,8 +61,8 @@ abstractions:
6261

6362
|Concept |Description
6463
|----------------------------|-----------
65-
|[Adapters](#adapters) | Low-level operationally-focused configuration state for individual mixer adapters.
66-
|[Aspects](#aspects) | High-level intent-focused configuration state for individual mixer adapters.
64+
|[Adapters](#adapters) | Low-level operationally-focused configuration for individual mixer adapters.
65+
|[Aspects](#aspects) | High-level intent-focused configuration for individual mixer adapters.
6766
|[Descriptors](#descriptors) | Description of parameters used with individual aspects.
6867
|[Scopes](#scopes) | Mechanism to select which aspects and descriptors to use based on a request's attributes.
6968
|[Manifests](#manifests) | Description of various static characteristics of an Istio deployment.
@@ -73,7 +72,8 @@ The following sections explain these concepts in detail.
7372
### Adapters
7473

7574
[Adapters]({{site.baseurl}}/docs/concepts/mixer.html#adapters) are the foundational work horses that the Istio mixer is built around. Adapters
76-
encapsulate the logic necessary to interface Mixer with specific external backend systems such as Prometheus or NewRelic. Individual adapters
75+
encapsulate the logic necessary to interface Mixer with specific external backend systems such as [Prometheus](https://prometheus.io),
76+
[New Relic](https://newrelic.com), or [Stackdriver](https://cloud.google.com/logging). Individual adapters
7777
generally need to be provided some basic operational parameters in order to do their work. For example, a logging adapter may need
7878
to know the IP address and port where it's log data should be pumped.
7979

@@ -96,9 +96,10 @@ The `impl` field gives the name of the adapter being configured. Finally, the `p
9696
actual adapter-specific configuration parameters are specified. In this case, this is configuring the URL the
9797
adapter should use in its queries and defines the interval at which it should refresh its local caches.
9898

99-
For each available adapter implementation, you can define any number of blocks of independent configuration state. This allows the same adapter
99+
For each available adapter implementation, you can define any number of independent configuration blocks. This allows the
100+
same adapter
100101
to be used multiple times within a single deployment. Depending on the situation, such as which microservice is involved, one
101-
block of configuration will be used versus another. For example, here are two more blocks of configuration that can coexist
102+
configuration block will be used versus another. For example, here are two more configuration blocks that can coexist
102103
with the previous one:
103104

104105
```yaml
@@ -136,7 +137,7 @@ adapters and their specific configuration format can be found in *TBD*.
136137

137138
### Aspects
138139

139-
Aspects define high-level configuration state (what is sometimes called intent-based configuration),
140+
Aspects define high-level configuration (what is sometimes called intent-based configuration),
140141
independent of the particular implementation details of a specific adapter type. Whereas adapters focus
141142
on *how* to do something, aspects focus on *what* to do.
142143

@@ -156,13 +157,13 @@ of aspects are shown in the following table.
156157

157158
|Kind |Description
158159
|-----------------|-----------
160+
|quotas |Enforce quotas and rate limits.
161+
|metrics |Produce metrics.
162+
|lists |Enforce simple whitelist- or blacklist-based access control.
159163
|access-logs |Produces fixed-format access logs for every request.
160164
|application-logs |Produces flexible application logs for every request.
161165
|attributes |Produces supplementary attributes for every request.
162166
|denials |Systematically produces a predictable error code.
163-
|lists |Verifies a symbol against a list.
164-
|metrics |Produces a metric that measures some runtime property.
165-
|quotas |Tracks a quota value.
166167

167168
In the example above, the aspect declaration specifies the `lists` kind which indicates
168169
we're configuring an aspect whose purpose is to enable the use of whitelists or
@@ -206,7 +207,7 @@ aspects:
206207
This defines an aspect that produces metrics which are sent to the myMetricsCollector adapter,
207208
which was defined previously. The `metrics` stanza defines the set of metrics that are
208209
generated during request processing for this aspect. The `descriptor_name` field specifies
209-
the name of a *descriptor* which is a separate block of configuration, described [below](#descriptors), which declares
210+
the name of a *descriptor* which is a separate configuration block, described [below](#descriptors), which declares
210211
the kind of metric this is. The `value` field and the four label fields describe which attributes to use
211212
at request time in order to produce the metric.
212213

@@ -230,7 +231,14 @@ We've already seen a few simple attribute expressions in the previous examples.
230231

231232
The sequences on the right-hand side of the colons are the simplest forms of attribute expressions.
232233
They only consist of attribute names. In the above, the `source` label will be assigned the value
233-
of the `source.name` attribute.
234+
of the `source.name` attribute. Here's an example of a conditional expression:
235+
236+
```yaml
237+
service: api.name | target.name
238+
```
239+
240+
With the above, the service label will be assigned the value of the api.name attribute, or if that attribute
241+
is not defined, it will be assigned the value of the target.name attribute.
234242

235243
The attributes that can be used in attribute expressions must be defined in an
236244
[*attribute manifest*](#manifests) for the deployment. Within the manifest, each attribute has
@@ -336,6 +344,8 @@ programming language. Doing so enables a few important scenarios:
336344
by Mixer. For example, a metric descriptor provides all the information needed to program a backend system to accept metrics
337345
that conform to the descriptor's shape (it's value type and its set of labels).
338346

347+
- Descriptors can be referenced and reused from multiple aspects.
348+
339349
- It enables type checking of the deployment's configuration. Since attributes have strong types, and so do descriptors,
340350
Istio can provide a number of strong correctness guarantees of the system's configuration. Basically, if a block of
341351
configuration is accepted into the Istio system, it means the configuration passes a minimum correctness bar. Again, this
@@ -355,16 +365,16 @@ them to have control over their areas, but not other's.
355365

356366
Here's how this all works:
357367

358-
- The various blocks of configuration described in the previous sections (adapters, aspects, and descriptors) are always defined
368+
- The various configuration blocks described in the previous sections (adapters, aspects, and descriptors) are always defined
359369
within the context of a hierarchy.
360370

361371
- The hierarchy is represented by DNS-style dotted names. Like DNS, the hierarchy starts with the rightmost element in
362372
the dotted name.
363373

364-
- Each block of configuration is associated with a *scope* and a *subject* which are both dotted names
374+
- Each configuration block is associated with a *scope* and a *subject* which are both dotted names
365375
representing locations within the hierarchy:
366376

367-
- A scope represents the authority that created the block of configuration. Authorities
377+
- A scope represents the authority that created the configuration block. Authorities
368378
higher up in the hierarchy are more powerful than those lower in it.
369379

370380
- The subject represents the location of the block of state within the hierarchy. The subject
@@ -379,28 +389,28 @@ state is deployed. For example, a valid scope might be `svc.cluster.local` while
379389
`myservice.ns.svc.cluster.local`
380390

381391
The scoping model is designed to pair up with an access control model to constrain which human is allowed to
382-
create blocks of configuration for particular scopes. Operators which have the authority to create
392+
create configuration blocks for particular scopes. Operators which have the authority to create
383393
blocks at a scope higher in the hierarchy can impact all configuration associated with lower scopes. Although this is the design
384394
intent, Mixer configuration doesn't yet support access control on its configuration so there are no actual constraints on which
385395
operator can manipulate which scope.
386396

387397
#### Resolution
388398

389399
When a request arrives, Mixer goes through a number of [request processing phases](./mixer.md#request-phases).
390-
The Resolution phase is concerned with identifying the exact blocks of configuration to use in order to
400+
The Resolution phase is concerned with identifying the exact configuration blocks to use in order to
391401
process the incoming request. For example, a request arriving at Mixer for service A likely has some configuration differences
392402
with requests arriving for service B. Resolution is about deciding which config to use for a request.
393403

394404
Resolution depends on a well-known attribute to guide its choice, a so-called *identity attribute*.
395405
The value of this attribute is a dotted name which determines where the mixer begins to look in the
396-
hierarchy for blocks of configuration to use for the request.
406+
hierarchy for configuration blocks to use for the request.
397407

398408
Here's how it all works:
399409

400410
1. A request arrives and Mixer extracts the value of the identity attribute to produce the current
401411
lookup value.
402412

403-
2. Mixer looks for all blocks of configuration whose subject matches the lookup value.
413+
2. Mixer looks for all configuration blocks whose subject matches the lookup value.
404414

405415
3. If Mixer finds multiple blocks that match, it keeps only the block that has the highest scope.
406416

@@ -443,6 +453,11 @@ manifests:
443453
value_type: INT64
444454
```
445455

456+
## Examples
457+
458+
You can find fully formed examples of Mixer configuration by visiting the [Samples]({{site.baseurl}}/docs/samples). As
459+
a specific example, here is the [BookInfo configuration](https://raw.githubusercontent.com/istio/istio/master/demos/mixer-config-quota-bookinfo.yaml).
460+
446461
## Configuration API
447462

448463
*TBD*

docs/concepts/mixer/adapters.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/concepts/what-is-istio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ rather than being baked into the proxy, allowing services to directly integrate
8484

8585
## High-level architecture
8686

87-
<img src="{{site.baseurl}}/img/arch.svg" alt="The overall architecture of an Istio-based service." />
87+
<img src="./arch.svg" alt="The overall architecture of an Istio-based service." />
8888

8989
### The sidecar model
9090

0 commit comments

Comments
 (0)