istio - 如何在 istio 中为子页面配置入口路由?
问题描述
我有一个 Web 应用程序的负载均衡器服务。
如果我们打开 http://LB ,该页面应该以 http:///productpage 启动,它将只显示空白页面,因为主要产品在 productpage url 中。
那么,如何在 istio 网关 VirtualService 中进行配置呢?请建议。
我试过的样品。
部署:
apiVersion: v1
kind: Service
metadata:
name: mart-service
labels:
app: mart
service: mart
spec:
selector:
app: mart
ports:
- name: http
port: 80
targetPort: 18170
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mart-details
labels:
account: mart
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mart-deployment
labels:
app: mart
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: mart
version: v1
template:
metadata:
labels:
app: mart
version: v1
spec:
serviceAccountName: mart-details
containers:
- name: mart
image: martserver.azurecr.io/mart:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 18170
name: mart-port
#securityContext:
#runAsUser: 1000
volumeMounts:
- mountPath: /home/spring/AppData/Local/erwin/Mart Server/
name: mart-volume
volumes:
- name: mart-volume
persistentVolumeClaim:
claimName: martpv
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: martpv
labels:
app: mart
version: v1
spec:
accessModes:
- ReadWriteMany
storageClassName: azurefile
resources:
requests:
storage: 5Gi
网关:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: martserver-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
虚拟服务:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: martserver
spec:
hosts:
- "*"
gateways:
- martserver-gateway
http:
- match:
- uri:
exact: /MartServer
- uri:
exact: /
route:
- destination:
host: mart-service
port:
number: 80
请立即忽略该图像,因为它是私人仓库。当我尝试使用 LoadBalancer 类型的服务和连接时,产品工作正常。
页面打不开:http://IG/MartServer
并且,kiali 输出。
解决方案
推荐阅读
- ruby - 如何添加自定义选项,例如某些制卡网站
- magento - 在 Magento 1 块中定位和编辑内容
- javascript - 在全日历中使用“ctrl”键进行多选
- python - 如何并行训练多个独立模型?
- android - 当我将设备从纵向模式倾斜到横向模式时,为什么我的 YouTube 播放器会一直暂停?
- javascript - javascript neo4-driver 无法返回多个变量
- mapbox - 触发聚类时如何显示/隐藏 SymbolLayer 的图标
- mysql - mysql将选择结果传递给另一个查询
- css - 更具体的选择器解析更快吗?
- javascript - 如果函数默认参数值等于不纯函数,可以吗?