iT邦幫忙

2022 iThome 鐵人賽

DAY 20
0
DevOps

5哥窟-5G與肝臟買賣系列 第 20

20-Istio free5gc 核心網路跨叢集容錯

  • 分享至 

  • xImage
  •  

測試環境版本:
> istio: 1.13.1
> kubernetes: v1.23.4

本篇延續上篇針對nrf進行容錯部署

金絲雀部署

上篇只有在remote cluster部署v2,要在primary cluster部署v1才有辦法進行金絲雀部署

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: free5gc-nrf-canary
spec:
  hosts:
    - free5gc-nrf-svc
  http:
  - route:
    - destination:
        host: free5gc-nrf-svc.5gc.svc.cluster.local
        subset: v1
      weight: 80
    - destination:
        host: free5gc-nrf-svc.5gc.svc.cluster.local
        subset: v2
      weight: 20
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: free5gc-nrf-canary
spec:
  host: free5gc-nrf-svc.5gc.svc.cluster.local
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2
    labels:
      version: v2

熔斷

"free5gc-nrf-circuit-breaking.yaml" [noeol] 18L, 446C                                                                                       1,1           All
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: free5gc-nrf-circuit-breaking
spec:
  host: free5gc-nrf-svc.5gc.svc.cluster.local
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 1
      http:
        http1MaxPendingRequests: 1
        maxRequestsPerConnection: 1
    outlierDetection:
      consecutive5xxErrors: 1
      interval: 1s
      baseEjectionTime: 3m
      maxEjectionPercent: 100

重試

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: free5gc-nrf-retries
spec:
  hosts:
  - free5gc-nrf-svc
  http:
  - route:
    - destination:
        host: free5gc-nrf-svc.5gc.svc.cluster.local
    retries:
      attempts: 3
      perTryTimeout: 1s
      retryOn: 5xx,retriable-4xx

上一篇
19-Istio free5gc 核心網路跨叢集部署
下一篇
21-Free5Gmano介紹
系列文
5哥窟-5G與肝臟買賣30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言