调用DescribeNamespaceScopeSidecarConfig查询命名空间级别的Sidecar配置。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String 是 DescribeNamespaceScopeSidecarConfig

系统规定参数。取值:DescribeNamespaceScopeSidecarConfig

ServiceMeshId String 是 c7120e75a202d4fd8acb028a86b6a****

ASM实例ID。

Namespace String 否 default

命名空间。

返回数据

名称 类型 示例值 描述
RequestId String 31d3a0f0-07ed-4f6e-9004-1804498c****

请求ID。

ConfigPatches Object

命名空间级别配置内容。

TerminationDrainDuration String 6s

Sidecar代理终止等待时间。

SidecarProxyInitResourceLimit Object

Sidecar代理初始化容器资源限制。

ResourceCPULimit String 2000 m

CPU资源限制。

ResourceMemoryLimit String 50 Mi

内存资源限制。

SidecarProxyInitResourceRequest Object

Sidecar代理初始化容器资源最低申请额度。

ResourceCPURequest String 60 m

CPU资源最低要求。

ResourceMemoryRequest String 30 Mi

内存资源最低要求。

SidecarProxyResourceLimit Object

Sidecar代理容器资源限制。

ResourceCPULimit String 2000 m

CPU资源限制。

ResourceMemoryLimit String 50 Mi

内存资源限制。

SidecarProxyResourceRequest Object

Sidecar代理容器资源最低申请额度。

ResourceCPURequest String 60 m

CPU资源最低要求。

ResourceMemoryRequest String 30 Mi

内存资源限制。

ExcludeOutboundPorts String 81

免于经过Sidecar代理的出口流量端口。

ExcludeOutboundIPRanges String 192.168.1.3/31

免于经过Sidecar代理的出口流量IP地址。

IncludeOutboundIPRanges String 192.168.1.4/31

经过Sidecar代理的出口流量IP地址。

ExcludeInboundPorts String 82

免于经过Sidecar代理的入口流量端口。

IncludeInboundPorts String 83

经过Sidecar代理的入口流量端口。

IncludeOutboundPorts String 84

经过Sidecar代理的出口流量端口。

IstioDNSProxyEnabled Boolean true

是否启用DNS代理功能,取值:

  • true:启用DNS代理功能。
  • false:不启用DNS代理功能。
LifecycleStr String {"postStart":{"exec":{"command":["pilot-agent","wait"]}},"preStop":{"exec":{"command":["/bin/sh","-c","sleep 15"]}}}

Sidecar代理生命周期JSON字符串。

Concurrency Integer 2

istio-proxy并发度设置。

LogLevel String info

日志等级,取值:info、debug、trace、error。

HoldApplicationUntilProxyStarts Boolean true

应用程序启动前是否等待istio-proxy启动完成,取值:

  • true:应用程序启动前等待istio-proxy启动完成。
  • false:应用程序启动前不等待istio-proxy启动完成。
ProxyStatsMatcher Object

用于Envoy监控统计的指标。

InclusionPrefixes Array of String server

Envoy监控统计的指标前缀。

InclusionSuffixes Array of String cluster.outbound

Envoy监控统计的指标后缀。

InclusionRegexps Array of String listener.*.downstream_cx_total

Envoy监控统计的指标正则表达式。

Tracing Object

自定义的链路追踪配置。

Sampling double 99.8

链路追踪的采样率。

CustomTags Map

链路追踪上报的自定义标签。其中键为自定义链路追踪标签的键,String类型;值为自定义链路追踪标签的取值,JSON对象类型,可以选择填入以下字段之一。

  • literal:链路追踪标签值将取固定值,JSON对象类型,其中必须包含value字段,指定固定的字面量值,例如{"value":"test"}。
  • header:链路追踪标签值将取指定的请求头,JSON对象类型,其中必须包含name字段和defaultValue字段,指定请求头的名称和取不到时的默认值,例如{"name":"test","defaultValue":"test"}。
  • environment:链路追踪标签值将取指定的环境变量,JSON对象类型,其中必须包含name字段和defaultValue字段,指定环境变量的名称和取不到时的默认值,例如{"name":"test","defaultValue":"test"}。
MaxPathTagLength Integer 10

链路追踪标签最大长度限制。

InterceptionMode String TPROXY

