首页 > 解决方案 > 应用 Istio 虚拟服务时超时

问题描述

使用 kubectl apply -f 应用 virtual-service.yaml 会产生超时(30 秒)。

周一我像往常一样在 ISTIO-1.2.4 重新配置了我的虚拟服务。今天我遇到了应用虚拟服务的超时。我做了什么

% kubectl -n istio-system apply -f virtual-service.yaml
Error from server (Timeout): error when creating "virtual-service.yaml": Timeout: request did not complete within requested timeout 30s
% kubectl -n istio-system delete pod istio-ingressgateay*
% kubectl -n istio-system exec istio-ingressgateway*  -c istio-proxy -- curl -X POST http://localhost:15000/logging?level=debug
% kubectl -n istio-system logs --follow istio-ingressgateway* -c istio-proxy
% kubectl -n istio-system get gateways.networking.istio.io
NAME                         AGE
istio-gateway   3d19h
% kubectl -n istio-system get virtualservices.networking.istio.io
NAME                               GATEWAYS                       HOSTS                      AGE
infrastructure-istio-k8s-ingress   [istio-gateway]   [${DOMAIN}]   3d19h
% 

而且我仍然收到 30 秒超时消息并且没有新的虚拟服务,并且我在日志中没有与虚拟服务相关的任何内容。

配置 virtual-service.yaml 看起来像

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: default-istio-k8s-ingress
  namespace: istio-system
spec:
  gateways:
  - istio-gateway-149-81-86-74
  hosts:
  - "test.procom.energy"
  http:
  - match:
    - uri:
        regex: "/head.*s"
    rewrite:
      uri: "/headers"
    route:
    - destination:
        host: httpbin.default.svc.cluster.local
        port:
          number: 8000
      weight: 100
  - match:
    - uri:
        exact: /ip
    route:
    - destination:
        host: httpbin.default.svc.cluster.local
        port:
          number: 8000
      weight: 100
  - match:
    - uri:
        exact: /user-agent
    route:
    - destination:
        host: httpbin.default.svc.cluster.local
        port:
          number: 8000
      weight: 100

我期待一个新的应用虚拟服务,我只看到超时。在这种情况下,我没有任何可能重新配置虚拟服务或应用新服务。

标签: kubernetesibm-cloudistio

解决方案


嘿你。

我修好了它。在令人失望的深入观察之后,我没有重新加载所有 POD(通过 for 循环)。之后,我重新启动所有节点并删除了 istio-system 命名空间中的所有副本集,我可以重新配置或应用我的虚拟服务。

最好的问候,扬


推荐阅读