http - Istio 在端口 80 上没有响应
问题描述
我们最近在我们的集群上设置了 Istio,并且在我们的测试过程中一切正常。我们现在已经使用 Istio,但现在我们的服务没有连接到端口 80;HTTPS 有效,但我们需要将 HTTP 重定向到 HTTPS。
这是我们的 Istio 安装配置:
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
profile: default
components:
ingressGateways:
- enabled: true
k8s:
env:
- name: ISTIO_META_ROUTER_MODE
value: sni-dnat
hpaSpec:
maxReplicas: 5
metrics:
- resource:
name: cpu
targetAverageUtilization: 80
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: istio-ingressgateway
resources:
limits:
cpu: 2000m
memory: 1024Mi
requests:
cpu: 100m
memory: 128Mi
service:
type: LoadBalancer
externalTrafficPolicy: Local
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: http2
port: 80
targetPort: 8080
- name: https
port: 443
targetPort: 8443
- name: tls
port: 15443
targetPort: 15443
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 25%
name: istio-ingressgateway
解决方案
Service
由您的IstioOperator
CR创建的支票怎么样istio-ingressgateway
?您创建了Ingress Gateway
withLoadBalancer
类型服务。然后你应该为你在yaml中指定的http和https端口配置LB路由规则。
例如,如果您的服务配置了如下所有端口,那么您最好验证 http 端口是否在您的 LB 层侦听或打开。在我的示例中,该LoadBalancer
类型与 AWS 集成,并且还使用我指定的所有端口创建了 ELB。逻辑上和其他平台是一样的,只是LB配置是自动化还是需要手动配置。
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
loadbalancer-ingressgateway LoadBalancer 172.30.68.12 xxxxxx.ap-northeast-1.elb.amazonaws.com 15021:30053/TCP,80:31829/TCP,443:32661/TCP,15443:30937/TCP
推荐阅读
- javascript - 如何在提交之前向表单添加元素?没有 AJAX
- r - 运行具有 2 个自变量的线性回归的所有可能组合
- ios - 折线图(图表)溢出到更大屏幕上的其他视图 - IOS Swift UI
- amazon-web-services - 如何将组织中的私有存储库用作存储库以与 Amplify 协作
- html - 如何在css中重叠两列
- android - 在当前主题中找不到“@attr/colorShadowDark”
- django - 如何对 Django 的 CreateView 中的字段进行排序?
- vim - Vim中的命令v映射在哪里
- java - 构造函数的 JUnit 测试将父级转换为子级
- ios - 我无法从 Ejabberd 服务器获取名册列表