blob: 50d61d546f4944313f520ba6a8d3dc4505a77397 [file] [log] [blame]
Marcel van Lohuizen5274e982019-04-28 17:51:43 +02001
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +02002// 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020015
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020016// $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
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020019
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020020// Describes the configuration state for the Mixer client library that's built into Envoy.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020021package client
22
23import (
24 "istio.io/api/mixer/v1"
Marcel van Lohuizen64cb20a2019-08-06 21:24:14 +020025 "time"
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020026)
27
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020028// Specifies the behavior when the client is unable to connect to Mixer.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020029NetworkFailPolicy: {
30
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020031 // Specifies the behavior when the client is unable to connect to Mixer.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020032 policy?: NetworkFailPolicy_FailPolicy @protobuf(1,type=FailPolicy)
33
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020034 // Max retries on transport error.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020035 maxRetry?: uint32 @protobuf(2,name=max_retry)
36
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020037 // Base time to wait between retries. Will be adjusted by exponential
38 // backoff and jitter.
Marcel van Lohuizen64cb20a2019-08-06 21:24:14 +020039 baseRetryWait?: time.Duration @protobuf(3,type=google.protobuf.Duration,name=base_retry_wait)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020040
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020041 // Max time to wait between retries.
Marcel van Lohuizen64cb20a2019-08-06 21:24:14 +020042 maxRetryWait?: time.Duration @protobuf(4,type=google.protobuf.Duration,name=max_retry_wait)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020043}
44
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020045// Example of single-value enum.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020046NetworkFailPolicy_FailPolicy:
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020047 // 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
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020053// Defines the per-service client configuration.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020054ServiceConfig: {
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020055 // If true, do not call Mixer Check.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020056 disableCheckCalls?: bool @protobuf(1,name=disable_check_calls)
57
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020058 // If true, do not call Mixer Report.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020059 disableReportCalls?: bool @protobuf(2,name=disable_report_calls)
60
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020061 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020065 mixerAttributes?: v1.Attributes @protobuf(3,type=Attributes,name=mixer_attributes)
66
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020067 // HTTP API specifications to generate API attributes.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020068 httpApiSpec?: [...HTTPAPISpec] @protobuf(4,name=http_api_spec)
69
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020070 // Quota specifications to generate quota requirements.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020071 quotaSpec?: [...QuotaSpec] @protobuf(5,name=quota_spec)
72
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020073 // 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].
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020077 networkFailPolicy?: NetworkFailPolicy @protobuf(7,name=network_fail_policy)
78
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020079 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020091 forwardAttributes?: v1.Attributes @protobuf(8,type=Attributes,name=forward_attributes)
92}
93
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020094// Defines the transport config on how to call Mixer.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020095TransportConfig: {
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020096 // The flag to disable check cache.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +020097 disableCheckCache?: bool @protobuf(1,name=disable_check_cache)
98
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +020099 // The flag to disable quota cache.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200100 disableQuotaCache?: bool @protobuf(2,name=disable_quota_cache)
101
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200102 // The flag to disable report batch.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200103 disableReportBatch?: bool @protobuf(3,name=disable_report_batch)
104
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200105 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200107 networkFailPolicy?: NetworkFailPolicy @protobuf(4,name=network_fail_policy)
108
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200109 // Specify refresh interval to write Mixer client statistics to Envoy share
110 // memory. If not specified, the interval is 10 seconds.
Marcel van Lohuizen64cb20a2019-08-06 21:24:14 +0200111 statsUpdateInterval?: time.Duration @protobuf(5,type=google.protobuf.Duration,name=stats_update_interval)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200112
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200113 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200121 checkCluster?: string @protobuf(6,name=check_cluster)
122
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200123 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200131 reportCluster?: string @protobuf(7,name=report_cluster)
132
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200133 // 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.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200136 attributesForMixerProxy?: v1.Attributes @protobuf(8,type=Attributes,name=attributes_for_mixer_proxy)
137}
138
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200139// Defines the client config for HTTP.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200140HttpClientConfig: {
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200141 // The transport config.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200142 transport?: TransportConfig @protobuf(1)
143
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200144 // 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.
Jason Wang5f471672019-08-23 09:59:46 -0700147 serviceConfigs?: {
Marcel van Lohuizenf03161d2019-08-02 22:55:43 +0200148 <_>: ServiceConfig
149 } @protobuf(2,type=map<string,ServiceConfig>,service_configs)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200150
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200151 // Default destination service name if none was specified in the
152 // client request.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200153 defaultDestinationService?: string @protobuf(3,name=default_destination_service)
154
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200155 // Default attributes to send to Mixer in both Check and
156 // Report. This typically includes "destination.ip" and
157 // "destination.uid" attributes.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200158 mixerAttributes?: v1.Attributes @protobuf(4,type=Attributes,name=mixer_attributes)
159
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200160 // Default attributes to forward to upstream. This typically
161 // includes the "source.ip" and "source.uid" attributes.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200162 forwardAttributes?: v1.Attributes @protobuf(5,type=Attributes,name=forward_attributes)
163}
164
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200165// Defines the client config for TCP.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200166TcpClientConfig: {
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200167 // The transport config.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200168 transport?: TransportConfig @protobuf(1)
169
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200170 // Default attributes to send to Mixer in both Check and
171 // Report. This typically includes "destination.ip" and
172 // "destination.uid" attributes.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200173 mixerAttributes?: v1.Attributes @protobuf(2,type=Attributes,name=mixer_attributes)
174
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200175 // If set to true, disables Mixer check calls.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200176 disableCheckCalls?: bool @protobuf(3,name=disable_check_calls)
177
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200178 // If set to true, disables Mixer check calls.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200179 disableReportCalls?: bool @protobuf(4,name=disable_report_calls)
180
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200181 // Quota specifications to generate quota requirements.
182 // It applies on the new TCP connections.
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200183 connectionQuotaSpec?: QuotaSpec @protobuf(5,name=connection_quota_spec)
184
Marcel van Lohuizenb1d44392019-08-23 13:13:54 +0200185 // Specify report interval to send periodical reports for long TCP
186 // connections. If not specified, the interval is 10 seconds. This interval
187 // should not be less than 1 second, otherwise it will be reset to 1 second.
Marcel van Lohuizen64cb20a2019-08-06 21:24:14 +0200188 reportInterval?: time.Duration @protobuf(6,type=google.protobuf.Duration,name=report_interval)
Marcel van Lohuizen5274e982019-04-28 17:51:43 +0200189}