blob: efa1f4027632cd432ae375f618677aa9ee41f250 [file] [log] [blame]
Marcel van Lohuizen5274e982019-04-28 17:51:43 +02001
2// Copyright 2017 Istio Authors
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16// $title: Mixer Client
17// $description: Configuration state for the Mixer client library.
18// $location: https://istio.io/docs/reference/config/policy-and-telemetry/istio.mixer.v1.config.client
19
20// Describes the configuration state for the Mixer client library that's built into Envoy.
21package client
22
23import (
24 "istio.io/api/mixer/v1"
25 "time"
26)
27
28// Specifies the behavior when the client is unable to connect to Mixer.
29NetworkFailPolicy: {
30
31 // Specifies the behavior when the client is unable to connect to Mixer.
32 policy?: NetworkFailPolicy_FailPolicy @protobuf(1,type=FailPolicy)
33
34 // Max retries on transport error.
35 maxRetry?: uint32 @protobuf(2,name=max_retry)
36
37 // Base time to wait between retries. Will be adjusted by exponential
38 // backoff and jitter.
39 baseRetryWait?: time.Duration @protobuf(3,type=google.protobuf.Duration,name=base_retry_wait)
40
41 // Max time to wait between retries.
42 maxRetryWait?: time.Duration @protobuf(4,type=google.protobuf.Duration,name=max_retry_wait)
43}
44
45// Describes the policy.
46NetworkFailPolicy_FailPolicy:
47 // If network connection fails, request is allowed and delivered to the
48 // service.
49 *"FAIL_OPEN" |
50
51 // If network connection fails, request is rejected.
52 "FAIL_CLOSE"
53
54NetworkFailPolicy_FailPolicy_value: {
Marcel van Lohuizen4a8c4ca2019-05-31 17:32:35 +020055 FAIL_OPEN: 0
56 FAIL_CLOSE: 1
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020057}
58
59// Defines the per-service client configuration.
60ServiceConfig: {
61 // If true, do not call Mixer Check.
62 disableCheckCalls?: bool @protobuf(1,name=disable_check_calls)
63
64 // If true, do not call Mixer Report.
65 disableReportCalls?: bool @protobuf(2,name=disable_report_calls)
66
67 // Send these attributes to Mixer in both Check and Report. This
68 // typically includes the "destination.service" attribute.
69 // In case of a per-route override, per-route attributes take precedence
70 // over the attributes supplied in the client configuration.
71 mixerAttributes?: v1.Attributes @protobuf(3,type=Attributes,name=mixer_attributes)
72
73 // HTTP API specifications to generate API attributes.
74 httpApiSpec?: [...HTTPAPISpec] @protobuf(4,name=http_api_spec)
75
76 // Quota specifications to generate quota requirements.
77 quotaSpec?: [...QuotaSpec] @protobuf(5,name=quota_spec)
78
79 // Specifies the behavior when the client is unable to connect to Mixer.
80 // This is the service-level policy. It overrides
81 // [mesh-level
82 // policy][istio.mixer.v1.config.client.TransportConfig.network_fail_policy].
83 networkFailPolicy?: NetworkFailPolicy @protobuf(7,name=network_fail_policy)
84
85 // Default attributes to forward to upstream. This typically
86 // includes the "source.ip" and "source.uid" attributes.
87 // In case of a per-route override, per-route attributes take precedence
88 // over the attributes supplied in the client configuration.
89 //
90 // Forwarded attributes take precedence over the static Mixer attributes.
91 // The full order of application is as follows:
92 // 1. static Mixer attributes from the filter config;
93 // 2. static Mixer attributes from the route config;
94 // 3. forwarded attributes from the source filter config (if any);
95 // 4. forwarded attributes from the source route config (if any);
96 // 5. derived attributes from the request metadata.
97 forwardAttributes?: v1.Attributes @protobuf(8,type=Attributes,name=forward_attributes)
98}
99
100// Defines the transport config on how to call Mixer.
101TransportConfig: {
102 // The flag to disable check cache.
103 disableCheckCache?: bool @protobuf(1,name=disable_check_cache)
104
105 // The flag to disable quota cache.
106 disableQuotaCache?: bool @protobuf(2,name=disable_quota_cache)
107
108 // The flag to disable report batch.
109 disableReportBatch?: bool @protobuf(3,name=disable_report_batch)
110
111 // Specifies the behavior when the client is unable to connect to Mixer.
112 // This is the mesh level policy. The default value for policy is FAIL_OPEN.
113 networkFailPolicy?: NetworkFailPolicy @protobuf(4,name=network_fail_policy)
114
115 // Specify refresh interval to write Mixer client statistics to Envoy share
116 // memory. If not specified, the interval is 10 seconds.
117 statsUpdateInterval?: time.Duration @protobuf(5,type=google.protobuf.Duration,name=stats_update_interval)
118
119 // Name of the cluster that will forward check calls to a pool of mixer
120 // servers. Defaults to "mixer_server". By using different names for
121 // checkCluster and reportCluster, it is possible to have one set of
122 // Mixer servers handle check calls, while another set of Mixer servers
123 // handle report calls.
124 //
125 // NOTE: Any value other than the default "mixer_server" will require the
126 // Istio Grafana dashboards to be reconfigured to use the new name.
127 checkCluster?: string @protobuf(6,name=check_cluster)
128
129 // Name of the cluster that will forward report calls to a pool of mixer
130 // servers. Defaults to "mixer_server". By using different names for
131 // checkCluster and reportCluster, it is possible to have one set of
132 // Mixer servers handle check calls, while another set of Mixer servers
133 // handle report calls.
134 //
135 // NOTE: Any value other than the default "mixer_server" will require the
136 // Istio Grafana dashboards to be reconfigured to use the new name.
137 reportCluster?: string @protobuf(7,name=report_cluster)
138
139 // Default attributes to forward to Mixer upstream. This typically
140 // includes the "source.ip" and "source.uid" attributes. These
141 // attributes are consumed by the proxy in front of mixer.
142 attributesForMixerProxy?: v1.Attributes @protobuf(8,type=Attributes,name=attributes_for_mixer_proxy)
143}
144
145// Defines the client config for HTTP.
146HttpClientConfig: {
147 // The transport config.
148 transport?: TransportConfig @protobuf(1)
149
150 // Map of control configuration indexed by destination.service. This
151 // is used to support per-service configuration for cases where a
152 // mixerclient serves multiple services.
153 serviceConfigs <_>: ServiceConfig
154
155 // Default destination service name if none was specified in the
156 // client request.
157 defaultDestinationService?: string @protobuf(3,name=default_destination_service)
158
159 // Default attributes to send to Mixer in both Check and
160 // Report. This typically includes "destination.ip" and
161 // "destination.uid" attributes.
162 mixerAttributes?: v1.Attributes @protobuf(4,type=Attributes,name=mixer_attributes)
163
164 // Default attributes to forward to upstream. This typically
165 // includes the "source.ip" and "source.uid" attributes.
166 forwardAttributes?: v1.Attributes @protobuf(5,type=Attributes,name=forward_attributes)
167}
168
169// Defines the client config for TCP.
170TcpClientConfig: {
171 // The transport config.
172 transport?: TransportConfig @protobuf(1)
173
174 // Default attributes to send to Mixer in both Check and
175 // Report. This typically includes "destination.ip" and
176 // "destination.uid" attributes.
177 mixerAttributes?: v1.Attributes @protobuf(2,type=Attributes,name=mixer_attributes)
178
179 // If set to true, disables Mixer check calls.
180 disableCheckCalls?: bool @protobuf(3,name=disable_check_calls)
181
182 // If set to true, disables Mixer check calls.
183 disableReportCalls?: bool @protobuf(4,name=disable_report_calls)
184
185 // Quota specifications to generate quota requirements.
186 // It applies on the new TCP connections.
187 connectionQuotaSpec?: QuotaSpec @protobuf(5,name=connection_quota_spec)
188
189 // Specify report interval to send periodical reports for long TCP
190 // connections. If not specified, the interval is 10 seconds. This interval
191 // should not be less than 1 second, otherwise it will be reset to 1 second.
192 reportInterval?: time.Duration @protobuf(6,type=google.protobuf.Duration,name=report_interval)
193}