使用可访问 Kong 的 IP 地址设置环境变量,以将请求发送到 Kubernetes 集群

Setting environment variable with the IP address at which Kong is accessible to send requests into the Kubernetes cluster

我正在尝试使用可访问 Kong 的 IP 地址设置一个环境变量,该变量将用于实际将请求发送到 Kubernetes 集群。安装了没有数据库的 Kong Kubernetes Ingress Controller。但总是得到这个错误。有人可以帮忙吗?提前致谢。

这是因为您在 Powershell 中使用了 Linux 命令。 要导出 PROXY_IP,您可以使用:

$PROXY_IP=(minikube service -n kong kong-proxy --url | select -first 1)

select -first 1head -1.

的行为相同

然后将其设置为环境变量,您可以使用:

[Environment]::SetEnvironmentVariable("PROXY_IP", "$PROXY_IP")