首页 > 其他分享 >istio部署demoapp应用 (四) Ingress-gateway暴露demoapp

istio部署demoapp应用 (四) Ingress-gateway暴露demoapp

时间:2022-10-25 15:36:39浏览次数:56  
标签:Ingress ServerName istio TCP Took demoapp 172.20 milliseconds

proxy-gateway.yaml

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: proxy-gateway
  namespace: istio-system
spec:
  selector:
    app: istio-ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "app.wgs.com"
---

virtualservice-demoapp.yaml

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: proxy
spec:
  hosts:
  - "app.wgs.com"                 # 对应于gateways/proxy-gateway
  gateways:
  - istio-system/proxy-gateway    # 相关定义仅应用于Ingress Gateway上
  # - mesh                        # 启用该列表项,意味着该VS同时应用于各Sidecar上
  http:
  - name: default
    route:
    - destination:
        host: proxy

创建资源

# kubectl apply -f proxy-gateway.yaml -f proxy-virtualservice-proxy.yaml 
gateway.networking.istio.io/proxy-gateway created
virtualservice.networking.istio.io/proxy created

查看Istio-ingress-gateway svc EXTERNAL-IP

~# kubectl get svc -n istio-system 
NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)                                                                      AGE
grafana                ClusterIP      10.100.124.243   <none>            3000/TCP                                                                     4d19h
istio-egressgateway    ClusterIP      10.100.121.95    <none>            80/TCP,443/TCP                                                               4d19h
istio-ingressgateway   LoadBalancer   10.100.145.112   192.168.174.250   15021:32417/TCP,80:46683/TCP,443:37652/TCP,31400:59146/TCP,15443:30622/TCP   4d19h
istiod                 ClusterIP      10.100.149.76    <none>            15010/TCP,15012/TCP,443/TCP,15014/TCP                                        4d19h
jaeger-collector       ClusterIP      10.100.122.235   <none>            14268/TCP,14250/TCP,9411/TCP                                                 4d19h
kiali                  ClusterIP      10.100.48.203    <none>            20001/TCP,9090/TCP                                                           4d19h
prometheus             ClusterIP      10.100.42.102    <none>            9090/TCP                                                                     4d19h
tracing                ClusterIP      10.100.92.199    <none>            80/TCP,16685/TCP                                                             4d19h
zipkin                 ClusterIP      10.100.29.132    <none>            9411/TCP                                                                     4d19h

添加域名解析

192.168.174.250  app.wgs.com

访问v10子集

~# while true;do curl app.wgs.com; sleep 0.5; done
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-kdv4m, ServerIP: 172.20.154.244!
 - Took 7 milliseconds.
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-hq957, ServerIP: 172.20.44.255!
 - Took 7 milliseconds.
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-kdv4m, ServerIP: 172.20.154.244!
 - Took 4 milliseconds.
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-hq957, ServerIP: 172.20.44.255!
 - Took 7 milliseconds.
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-kdv4m, ServerIP: 172.20.154.244!
 - Took 9 milliseconds.
Proxying value: iKubernetes demoapp v1.0 !! ClientIP: 127.0.0.6, ServerName: demoappv10-78b6586d58-hq957, ServerIP: 172.20.44.255!
 - Took 5 milliseconds.

查看kiali

访问v11子集

~# while true;do curl app.wgs.com/canary; sleep 0.5; done
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 7 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 5 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 4 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 4 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 11 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-hckjf, ServerIP: 172.20.89.184!
 - Took 6 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-hckjf, ServerIP: 172.20.89.184!
 - Took 7 milliseconds.
Proxying value: iKubernetes demoapp v1.1 !! ClientIP: 127.0.0.6, ServerName: demoappv11-78bf898c74-sn9qp, ServerIP: 172.20.154.245!
 - Took 4 milliseconds.

查看kiali

 

标签:Ingress,ServerName,istio,TCP,Took,demoapp,172.20,milliseconds
From: https://www.cnblogs.com/wangguishe/p/16824990.html

相关文章

  • istio部署demoapp多版本应用示例
    环境说明frontend(proxy):前端应用,会请求后端的demoappservice:proxydemoapp:后端应用同时部署两个版本 部署demoappv1.0deploy-demoapp-v10.yamla......
  • 【Kubernetes】K8s笔记(十一):Ingress 集群进出流量总管
    目录0.Ingress解决了什么问题1.IngressController2.指定IngressClass使用多个IngressController3.使用YAML描述Ingress/IngressClass3.1Ingress3.2Ingr......
  • istio部署后端单版本应用示例
    环境说明frontend(proxy):前端应用,会请求后端的demoappservice:proxydemoapp:后端应用service:demoappv10访问流程clientpod--->(EgressListener......
  • Istio流量治理基础
    流量治理Istio的流量路由规则使运维人员可以轻松控制服务之间的流量和API调用Istio简化了诸如断路器,超时和重试之类的服务级别属性的配置,并使其易于设置重要任务(A/B测......
  • k8s 安装ingress
    https://kubernetes.github.io/ingress-nginx/deploy/    wgethttps://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.0/deploy/static......
  • 大厂Istio基础与实践 云原生“薪”能力合集,一线大厂实战
    大厂Istio基础与实践云原生“薪”能力合集,一线大厂实战导言:上一篇章给大家介绍了服务治理方案ServiceMesh(服务网格)产生的背景、逻辑架构、应用场景。本篇将要介绍的......
  • 安装istio和部署bookinfo项目
    一istio安装1.1下载安装​​https://istio.io/latest/docs/setup/getting-started/​​安装前提:你的服务器必须可以连接外网需要下载谷歌镜像#下载cd/usr/local/curl......
  • k8s Ingress
    K8s安装ingress官网https://github.com/kubernetes/ingress-nginx当前kubectlversionv1.25.2Ingress-NGINXversionk8ssupportedversionAlpineVersionNg......
  • 如何修改ingress-nginx-controller中access.log和error.log的路径?
    ingress-nginx-controller中的配置是通过什么方式来设置的呢? 没有!configmap. 那要修改access.log和error.log日志的路径,该如何设置?下面一起看下。 1、首先,查看......
  • Istio常用命令
    Istio使用帮助#istioctl--helpIstioconfigurationcommandlineutilityforserviceoperatorstodebuganddiagnosetheirIstiomesh.Usage:istioctl[comm......