FluxCD notification error sending to Microsoft Teams

584 views Asked by At

I am trying to configure FluxCD in Kubernetes to send notifications to Microsfot Teams for reconciliation events.

I have followed the FluxCD "Setup Notifications" instructions. Everything is deployed as expected.

enter image description here

I am not receiving any alerts in Teams as expected when I edit a config (e.g. pod replicaCount) and run "flux reconcile ...". This is the error I am seeing in the Notification Controller

enter image description here

enter image description here

enter image description here

Here is the secret with the Microsoft Teams channel URL

enter image description here

Does anyone have any ideas to please share with me today. Thank you

1

There are 1 answers

0
Koman On BEST ANSWER

So, firstly, I had not created an incoming webhook in Microsoft Teams UI: https://fluxcd.io/docs/components/notification/provider/#ms-teams

Secondly, I asked a question to the Flux maintainers as @Nalum suggested and there was a follow-on issue with encoding the Teams URL correctly. I had a trailing newline character which caused the URL to be invalid as reported by the Provider. I was reciving the following error

enter image description here

To resolve this I had to use the -n switch on the echo command when base64'ing the Teams URL for the Secret in Kubernetes.

echo -n '<teams url>' | base64

My final Kubernetes config was as follows: enter image description here

enter image description here

enter image description here

A full breakdown of the investigation can be seen here: https://github.com/fluxcd/flux2/discussions/2719