Sidecar对入向流量的拦截策略,取值如下:

  • REDIRECT:默认的拦截策略,Sidecar将使用重定向方式拦截入向流量。
  • TPROXY:透明代理拦截策略,Sidecar将以透明代理的方式拦截入向流量。

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeNamespaceScopeSidecarConfig
&ServiceMeshId=c7120e75a202d4fd8acb028a86b6a****
&Namespace=default
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeNamespaceScopeSidecarConfigResponse>
    <RequestId>31d3a0f0-07ed-4f6e-9004-1804498c****</RequestId>
    <ConfigPatches>
        <TerminationDrainDuration>6s</TerminationDrainDuration>
        <SidecarProxyInitResourceLimit>
            <ResourceCPULimit>2000 m</ResourceCPULimit>
            <ResourceMemoryLimit>50 Mi</ResourceMemoryLimit>
        </SidecarProxyInitResourceLimit>
        <SidecarProxyInitResourceRequest>
            <ResourceCPURequest>60 m</ResourceCPURequest>
            <ResourceMemoryRequest>30 Mi</ResourceMemoryRequest>
        </SidecarProxyInitResourceRequest>
        <SidecarProxyResourceLimit>
            <ResourceCPULimit>2000 m</ResourceCPULimit>
            <ResourceMemoryLimit>50 Mi</ResourceMemoryLimit>
        </SidecarProxyResourceLimit>
        <SidecarProxyResourceRequest>
            <ResourceCPURequest>60 m</ResourceCPURequest>
            <ResourceMemoryRequest>30 Mi</ResourceMemoryRequest>
        </SidecarProxyResourceRequest>
        <ExcludeOutboundPorts>81</ExcludeOutboundPorts>
        <ExcludeOutboundIPRanges>192.168.1.3/31</ExcludeOutboundIPRanges>
        <IncludeOutboundIPRanges>192.168.1.4/31</IncludeOutboundIPRanges>
        <ExcludeInboundPorts>82</ExcludeInboundPorts>
        <IncludeInboundPorts>83</IncludeInboundPorts>
        <IncludeOutboundPorts>84</IncludeOutboundPorts>
        <IstioDNSProxyEnabled>true</IstioDNSProxyEnabled>
        <LifecycleStr>{"postStart":{"exec":{"command":["pilot-agent","wait"]}},"preStop":{"exec":{"command":["/bin/sh","-c","sleep 15"]}}}</LifecycleStr>
        <Concurrency>2</Concurrency>
        <LogLevel>info</LogLevel>
        <HoldApplicationUntilProxyStarts>true</HoldApplicationUntilProxyStarts>
        <ProxyStatsMatcher>
            <InclusionPrefixes>server</InclusionPrefixes>
            <InclusionSuffixes>cluster.outbound</InclusionSuffixes>
            <InclusionRegexps>listener.*.downstream_cx_total</InclusionRegexps>
        </ProxyStatsMatcher>
        <Tracing>
            <Sampling>99.8</Sampling>
            <MaxPathTagLength>10</MaxPathTagLength>
        </Tracing>
        <InterceptionMode>TPROXY</InterceptionMode>
    </ConfigPatches>
</DescribeNamespaceScopeSidecarConfigResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "31d3a0f0-07ed-4f6e-9004-1804498c****",
  "ConfigPatches" : {
    "TerminationDrainDuration" : "6s",
    "SidecarProxyInitResourceLimit" : {
      "ResourceCPULimit" : "2000 m",
      "ResourceMemoryLimit" : "50 Mi"
    },
    "SidecarProxyInitResourceRequest" : {
      "ResourceCPURequest" : "60 m",
      "ResourceMemoryRequest" : "30 Mi"
    },
    "SidecarProxyResourceLimit" : {
      "ResourceCPULimit" : "2000 m",
      "ResourceMemoryLimit" : "50 Mi"
    },
    "SidecarProxyResourceRequest" : {
      "ResourceCPURequest" : "60 m",
      "ResourceMemoryRequest" : "30 Mi"
    },
    "ExcludeOutboundPorts" : "81",
    "ExcludeOutboundIPRanges" : "192.168.1.3/31",
    "IncludeOutboundIPRanges" : "192.168.1.4/31",
    "ExcludeInboundPorts" : "82",
    "IncludeInboundPorts" : "83",
    "IncludeOutboundPorts" : "84",
    "IstioDNSProxyEnabled" : true,
    "LifecycleStr" : "{\"postStart\":{\"exec\":{\"command\":[\"pilot-agent\",\"wait\"]}},\"preStop\":{\"exec\":{\"command\":[\"/bin/sh\",\"-c\",\"sleep 15\"]}}}",
    "Concurrency" : 2,
    "LogLevel" : "info",
    "HoldApplicationUntilProxyStarts" : true,
    "ProxyStatsMatcher" : {
      "InclusionPrefixes" : [ "server" ],
      "InclusionSuffixes" : [ "cluster.outbound" ],
      "InclusionRegexps" : [ "listener.*.downstream_cx_total" ]
    },
    "Tracing" : {
      "Sampling" : 99.8,
      "MaxPathTagLength" : 10
    },
    "InterceptionMode" : "TPROXY"
  }
}

错误码

访问错误中心查看更多错误码。