[Video Course][Siddharth Barahalikar] FluxCD 101 with Hands-On Labs [ENG, 2023][~5h 45m]


07. Notification Controller


$ cd ~/projects/dev/fluxcd/bb-app-source/
$ git switch 02-demo


$ kubectl -n flux-system expose deployment notification-controller \
  --name receiver \
  --port 80 \
  --target-port 9292 \
  --type NodePort


$ kubectl -n flux-system get svc
***
receiver                  NodePort    10.97.144.132    <none>        80:31720/TCP   27s
***


$ kubectl -n flux-system create secret generic github-webhook-token \
  --from-literal=token=secret-token-dont-share


$ flux create receiver github-webhook-receiver \
  --type github \
  --event ping,push \
  --secret-ref github-webhook-token \
  --resource GitRepository/2-demo-source-git-bb-app \
  --export > github-webhook-receiver.yaml


$ flux reconcile source git flux-system


$ flux get receivers
NAME                   	SUSPENDED	READY	MESSAGE
github-webhook-receiver	False    	True 	Receiver initialized for path: /hook/ab09b3ac5436ef9fca17e74ddc7d57b24be7943a1e00ee34f45df11b3b73beda


// Не у меня не заработает!
$ npx localtunnel --port 31720


GITHUB_USERNAME -> bb-app-source -> Settings -> Webhooks -> Add webhook


Payload URL:
tunnel + /hook/ab09b3ac5436ef9fca17e74ddc7d57b24be7943a1e00ee34f45df11b3b73beda

Content type:
application/x-www-form-urlencoded

Secret:
secret-token-dont-share


04. DEMO - Alerts & Providers

Лень разбираться.
Slack заблокирован.