首页 > 其他分享 >istio ingress gataway

istio ingress gataway

时间:2023-05-26 21:55:51浏览次数:38  
标签:gataway ingress httpbin IP istio k8s root INGRESS

在kubernetes中,kubernetes ingress resource常用来指定应该暴露给集群外部服务,在一个istio中,最好的办法就是使用不同配置模型,也就是istio gateway,

一个gateway允许istio的功能,比如监控和路由规则去应用到进入集群的流量。

 

1.准备工作

[root@k8s-master01 httpbin]# kubectl apply -f httpbin.yaml -n istio
serviceaccount/httpbin created
service/httpbin created
deployment.apps/httpbin created
[root@k8s-master01 httpbin]#
2.  确定ingress的IP和端口

 

[root@k8s-master01 httpbin]# kubectl get svc   -n istio-system istio-ingressgateway
NAME                   TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                                                                      AGE
istio-ingressgateway   LoadBalancer   10.107.131.1   192.168.30.240   15021:31996/TCP,80:31612/TCP,443:31718/TCP,31400:32280/TCP,15443:31182/TCP   91d


如果 EXTERNAL-IP 有值(IP 地址或主机名),则说明您的环境具有可用于 Ingress 网关的外部负载均衡器。如果 EXTERNAL-IP 值是 <none>(或一直是 <pending> ),则说明可能您的环境并没有为 Ingress 网关提供外部负载均衡器的功能。在这种情况下,您可以使用 Ingress Service 的 node port 方式访问网关。

[root@k8s-master01 httpbin]# export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
[root@k8s-master01 httpbin]# export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
[root@k8s-master01 httpbin]# export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
[root@k8s-master01 httpbin]#
[root@k8s-master01 httpbin]# echo $INGRESS_HOST
192.168.30.240
[root@k8s-master01 httpbin]# echo $INGRESS_PORT
80
[root@k8s-master01 httpbin]# echo $SECURE_INGRESS_PORT
443

export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')

方式二:确定使用 Node Port 时的 ingress IP 和端口

注,如果环境没有外部负载均衡器,请按照此说明操作。

确认端口:

    export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
    export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')

确认IP,不同的平台环境IP不同,如本机局域网IP:10.11.0.100,则执行:

export INGRESS_HOST=10.11.0.100

 

标签:gataway,ingress,httpbin,IP,istio,k8s,root,INGRESS
From: https://www.cnblogs.com/fenghua001/p/17435907.html

相关文章

  • k8s 1.24.14 Ingress-nginx 的部署
    前言:本次部署使用了高可用的形式,会在每个node节点做亲和性(master不部署),让每一个pod都部署上去,然后加入NGINX去过负载,这样我们之间用NGINX的80端口访问域名就可以了。MountVolume.SetUpfailedforvolume"webhook-cert":secret"ingress-nginx-admission"notfound。......
  • istio断路器
    本小节主要讲解针对连接、请求、和异常点检测如何配置断路器。 断路是创建弹性微服务应用程序的重要模式,断路允许您编写应用程序来限制故障,延迟峰值和网络特性的其他不良影响的影响。一.准备工作清除之前的规则[root@k8s-master01httpbin]#kubectldelete-f../../sample......
  • k8s 1.23.0 安装使用ingress 1.1.1
    1、部署ingresscontroller下载yaml文件,要指定版本wgethttps://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/cloud/deploy.yaml2、修改配置文件中的镜像下载地址,总共3处修改image:registry.cn-hangzhou.aliy......
  • Istio 目标规则 (Destination Rule)
                DestinationRule还可以做什么通常在生产场景下,用使用DestinationRule对用户进行身份、地址位置等条件的识别后的流量路由,例如部分用户优先享用新版本,则可以通过HTTPHeader附加相关的字段进行识别,路由到新版本的服务上。或者在版本......
  • 《 Istio 权威指南 》新著重磅发行!华为云云原生团队匠心力作
    摘要:由Istio社区指导委员会成员和华为云云原生团队联合编著的云原生服务网格书籍《Istio权威指南》重磅上市本文分享自华为云社区《《Istio权威指南》新著重磅发行!华为云云原生团队匠心力作》,作者:云容器大未来。由 Istio社区指导委员会成员和华为云云原生团队联合编著......
  • k8s中的Ingress
    虽然通过kube-proxy可以帮助实现集群内外的pod相互通信,对这些pod做负载均衡(用户态userspace轮询算法,性能低也不安全)和网络的流量代理,但是随着service的增多,nodeIP越来越多,并且kube-proxy生成的规则链也会越来越多,即使是iptables路由(内核态随机算法,性能高直接转给后端EndPoint)对Linu......
  • Kubernetes 使用 Ingress-nginx 实现灰度发布功能
    推荐阅读Helm3(K8S资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506Helm3(K8S资源对象管理工具)博客专栏:https://blog.csdn.net/xzk9381/category_10895812.html本文原文链接:https://blog.csdn.net/xzk9381/article/details/109570832,转载请注明出处。如有发现文......
  • Istio数据面新模式:Ambient Mesh技术解析
    摘要:AmbientMesh以一种更符合大规模落地要求的形态出现,克服了大多数Sidecar模式的固有缺陷,让用户无需再感知网格相关组件,真正将网格下沉为基础设施。本文分享自华为云社区《华为云云原生团队:Istio数据面新模式AmbientMesh技术解析》,作者:云容器大未来。如果说在以Kubernetes......
  • istio的安装
     1.下载istio-1.17.1-linux-amd64.tar.gz,解压之后成istio-1.17.12.进入istiodrwxr-x--- 2rootroot   22Feb2217:57bin ---------------istio的命令-rw-r--r-- 1rootroot11348Feb2217:57LICENSEdrwxr-xr-x 5rootroot   52Feb2217:57manife......
  • istio 请求超时相关详解
    虚拟服务中这段代码含义虚拟服务中这段代码含义“spec:gateways:-magicboard-meshhosts:-magicboard-magicboard.lh.prodhttp:-name:defaultretries:attempts:3retryOn:'reset,connect-failure,retriable-......