istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tools/packaging/common/gcp_envoy_bootstrap.json (about)

     1  {
     2    "node": {
     3      {{ if (index .metadata.Labels "td.networking.gke.io/mesh-name") }}
     4        "id": "projects/{{ .gcp_project_number }}/networks/mesh:{{ (index .metadata.Labels "td.networking.gke.io/mesh-name") }}/nodes/{{ .nodeID}}",
     5      {{ else if (index .metadata.Labels "td.networking.gke.io/gateway-name") }}
     6        "id": "projects/{{ .gcp_project_number }}/networks/scope:{{ (index .metadata.Labels "td.networking.gke.io/gateway-name") }}/nodes/{{ .nodeID}}",
     7      {{ else }}
     8        "id": "projects/{{ .gcp_project_number }}/networks/default/nodes/{{ .nodeID}}",
     9      {{ end }}
    10      "cluster": "{{ .cluster }}",
    11      "locality": {
    12        {{ if .region }}
    13        "region": "{{ .region }}",
    14        {{ end }}
    15        {{ if .zone }}
    16        "zone": "{{ .zone }}",
    17        {{ end }}
    18        {{ if .sub_zone }}
    19        "sub_zone": "{{ .sub_zone }}",
    20        {{ end }}
    21      },
    22      "metadata": {{ .meta_json_str }}
    23    },
    24    "dynamic_resources": {
    25      "lds_config": {
    26        "resource_api_version": "V3",
    27        "ads": {}
    28      },
    29      "cds_config": {
    30        "resource_api_version": "V3",
    31        "ads": {}
    32      },
    33      "ads_config": {
    34        "api_type": "GRPC",
    35        "transport_api_version": "V3",
    36        "grpc_services": [
    37          {
    38            "google_grpc": {
    39              "target_uri": "{{ .discovery_address }}",
    40              "stat_prefix": "googlegrpcxds",
    41              "channel_credentials": {
    42                "ssl_credentials": {
    43                  {{ with .xds_root_cert}}"root_certs": {"filename": "{{.}}"}{{ end }}
    44                }
    45              },
    46              "call_credentials": [{
    47              {{ if .sts }}
    48                "sts_service": {
    49                  "token_exchange_service_uri": "http://localhost:{{ .sts_port }}/token",
    50                  "subject_token_path": "./var/run/secrets/tokens/istio-token",
    51                  "subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
    52                  "scope": "https://www.googleapis.com/auth/cloud-platform"
    53                }
    54              {{ else }}
    55                "google_compute_engine": {}
    56              {{ end }}
    57              }],
    58              "channel_args": {
    59                "args": {
    60                  "grpc.http2.max_pings_without_data": {
    61                    "int_value": 0
    62                  },
    63                  "grpc.keepalive_time_ms": {
    64                    "int_value": 10000
    65                  },
    66                  "grpc.keepalive_timeout_ms": {
    67                    "int_value": 20000
    68                  }
    69                }
    70              }
    71            },
    72            "initial_metadata": [
    73            {{ if .sts }}
    74            {{ if .gcp_project_id }}
    75              {
    76                "key": "x-goog-user-project",
    77                "value": "{{ .gcp_project_id }}"
    78              }
    79            {{ end }}
    80            {{ end }}
    81            ]
    82          }
    83        ]
    84      }
    85    },
    86    "cluster_manager": {
    87      "load_stats_config": {
    88        "api_type": "GRPC",
    89        "transport_api_version": "V3",
    90        "grpc_services": [
    91          {
    92            "google_grpc": {
    93              "target_uri": "{{ .discovery_address }}",
    94              "stat_prefix": "googlegrpcxds",
    95              "channel_credentials": {
    96                "ssl_credentials": {}
    97              },
    98              "call_credentials": [{
    99              {{ if .sts }}
   100                "sts_service": {
   101                  "token_exchange_service_uri": "http://localhost:{{ .sts_port }}/token",
   102                  "subject_token_path": "./var/run/secrets/tokens/istio-token",
   103                  "subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
   104                  "scope": "https://www.googleapis.com/auth/cloud-platform"
   105                }
   106              {{ else }}
   107                "google_compute_engine": {}
   108              {{ end }}
   109              }],
   110              "channel_args": {
   111                "args": {
   112                  "grpc.http2.max_pings_without_data": {
   113                    "int_value": 0
   114                  },
   115                  "grpc.keepalive_time_ms": {
   116                    "int_value": 10000
   117                  },
   118                  "grpc.keepalive_timeout_ms": {
   119                    "int_value": 20000
   120                  }
   121                }
   122              }
   123            },
   124            "initial_metadata": [
   125            {{ if .sts }}
   126            {{ if .gcp_project_id }}
   127              {
   128                "key": "x-goog-user-project",
   129                "value": "{{ .gcp_project_id }}"
   130              }
   131            {{ end }}
   132            {{ end }}
   133            ]
   134          }
   135        ]
   136      }
   137    },
   138    "admin": {
   139      "access_log_path": "/dev/null",
   140      "address": {
   141        "socket_address": {
   142          "address": "127.0.0.1",
   143          "port_value": {{ .config.ProxyAdminPort }}
   144        }
   145      }
   146    }
   147    ,
   148    "layered_runtime": {
   149      "layers": [
   150        {
   151          "name": "rtds_layer",
   152          "rtds_layer": {
   153            "name": "traffic_director_runtime",
   154            "rtds_config": {
   155  	    "resource_api_version": "V3",
   156              "ads": {}
   157             }
   158         }
   159        }
   160       ]
   161    },
   162    "static_resources": {
   163      "clusters": [
   164        {
   165          "name": "agent",
   166          "type": "STATIC",
   167          "connect_timeout": "0.250s",
   168          "lb_policy": "ROUND_ROBIN",
   169          "load_assignment": {
   170            "cluster_name": "agent",
   171            "endpoints": [{
   172              "lb_endpoints": [{
   173                "endpoint": {
   174                  "address":{
   175                    "socket_address": {
   176                      "protocol": "TCP",
   177                      "address": "{{ .localhost }}",
   178                      "port_value": {{ .config.StatusPort }}
   179                    }
   180                  }
   181                }
   182              }]
   183            }]
   184          }
   185        }
   186      ],
   187      "listeners":[
   188        {
   189          "address": {
   190             "socket_address": {
   191               "protocol": "TCP",
   192               "address": "{{ .wildcard }}",
   193               "port_value": {{ .envoy_status_port }}
   194             }
   195          },
   196          "filter_chains": [
   197            {
   198              "filters": [
   199                {
   200                  "name": "envoy.filters.network.http_connection_manager",
   201                  "typed_config": {
   202                    "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
   203                    "codec_type": "AUTO",
   204                    "stat_prefix": "agent",
   205                    "route_config": {
   206                      "virtual_hosts": [
   207                        {
   208                          "name": "backend",
   209                          "domains": [
   210                            "*"
   211                          ],
   212                          "routes": [
   213                            {
   214                              "match": {
   215                                "prefix": "/healthz/ready"
   216                              },
   217                              "route": {
   218                                "cluster": "agent"
   219                              }
   220                            }
   221                          ]
   222                        }
   223                      ]
   224                    },
   225                    "http_filters": [{
   226                      "name": "envoy.filters.http.router",
   227                      "typed_config": {
   228                        "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
   229                      }
   230                    }]
   231                  }
   232                }
   233              ]
   234            }
   235          ]
   236        }
   237      ]
   238    }
   239  }