偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

聊聊 Envoy 中查看 ServiceEntry 注入信息

網(wǎng)絡(luò) 通信技術(shù)
在Istio中提供了ServiceEntry的配置,將網(wǎng)格外的服務(wù)納入網(wǎng)格管理。將第三方注冊(cè)中心zookeeper、nacos等納入Istio網(wǎng)格可以通過ServiceEntry納入Istio的管理。這些如何注入的,流程是怎么樣,下面通過示例將整個(gè)流程竄起來。

  [[431019]]

引言

在Istio中提供了ServiceEntry的配置,將網(wǎng)格外的服務(wù)納入網(wǎng)格管理。將第三方注冊(cè)中心zookeeper、nacos等納入Istio網(wǎng)格可以通過ServiceEntry納入Istio的管理。這些如何注入的,流程是怎么樣,下面通過示例將整個(gè)流程竄起來。

一、ServiceEntry注入工作原理

ServiceEntry注入的流程圖

備注:注入流程如下

@1 將ServiceEntry注入到kube-apiserver中

@2 Istiod中通過kubeConfigController監(jiān)聽ServiceEntry配置的變化

@3 Istiod將ServiceEntry封裝成PushRequest發(fā)送給XDSServer

@4 XDSServer轉(zhuǎn)換為xDS格式下發(fā)給Envoy

二、Envoy中查看ServiceEntry

1.組織ServiceEntry配置

通過ServiceEntry配置baidu域名,將其作為網(wǎng)格服務(wù)的一部分serviceentry.yaml

  1. --- 
  2. apiVersion: networking.istio.io/v1alpha3 
  3. kind: ServiceEntry 
  4. metadata: 
  5.   name: baidu-external 
  6. spec: 
  7.   hosts: 
  8.     - www.baidu.com 
  9.   ports: 
  10.     - number: 80 
  11.       name: HTTP 
  12.       protocol: HTTP 
  13.   resolution: DNS 
  14.   location: MESH_INTERNAL 

2.部署ServiceEntry配置

通過下面命令部署到Kubernetes api server中

  1. kubectl apply -f serviceentry.yaml -n default 
  2. serviceentry.networking.istio.io/baidu-external created 

3.Istio中查看ServiceEntry信息

登陸istiod容器

  1. kubectl -n istio-system exec -it istiod-5c4b9cb6b5-6n68m -- /bin/bash 

通過registryz命令查看,已經(jīng)注入到istio中。

  1. istio-proxy@istiod-5c4b9cb6b5-6n68m:/$ curl http://127.0.0.1:15014/debug/registryz 
  2.   { 
  3.     "Attributes": { 
  4.       "ServiceRegistry""External"
  5.       "Name""www.baidu.com"
  6.       "Namespace""default"
  7.       "Labels"null
  8.       "UID"""
  9.       "ExportTo"null
  10.       "LabelSelectors"null
  11.       "ClusterExternalAddresses"null
  12.       "ClusterExternalPorts"null 
  13.     }, 
  14.     "ports": [ 
  15.       { 
  16.         "name""HTTP"
  17.         "port": 80, 
  18.         "protocol""HTTP" 
  19.       } 
  20.     ], 
  21.     "creationTime""2021-10-14T03:01:24Z"
  22.     "hostname""www.baidu.com"
  23.     "address""0.0.0.0"
  24.     "autoAllocatedAddress""240.240.0.5"
  25.     "Mutex": {}, 
  26.     "Resolution": 1, 
  27.     "MeshExternal"false 
  28.   }, 
  29.   // ... 

4.在Envoy查看xDS信息

  1. istioctl proxy-config route productpage-v1-6b746f74dc-2c55l -n default -o json 
  2.   //... 
  3.   { 
  4.                   "name""www.baidu.com:80"
  5.                   "domains": [ 
  6.                       "www.baidu.com"
  7.                       "www.baidu.com:80" 
  8.                   ], 
  9.                   "routes": [ 
  10.                       { 
  11.                           "name""default"
  12.                           "match": { 
  13.                               "prefix""/" 
  14.                           }, 
  15.                           "route": { 
  16.                               "cluster""outbound|80||www.baidu.com"
  17.                               "timeout""0s"
  18.                               "retryPolicy": { 
  19.                                   "retryOn""connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes"
  20.                                   "numRetries": 2, 
  21.                                   "retryHostPredicate": [ 
  22.                                       { 
  23.                                           "name""envoy.retry_host_predicates.previous_hosts" 
  24.                                       } 
  25.                                   ], 
  26.                                   "hostSelectionRetryMaxAttempts""5"
  27.                                   "retriableStatusCodes": [ 
  28.                                       503 
  29.                                   ] 
  30.                               }, 
  31.                               "maxStreamDuration": { 
  32.                                   "maxStreamDuration""0s"
  33.                                   "grpcTimeoutHeaderMax""0s" 
  34.                               } 
  35.                           }, 
  36.                           "decorator": { 
  37.                               "operation""www.baidu.com:80/*" 
  38.                           } 
  39.                       } 
  40.                   ], 
  41.                   "includeRequestAttemptCount"true 
  42.    } 
  43.    // ...          

小結(jié):通過上面的命令追蹤,ServiceEntry的示例下發(fā)到了數(shù)據(jù)面Envoy中。

責(zé)任編輯:武曉燕 來源: 瓜農(nóng)老梁
相關(guān)推薦

2021-11-29 10:24:56

WasmEnvoy 負(fù)載均衡

2021-03-17 09:35:51

MySQL數(shù)據(jù)庫explain

2015-12-21 13:34:31

LinuxGPU顯卡硬件

2023-10-07 11:04:58

WPF數(shù)據(jù)UI

2023-11-09 11:56:28

MySQL死鎖

2019-07-23 15:04:54

JavaScript調(diào)用棧事件循環(huán)

2024-04-26 00:00:00

Rust檢查器代碼

2021-08-31 07:54:24

SQLDblink查詢

2020-05-06 22:07:53

UbuntuLinux操作系統(tǒng)

2021-11-17 08:11:35

MySQL

2010-11-01 17:22:44

2024-05-22 08:00:00

2021-08-16 06:56:21

Slice數(shù)組類型內(nèi)存

2022-04-02 08:14:02

JavaThreadLoca數(shù)據(jù)

2021-11-09 06:55:03

SQLServer排序

2023-08-29 09:46:12

SQLCTE遞歸

2021-12-11 19:00:54

Java中斷機(jī)制

2021-10-30 19:56:10

Flutter按鈕 Buttons

2022-05-11 09:01:54

Swift類型系統(tǒng)幻象類型

2023-07-28 09:54:14

SQL數(shù)據(jù)Excel
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)