0

我一直在尝试在亚马逊 EKS 上设置 istio,一切正常,负载均衡器等已分配,但在重新部署服务后,我在 Cloudfront 上得到 502。

我真的不知道发生了什么,并且 istio 分析显示一切都在验证中

istioctl analyze --all-namespaces

✔ No validation issues found when analyzing all namespaces.

我只是想学习,我已经使用 bookinfo 作为示例完成了他们的教程

编辑 1:当我尝试访问负载均衡器主机名时,它会引发 404 错误

这是我的配置文件:

网关.yaml:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: demo-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "mydomain.com"
    tls:
      httpsRedirect: true # sends 301 redirect for http requests
  - port:
      number: 443
      name: https-443
      protocol: HTTP
    hosts:
    - "mydomain.com"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: servicename
spec:
  hosts:
  - "mydomain.com"
  gateways:
  - demo-gateway
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: servicename
        port:
          number: 8080

部署.yaml:

apiVersion: v1
kind: Service
metadata:
  name: servicename
  labels:
    app: servicename
    service: servicename
spec:
  ports:
  - port: 8080
    name: http
  selector:
    app: servicename
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: servicename
  labels:
    account: servicename
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: servicename-v1
  labels:
    app: servicename
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: servicename
      version: v1
  template:
    metadata:
      labels:
        app: servicename
        version: v1
    spec:
      serviceAccountName: servicename
      containers:
      - name: servicename
        image: 246161985385.dkr.ecr.us-east-1.amazonaws.com/servicename:latest
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
          limits:
            cpu: 100m
            memory: 100Mi
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        securityContext:
          runAsUser: 1000
4

0 回答 0