Search code examples
kuberneteskubernetes-ingresskongkong-ingress

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


I am trying to set an environment variable with the IP address at which Kong is accessible that will be used to actually send requests into the Kubernetes cluster. Installed Kong Kubernetes Ingress Controller Without Database. But always getting this error. Can anyone please help? Thanks in advance.

enter image description here


Solution

  • It's because you're using Linux commands in Powershell. To export PROXY_IP you can use:

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

    select -first 1 behaves the same as head -1.

    Then to set it as environment variable you can use:

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