努力挣扎的生活 努力挣扎的生活
  • 前端文章

    • JavaScript
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • 运维基础
  • 监控
  • 日志系统
  • 安全记录
  • 分布式存储
  • gitlab安装
  • jenkins安装和管理
  • Jenkins工具集成
  • pipeline流水线
  • Docker
  • Kubernetes
  • Nexus
  • Rancher
  • Prometheus
  • ELK(EFK)
  • 虚拟化
  • Mysql
  • PostgreSQL
  • Redis
  • MongoDB
  • clickhouse
关于
  • 分类
  • 标签
  • 归档
  • 收藏
  • 更多
GitHub (opens new window)

yangfk

瑟瑟发抖的小运维
  • 前端文章

    • JavaScript
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • 运维基础
  • 监控
  • 日志系统
  • 安全记录
  • 分布式存储
  • gitlab安装
  • jenkins安装和管理
  • Jenkins工具集成
  • pipeline流水线
  • Docker
  • Kubernetes
  • Nexus
  • Rancher
  • Prometheus
  • ELK(EFK)
  • 虚拟化
  • Mysql
  • PostgreSQL
  • Redis
  • MongoDB
  • clickhouse
关于
  • 分类
  • 标签
  • 归档
  • 收藏
  • 更多
GitHub (opens new window)
  • Docker

  • Kubernetes

  • Nexus

  • Rancher

  • Prometheus

  • ELK

  • 虚拟化

  • Istio

    • istio部署
    • istio服务组件
    //
    • 云计算虚拟化
    • Istio
    yangfk
    2025-04-23

    istio服务组件

    //

    # istio之VirtualService

    VirtualService (opens new window)

    • 当携带请求头 end-user:jason 的时候请求reviews-v2,否则请求 reviews-v3
    apiVersion: networking.istio.io/v1
    kind: VirtualService
    metadata:
      name: reviews
    spec:
      hosts:
      - reviews
      http:
      - match:
        - headers:
            end-user:
              exact: jason
        route:
        - destination:
            host: reviews
            subset: v2
      - route:
        - destination:
            host: reviews
            subset: v3
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    # istio之Destination

    apiVersion: networking.istio.io/v1
    kind: DestinationRule
    metadata:
      name: my-destination-rule
    spec:
      host: my-svc
      trafficPolicy:  #全局定义
        loadBalancer:
          simple: RANDOM
      subsets:
      - name: v1
        labels:
          version: v1
      - name: v2
        labels:
          version: v2
        trafficPolicy:
          loadBalancer:
            simple: ROUND_ROBIN
      - name: v3
        labels:
          version: v3
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    # istio之Gateway

    apiVersion: networking.istio.io/v1
    kind: Gateway
    metadata:
      name: ext-host-gwy
    spec:
      selector:
        app: my-gateway-controller
      servers:
      - port:
          number: 443
          name: https
          protocol: HTTPS
        hosts:
        - ext-host.example.com
        tls:
          mode: SIMPLE
          credentialName: ext-host-cert
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    # istio之VirtualService

    apiVersion: networking.istio.io/v1
    kind: VirtualService
    metadata:
      name: virtual-svc
    spec:
      hosts:
      - ext-host.example.com
      gateways:
      - ext-host-gwy
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    # istio之ServiceEntry

    apiVersion: networking.istio.io/v1
    kind: ServiceEntry
    metadata:
      name: svc-entry
    spec:
      hosts:
      - ext-svc.example.com
      ports:
      - number: 443
        name: https
        protocol: HTTPS
      location: MESH_EXTERNAL
      resolution: DNS
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # istio之Sidecar

    apiVersion: networking.istio.io/v1
    kind: Sidecar
    metadata:
      name: default
      namespace: bookinfo
    spec:
      egress:
      - hosts:
        - "./*"
        - "istio-system/*"
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    //
    如果此文章对您有帮助,点击 -->> 请博主喝咖啡 (opens new window)
    上次更新: 2025/05/09, 11:56:57
    istio部署

    ← istio部署

    最近更新
    01
    nginx之resolver解析
    06-19
    02
    cephadm部署分布式存储
    05-30
    03
    istio部署
    04-18
    更多文章>
    Theme by Vdoing | Copyright © 2019-2025 yangfk | 湘ICP备2021014415号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式
    ×
    //