【发布时间】:2022-10-02 21:17:13
【问题描述】:
情况:我有一个 AKS 集群,我试图从 localhost 加载我的项目。 当我启动我的 Ansible 脚本以使项目运行时,我需要登录到 openfaas 但我遇到了这个错误:
> ...\\nCannot connect to OpenFaaS on URL: https:(...).com/faas. Get \\\"https://(..).com/faas/system/functions\\\": dial tcp
> xx.xxx.xxx.xxx:xxx: i/o timeout (Client.Timeout exceeded while
> awaiting headers)\", \"stdout_lines\": [\"WARNING! Using --password is
> insecure, consider using: cat ~/faas_pass.txt | faas-cli login -u user
> --password-stdin\", \"Calling the OpenFaaS server to validate the credentials...\", \"Cannot connect to OpenFaaS on URL:
> https://(...).com/faas. Get
> \\\"https://(...).com/faas/system/functions\\\": dial tcp
> xx.xxx.xxx.xxx:xxx: i/o timeout (Client.Timeout exceeded while awaiting headers)\"]}
我有一个从 yaml 文件创建的公共负载均衡器,它链接到创建的 LB 的 DNS (...).com / IP 地址。
我的 loadbalancer.yml 文件:
apiVersion: v1
kind: Service
metadata:
name: loadbalancer
spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80
我的入口文件:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
name: openfaas
spec:
rules:
- host: (...).com
http:
paths:
- backend:
service:
name: openfaas
port:
number: 80
path: /faas
pathType: Prefix
tls:
- hosts:
- (...).com
secretName: (...).com
---
我没有找到很多有相同情况的教程,或者他们使用内部负载均衡器。
这是天蓝色那会阻碍通讯吗?防火墙问题? 我是否需要将我的 LB 设为内部而不是外部?
我在网上看到一个消息来源是这样说的:
如果您通过普通的 LoadBalancer 公开一个服务 ip,将无法访问,因为没有被访问过的流量 通过天蓝色防火墙路由将在出路时被丢弃。 因此,您需要使用固定的内部 ip 创建服务, 内部 LoadBalancer 并通过 azure 防火墙路由流量 用于传出和传入流量。 https://denniszielke.medium.com/setting-up-azure-firewall-for-analysing-outgoing-traffic-in-aks-55759d188039
但我想知道是否有可能绕过它..
任何帮助是极大的赞赏!
标签: azure kubernetes azure-aks azure-load-balancer openfaas