当前位置:   article > 正文

Istio的熔断_istio 熔断

istio 熔断

一、理解熔断
  熔断(Circuit Breaker),原是指当电流超过规定值时断开电路,进行短路保护或严重过载时的一种保护机制。后来熔断也广泛应用于金融领域,指当股指波幅达到规定的熔断点时,交易所为控制风险采取的暂停交易措施。而在软件领域,熔断则是指当服务达到系统负载阈值时,为避免整个软件系统不可用,而采取的一种主动保护措施。对于微服务系统而言,熔断尤为重要,它可以使系统在遭遇某些模块故障时,通过服务降级等方式来提高系统核心功能的可用性,得以应对来自故障、潜在峰值或其他未知网络因素的影响。
在这里插入图片描述

二、配置熔断

1)部署httpbin服务

➜  kubectl apply -f ../../samples/httpbin/httpbin.yaml 
serviceaccount/httpbin unchanged
service/httpbin unchanged
deployment.apps/httpbin unchanged

➜  kubectl describe pods httpbin-74fb669cc6-vn897 
Name:         httpbin-74fb669cc6-vn897
Namespace:    default
Priority:     0
Node:         docker-desktop/192.168.65.4
Start Time:   Sat, 03 Jul 2021 17:23:17 +0800
Labels:       app=httpbin
              istio.io/rev=default
              pod-template-hash=74fb669cc6
              security.istio.io/tlsMode=istio
              service.istio.io/canonical-name=httpbin
              service.istio.io/canonical-revision=v1
              version=v1
Annotations:  kubectl.kubernetes.io/default-container: httpbin
              kubectl.kubernetes.io/default-logs-container: httpbin
              prometheus.io/path: /stats/prometheus
              prometheus.io/port: 15020
              prometheus.io/scrape: true
              sidecar.istio.io/status:
                {
   "initContainers":["istio-init"],"containers":["istio-proxy"],"volumes":["istio-envoy","istio-data","istio-podinfo","istiod-ca-cert"],"ima...
Status:       Running
IP:           10.1.8.151
IPs:
  IP:           10.1.8.151
Controlled By:  ReplicaSet/httpbin-74fb669cc6
Init Containers:
  istio-init:
    Container ID:  docker://538c2e169bfedaf636a942bee92183c59f79b47bea25a286f242e74c22abddad
    Image:         docker.io/istio/proxyv2:1.10.1
    Image ID:      docker-pullable://istio/proxyv2@sha256:d9b295da022ad826c54d5bb49f1f2b661826efd8c2672b2f61ddc2aedac78cfc
    Port:          <none>
    Host Port:     <none>
    Args:
      istio-iptables
      -p
      15001
      -z
      15006
      -u
      1337
      -m
      REDIRECT
      -i
      *
      -x
      
      -b
      *
      -d
      15090,15021,15020
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Sat, 24 Jul 2021 17:03:16 +0800
      Finished:     Sat, 24 Jul 2021 17:03:17 +0800
    Ready:          True
    Restart Count:  1
    Limits:
      cpu:     2
      memory:  1Gi
    Requests:
      cpu:        10m
      memory:     40Mi
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from httpbin-token-qk94s (ro)
Containers:
  httpbin:
    Container ID:   docker://3a3e8c32b05eb6f022ef6f660bad99128a7459452949bf3d43c0693dac5c82b1
    Image:          docker.io/kennethreitz/httpbin
    Image ID:       docker-pullable://kennethreitz/httpbin@sha256:599fe5e5073102dbb0ee3dbb65f049dab44fa9fc251f6835c9990f8fb196a72b
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Sat, 24 Jul 2021 17:03:22 +0800
    Last State:     Terminated
      Reason:       Error
      Exit Code:    255
      Started:      Sat, 03 Jul 2021 17:26:41 +0800
      Finished:     Sat, 24 Jul 2021 16:41:32 +0800
    Ready:          True
    Restart Count:  1
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from httpbin-token-qk94s (ro)
  istio-proxy:
    Container ID:  docker://fce4a591308062ef5f4c6aebb1e738e2fc79a4c8cfcc2498f6481a31d7ddb7aa
    Image:         docker.io/istio/proxyv2:1.10.1
    Image ID:      docker-pullable://istio/proxyv2@sha256:d9b295da022ad826c54d5bb49f1f2b661826efd8c2672b2f61ddc2aedac78cfc
    Port:          15090/TCP
    Host Port:     0/TCP
    Args:
      proxy
      sidecar
      --domain
      $(POD_NAMESPACE).svc.cluster.local
      --serviceCluster
      httpbin.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/915702
推荐阅读
相关标签
  

闽ICP备14008679号