vmware-archive / kubewatch

Watch k8s events and trigger Handlers
Apache License 2.0
2.44k stars 441 forks source link

Proxy support for reaching to ms-teams webhook url #270

Open sharmavijay86 opened 3 years ago

sharmavijay86 commented 3 years ago

Hello folks, I am using helm chart to setup kubewatch. I see, in my environment, external urls are prohibited and can run only behind proxy. I am not able to figure out the way to reach to ms-team webhook url from my kubewatch pod, to send trigers. ( I have to apply proxy settings for this, but no idea how ?) Please suggest....

LaurentDumont commented 3 years ago

I had to do this on my side with the Helm deployment. Create the following file

kubewatch-values.yaml

extraEnvVars:
  - name: http_proxy
    value: http://PROXY_HERE/
  - name: https_proxy
    value: http://PROXY_HERE/
  - name: no_proxy
    value: "127.0.0,$IP_OF_THE_INTERNAL_K8S_API_ENDPOINT"

Then you add it to your helm creation -f kubewatch-values.yaml

I don't really know how we can template the IP_OF_THE_INTERNAL_K8S_API_ENDPOINT values since it might change.

Using http_proxy and https_proxy means all requests are proxied, which includes requests from kubewatch to the K8s API to get the pod events.