• httpserver 服务以 Istio Ingress Gateway 的形式发布


    一,安装istio

    二,sidecar 自动注入, 重启httpserver的pod

    kubectl label namespace default istio-injection=enabled

    然后删除之前的httpserver pod , 重新拉起这个pod

     看下这个pod拉起过程

     三,确定 ingress IP 和端口,明确自身 Kubernetes 集群环境支持外部负载均衡

    root@iZbp12lq02mc4cz0rt0ce9Z:~# kubectl get svc istio-ingressgateway -n istio-system
    NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                      AGE
    istio-ingressgateway   LoadBalancer   10.105.131.213   <pending>     15021:31845/TCP,80:32444/TCP,443:31613/TCP,31400:30973/TCP,15443:31868/TCP   3h50m
    

      

    四,创建 Istio Gateway:

    apiVersion: networking.istio.io/v1bet
    a1 kind: Gateway metadata: name: gateway spec: selector: istio: ingressgateway servers:
    - port: number: 80 name: http protocol: HTTP hosts: - '*'

    五,部署virtual server, 为通过 Gateway 的入口流量配置路由

    apiVersion: networking.istio.io/v1beta1
    kind: VirtualService
    metadata:
      name: httpserver
      namespace: default
    spec:
      gateways:
      - httpsserver
      hosts:
      - httpserver-helm.51.cafe
      http:
      - route:
        - destination:
            host: httpserver.default.svc.cluster.local
            port:
              number: 80

    六:使用 curl 访问 httpserver服务

    curl httpserver-helm.51.cafe
  • 相关阅读:
    JAVA 执行系统命令
    Linux环境安装Elasticsearch
    JAVA 上传文件到本地服务器
    模仿新浪导航栏
    导航栏简单实现
    css实现简单导航栏
    css字体讲解内容
    模拟新闻页面模块
    [Win32]一个调试器的实现(六)显示源代码
    [Win32]一个调试器的实现(九)符号模型
  • 原文地址:https://www.cnblogs.com/chaojiyingxiong/p/16064307.html
Copyright © 2020-2023  润新知