【03】Istio Gateway示例配置

3.1 开放kiali至集群外部

  • 首先将istio-inressateway暴露集群外部;

    在node02的ens33网卡上面有多余的ip地址,将该地址绑定在igressgateway的svc 上面。

    sh 复制代码
    kubectl edit svc istio-ingressgateway -n istio-system
  • 定义kiali的ingress gateway的资源配置清单

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: kiali-gateway
      namespace: istio-system
    spec:
      selector:
        app: istio-ingressgateway
      servers:
      - hosts:
        - "kiali.icloud2native.com"
        port:
          name: http-kiali
          number: 80
          protocol: HTTP
    ---
  • 定义kiali的VirtualService清单

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
      name: kiali-vs
      namespace: istio-system
    spec:
      gateways:
      - kiali-gateway
      hosts:
      - "kiali.icloud2native.com"
      http:
      - match:
        - uri:
            prefix: /
        route:
        - destination:
            host: kiali
            port:
              number: 20001
  • 定义kiali的DestinationRule清单

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: kiali-dr
      namespace: istio-system
    spec:
      host: kiali
      trafficPolicy:
        tls:
          mode: DISABLE
  • 本地解析,后访问kiali

3.2 开放grafana至集群外

  • 定义grafana的gateway

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: granafa-gw
      namespace: istio-system
    spec:
      selector:
        app: istio-ingressgateway
      servers:
      - port:
          name: http-80
          number: 80
          protocol: HTTP
        hosts:
        - "grafana.icloud2native.com"
    ---
  • 定义grafana的virtualservice

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
      name: grafana-vs
      namespace: istio-system
    spec:
      gateways:
      - granafa-gw
      hosts:
      - "grafana.icloud2native.com"
      http:
      - match:
        - uri:
            prefix: /
        route:
        - destination:
            host: grafana
            port:
              number: 3000
  • 定义grafana的dr

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: grafana
      namespace: istio-system
    spec:
      host: grafana
      trafficPolicy:
        tls:
          mode: DISABLE
    ---
  • 访问grafana

3.3 开放prometheus至集群外

  • prometheus的gateway,vs,dr资源配置清单

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: prometheus-gateway
      namespace: istio-system
    spec:
      selector:
        app: istio-ingressgateway
      servers:
      - port:
          number: 80
          name: http
          protocol: HTTP
        hosts:
        - "prometheus.icloud2native.com"
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
      name: prometheus-virtualservice
      namespace: istio-system
    spec:
      hosts:
      - "prometheus.icloud2native.com"
      gateways:
      - prometheus-gateway
      http:
      - match:
        - uri:
            prefix: /
        route:
        - destination:
            host: prometheus
            port:
              number: 9090
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: prometheus
      namespace: istio-system
    spec:
      host: prometheus
      trafficPolicy:
        tls:
          mode: DISABLE
    ---
  • 访问prometheus

3.4 开放trace至集群外

  • trace的gateway,vs,dr资源配置清单

    yaml 复制代码
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: tracing-gateway
      namespace: istio-system
    spec:
      selector:
        app: istio-ingressgateway
      servers:
      - port:
          number: 80
          name: http
          protocol: HTTP
        hosts:
        - "tracing.icloud2native.com"
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
      name: tracing-virtualservice
      namespace: istio-system
    spec:
      hosts:
      - "tracing.icloud2native.com"
      gateways:
      - tracing-gateway
      http:
      - match:
        - uri:
            prefix: /
        route:
        - destination:
            host: tracing
            port:
              number: 80
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: tracing-dr
      namespace: istio-system
    spec:
      host: tracing
      trafficPolicy:
        tls:
          mode: DISABLE
    ---
  • 访问Jaeger

相关推荐
EasyCVR1 小时前
萤石设备视频接入平台EasyCVR多品牌摄像机视频平台海康ehome平台(ISUP)接入EasyCVR不在线如何排查?
运维·服务器·网络·人工智能·ffmpeg·音视频
明月看潮生2 小时前
青少年编程与数学 02-003 Go语言网络编程 15课题、Go语言URL编程
开发语言·网络·青少年编程·golang·编程与数学
龙哥说跨境3 小时前
如何利用指纹浏览器爬虫绕过Cloudflare的防护?
服务器·网络·python·网络爬虫
懒大王就是我3 小时前
C语言网络编程 -- TCP/iP协议
c语言·网络·tcp/ip
Elaine2023913 小时前
06 网络编程基础
java·网络
海绵波波1074 小时前
Webserver(4.3)TCP通信实现
服务器·网络·tcp/ip
热爱跑步的恒川7 小时前
【论文复现】基于图卷积网络的轻量化推荐模型
网络·人工智能·开源·aigc·ai编程
云飞云共享云桌面8 小时前
8位机械工程师如何共享一台图形工作站算力?
linux·服务器·网络
音徽编程10 小时前
Rust异步运行时框架tokio保姆级教程
开发语言·网络·rust
幺零九零零11 小时前
【C++】socket套接字编程
linux·服务器·网络·c++