blob: fc7f747d73f2eb2ea174ef0f99d32864035d3cb4 [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 (
Marcel van Lohuizenf9bd63e2019-06-29 13:32:58 +020024 "github.com/golang/protobuf/ptypes/duration"
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020025 "istio.io/api/mixer/v1"
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020026)
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.
Marcel van Lohuizenf9bd63e2019-06-29 13:32:58 +020039 baseRetryWait?: duration.Duration @protobuf(3,type=google.protobuf.Duration,name=base_retry_wait)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020040
41 // Max time to wait between retries.
Marcel van Lohuizenf9bd63e2019-06-29 13:32:58 +020042 maxRetryWait?: duration.Duration @protobuf(4,type=google.protobuf.Duration,name=max_retry_wait)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020043}
44
Marcel van Lohuizeneae20e02019-06-29 13:09:43 +020045// Example of single-value enum.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020046NetworkFailPolicy_FailPolicy:
47 // If network connection fails, request is allowed and delivered to the
48 // service.
Marcel van Lohuizeneae20e02019-06-29 13:09:43 +020049 "FAIL_OPEN"
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020050
Marcel van Lohuizeneae20e02019-06-29 13:09:43 +020051NetworkFailPolicy_FailPolicy_value FAIL_OPEN: 0
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020052
53// Defines the per-service client configuration.
54ServiceConfig: {
55 // If true, do not call Mixer Check.
56 disableCheckCalls?: bool @protobuf(1,name=disable_check_calls)
57
58 // If true, do not call Mixer Report.
59 disableReportCalls?: bool @protobuf(2,name=disable_report_calls)
60
61 // Send these attributes to Mixer in both Check and Report. This
62 // typically includes the "destination.service" attribute.
63 // In case of a per-route override, per-route attributes take precedence
64 // over the attributes supplied in the client configuration.
65 mixerAttributes?: v1.Attributes @protobuf(3,type=Attributes,name=mixer_attributes)
66
67 // HTTP API specifications to generate API attributes.
68 httpApiSpec?: [...HTTPAPISpec] @protobuf(4,name=http_api_spec)
69
70 // Quota specifications to generate quota requirements.
71 quotaSpec?: [...QuotaSpec] @protobuf(5,name=quota_spec)
72
73 // Specifies the behavior when the client is unable to connect to Mixer.
74 // This is the service-level policy. It overrides
75 // [mesh-level
76 // policy][istio.mixer.v1.config.client.TransportConfig.network_fail_policy].
77 networkFailPolicy?: NetworkFailPolicy @protobuf(7,name=network_fail_policy)
78
79 // Default attributes to forward to upstream. This typically
80 // includes the "source.ip" and "source.uid" attributes.
81 // In case of a per-route override, per-route attributes take precedence
82 // over the attributes supplied in the client configuration.
83 //
84 // Forwarded attributes take precedence over the static Mixer attributes.
85 // The full order of application is as follows:
86 // 1. static Mixer attributes from the filter config;
87 // 2. static Mixer attributes from the route config;
88 // 3. forwarded attributes from the source filter config (if any);
89 // 4. forwarded attributes from the source route config (if any);
90 // 5. derived attributes from the request metadata.
91 forwardAttributes?: v1.Attributes @protobuf(8,type=Attributes,name=forward_attributes)
92}
93
94// Defines the transport config on how to call Mixer.
95TransportConfig: {
96 // The flag to disable check cache.
97 disableCheckCache?: bool @protobuf(1,name=disable_check_cache)
98
99 // The flag to disable quota cache.
100 disableQuotaCache?: bool @protobuf(2,name=disable_quota_cache)
101
102 // The flag to disable report batch.
103 disableReportBatch?: bool @protobuf(3,name=disable_report_batch)
104
105 // Specifies the behavior when the client is unable to connect to Mixer.
106 // This is the mesh level policy. The default value for policy is FAIL_OPEN.
107 networkFailPolicy?: NetworkFailPolicy @protobuf(4,name=network_fail_policy)
108
109 // Specify refresh interval to write Mixer client statistics to Envoy share
110 // memory. If not specified, the interval is 10 seconds.
Marcel van Lohuizenf9bd63e2019-06-29 13:32:58 +0200111 statsUpdateInterval?: duration.Duration @protobuf(5,type=google.protobuf.Duration,name=stats_update_interval)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200112
113 // Name of the cluster that will forward check calls to a pool of mixer
114 // servers. Defaults to "mixer_server". By using different names for
115 // checkCluster and reportCluster, it is possible to have one set of
116 // Mixer servers handle check calls, while another set of Mixer servers
117 // handle report calls.
118 //
119 // NOTE: Any value other than the default "mixer_server" will require the
120 // Istio Grafana dashboards to be reconfigured to use the new name.
121 checkCluster?: string @protobuf(6,name=check_cluster)
122
123 // Name of the cluster that will forward report calls to a pool of mixer
124 // servers. Defaults to "mixer_server". By using different names for
125 // checkCluster and reportCluster, it is possible to have one set of
126 // Mixer servers handle check calls, while another set of Mixer servers
127 // handle report calls.
128 //
129 // NOTE: Any value other than the default "mixer_server" will require the
130 // Istio Grafana dashboards to be reconfigured to use the new name.
131 reportCluster?: string @protobuf(7,name=report_cluster)
132
133 // Default attributes to forward to Mixer upstream. This typically
134 // includes the "source.ip" and "source.uid" attributes. These
135 // attributes are consumed by the proxy in front of mixer.
136 attributesForMixerProxy?: v1.Attributes @protobuf(8,type=Attributes,name=attributes_for_mixer_proxy)
137}
138
139// Defines the client config for HTTP.
140HttpClientConfig: {
141 // The transport config.
142 transport?: TransportConfig @protobuf(1)
143
144 // Map of control configuration indexed by destination.service. This
145 // is used to support per-service configuration for cases where a
146 // mixerclient serves multiple services.
147 serviceConfigs <_>: ServiceConfig
148
149 // Default destination service name if none was specified in the
150 // client request.
151 defaultDestinationService?: string @protobuf(3,name=default_destination_service)
152
153 // Default attributes to send to Mixer in both Check and
154 // Report. This typically includes "destination.ip" and
155 // "destination.uid" attributes.
156 mixerAttributes?: v1.Attributes @protobuf(4,type=Attributes,name=mixer_attributes)
157
158 // Default attributes to forward to upstream. This typically
159 // includes the "source.ip" and "source.uid" attributes.
160 forwardAttributes?: v1.Attributes @protobuf(5,type=Attributes,name=forward_attributes)
161}
162
163// Defines the client config for TCP.
164TcpClientConfig: {
165 // The transport config.
166 transport?: TransportConfig @protobuf(1)
167
168 // Default attributes to send to Mixer in both Check and
169 // Report. This typically includes "destination.ip" and
170 // "destination.uid" attributes.
171 mixerAttributes?: v1.Attributes @protobuf(2,type=Attributes,name=mixer_attributes)
172
173 // If set to true, disables Mixer check calls.
174 disableCheckCalls?: bool @protobuf(3,name=disable_check_calls)
175
176 // If set to true, disables Mixer check calls.
177 disableReportCalls?: bool @protobuf(4,name=disable_report_calls)
178
179 // Quota specifications to generate quota requirements.
180 // It applies on the new TCP connections.
181 connectionQuotaSpec?: QuotaSpec @protobuf(5,name=connection_quota_spec)
182
183 // Specify report interval to send periodical reports for long TCP
184 // connections. If not specified, the interval is 10 seconds. This interval
185 // should not be less than 1 second, otherwise it will be reset to 1 second.
Marcel van Lohuizenf9bd63e2019-06-29 13:32:58 +0200186 reportInterval?: duration.Duration @protobuf(6,type=google.protobuf.Duration,name=report_interval)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200187}