首页 > 其他分享 >ingress-istio配置服务

ingress-istio配置服务

时间:2022-11-01 23:48:24浏览次数:106  
标签:ingress name 配置 istio xiaoshuogeng com port

文档说明:只记录关键地方;
试验环境: linux debian 11
目标:自建K8S 对外提供 http https 服务

ingress-istio 暴露服务端口

暴露 80 和 443 端口


apiVersion: v1
kind: Service
metadata:
    annotations: null
    labels:
        app: istio-ingressgateway
        istio: ingressgateway
        release: istio
    name: istio-ingressgateway-my-custom
    namespace: istio-system
spec:
    ports:
        -   name: http2
            port: 80
            targetPort: 8080
        -   name: https
            port: 443
            targetPort: 8443
    selector:
        app: istio-ingressgateway
        istio: ingressgateway
    type: NodePort
    externalIPs:
        - 192.168.3.120
        - 192.168.3.121

创建gateway


apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: com-xiaoshuogeng-gateway
  namespace: default
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      tls:
        httpsRedirect: true
      hosts:
        - "*.xiaoshuogeng.com"
    - port:
        number: 443
        name: https
        protocol: HTTPS
      tls:
        mode: SIMPLE # enables HTTPS on this port
        credentialName: "com-xiaoshuogeng-tls-cert-secret"
      hosts:
        - "*.xiaoshuogeng.com"


创建路由

com-xiaoshuogeng-3d-service 内部服务名称

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
    name: com-xiaoshuogeng-3d-virtual-service
    namespace: default
spec:
    hosts:
        - "3d.xiaoshuogeng.com"
    gateways:
        - com-xiaoshuogeng-gateway
    http:
        -   match:
                -   uri:
                        prefix: "/"
            route:
                -   destination:
                        host: com-xiaoshuogeng-3d-service.default.svc.cluster.local
                        port:
                            number: 80


至此路由服务配置完毕,可以使用了

com-xiaoshuogeng-3d-service 内部服务名称


kubectl get pods,svc,virtualservices,destinationrules,ingress -n istio-system

kubectl get pods,svc,virtualservices,destinationrules,ingress -n default 

参考文档

  1. 自建kubernetes ingress-nginx 和ingress-istio 暴露服务端口
  2. istio
  3. istio Ingress Gateways
  4. Workload Resources
  5. Ingress

标签:ingress,name,配置,istio,xiaoshuogeng,com,port
From: https://www.cnblogs.com/jingjingxyk/p/16832215.html

相关文章

  • Mac下安装配置SDK
    此处仅为Mac+Appium学习记录,需要配置JDK和SDK环境,这里主要记录一下macPRO下安装和配置androidsdk的步骤。安装好brew后,通过以下命令进行sdk的安装brewinstallandroid......
  • 【详细步骤】Maven的安装与配置+使用+镜像配置+特殊需求下:资源导出问题
    文章目录​​一、安装步骤​​​​1.下载​​​​下载最新版​​​​下载历史版本​​​​2.解压并配置环境变量​​​​二、查看配置​​​​1.阿里云镜像配置:​​​​2.mi......
  • 配置XAMPP中Apache可被外网访问
    Apache的外网访问:0.本人XAMPP版本为3.21.将httpd-xampp.conf中的Requirelocal修改为Requireallgranted2.在自己的云服务器中加上8081端口的防火墙(本人用的阿里云服务器,具......
  • spring-boot 配置 swagger常见版本不匹配问题解决方案
    https://stackoverflow.com/questions/70036953/spring-boot-2-6-0-spring-fox-3-failed-to-start-bean-documentationpluginsboo一般出现在2.6.*的springboot版本,这里解......
  • 配置Nginx虚拟主机
    配置Nginx虚拟主机......
  • Istio典型应用场景
    Istio作为服务治理的工具,使用户不需要在项目中编写代码即可实现微服务治理。主要应用分布式调用追踪、遥测度量收集、灰度发布应用、熔断、故障注入等几个方面场景。Istio......
  • Istio架构设计有4大关键目标
     Istio作为服务网格技术的代表作,通过sidecar代理拦截了微服务之间的所有网络通信,用统一方式实现服务之间的负载均衡、访问控制、速率限制等功能。应用无须了解底层服务访......
  • 如何在EasyCVR平台配置AI智能识别的微信端告警消息推送?
    我们在此前的文章中和大家分享过关于EasyCVR视频融合平台智能告警相关的开发及功能介绍,其中包括微信端的开发流程分享,感兴趣的用户可以翻阅往期的文章进行了解。智能告警功......
  • Windows 下 MSYS2 环境配置和 MinGW-w64 C++ 环境配置
    转载来自:Server=https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64Windows下MSYS2环境配置和MinGW-w64C++环境配置1、简介本文主要是Windows下MSYS2......
  • Istio egress gateway
    EgressGateway逻辑示意图EgressGateway配置要点各SidecarEnvoy上访问特定外部主机的流量,要路由至EgressGatewayEgressGateway要将相应的流量路由至相应的外部......