SlideShare a Scribd company logo
1 of 32
Download to read offline
Setting up Notifications,
Alerts & Webhooks with Flux
Alison Dowdney, Developer Advocate, Weaveworks
Stacey Potter, Community Manager, Weaveworks
Weaveworks is founded on open source
● Flux (& GitOps Toolkit) (CNCF): GitOps for k8s
● Flagger (CNCF): Declarative Progressive Delivery for Service
Meshes
● Cortex (CNCF): Distributed, Long-term-storage TSDB
compatible with Prometheus
● Weave Ignite: VMs with container UX & built-in GitOps
management
● EKSctl: Create an Amazon EKS cluster with one command
● (and many many more projects!)
weave.works
Setting up Notifications, Alerts, & Webhooks w/ Flux
Speakers Help/Support
Duration
30-45 Minutes
Alison Dowdney
DX Engineer
Weaveworks
Stacey Potter
Community Mgr
Weaveworks
Browser
Safari copy/paste
shortcuts may not work
Using Zoom
Questions?
• Use chat (button: top
left corner of screen)
• Escape to exit full
screen
• “To Everyone” or “To
all panelists and
attendees”
Support:
https://support.zoom.us/hc/
en-us/articles/206175806-T
op-Questions
Troubleshooting
Use chat
If the issue is not easily resolved,
we ask that you follow along as
we demo the sample app.
👋 Hello GitOps and Flux Users! 👋
Flux users! 😻 Sneak peek to the power
of Flux (v2)!
New users! ⚡ The Power of GitOps
with Flux!
👋 Get Connected 💬 🤝
1. Fluxcd.io
2. Check out the Flux docs at:
https://toolkit.fluxcd.io/get-started/
3. GitHub Discussions Q&A:
https://github.com/fluxcd/flux2/discussi
ons/categories/q-a
4. CNCF Slack #Flux channel
● GitOps is an app dev and operations methodology
● GitOps is a methodology, not a specific tool or
technology.
● GitOps applies to everything
and brings business value.
What is GitOps? … and why do I want it?
GitOps leverages:
● an entire system that is described declaratively
● code that is version controlled and
● software agents that reconcile and ensure correctness
(along with alerts, etc).
4 Principles of GitOps
demo
Notifications, Alerts & Webhooks
*Note we’re not going to be covering them in this order! :)
The Plan
● Why you want notifications with Flux
● Setting up webhook received with Github
● Setting up Discord notifications with Flux
Why?
● When you're looking at the terminal only you know
what’s going on
● Surfacing alerts through messaging apps, and other services
gives your team visibility, and saves you time, as you don't
have to relay as many messages, flux is doing that for you
● Automation is one of the key principles of GitOps, less
manual ops === more time for building cool things
● and that’s why automation is one of the key business values
of gitops
● Read more at gitops.community
tl;dr Flux
● The most powerful tool to get the GitOps experience
● A set of Kubernetes controllers
● GitOps based continuous delivery system
Kubernet get
Create a kubernetes cluster using your tool of choice
I'm using k3ds eks because we're doing some loadbalancey stuff
and I don't really want to expose my dev station to the world
Bootstrap your cluster
1. Export tokens
2. Bootstrap
your cluster
3. Clone the cluster repository, then cd into it
$ export GITHUB_TOKEN=<your-token>
$ export GITHUB_USER=<your-username>
$ export REPO_NAME="woug-demo"
$ flux bootstrap github 
--owner=$GITHUB_USER 
--repository=$REPO_NAME 
--branch=main 
--personal
$ git clone git@github.com:$GITHUB_USER/$REPO_NAME
$ cd naw-example
Creating webhook receiver secret
$ TOKEN=$(head -c 12 /dev/urandom | shasum | cut -d ' ' -f1)
$ echo $TOKEN
$ kubectl -n flux-system create secret generic webhook-token

--from-literal=token=$TOKEN
Create yaml for load balancer
Exposing the webhook receiver
apiVersion: v1
kind: Service
metadata:
name: receiver
namespace: flux-system
spec:
type: LoadBalancer
selector:
app: notification-controller
ports:
- name: http
port: 80
protocol: TCP
targetPort: 9292
Creating the receiver
create the receiver
$ flux create receiver flux-system 
--type github 
--event ping 
--event push 
--secret-ref webhook-token 
--resource GitRepository/flux-system 
--namespace flux-system 
--export > naw-receiver.yaml
# naw-receiver.yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
name: flux-system
namespace: flux-system
spec:
type: github
events:
- "ping"
- "push"
secretRef:
name: webhook-token
resources:
- kind: GitRepository
name: flux-system
It should produce the following:
Commit and push this all
Setup GitHub Webook
● Navigate to your repo's settings, and webhooks
● Create new webhook
● htto://url of loadbalancer , http insecure + path of hook flux
get receiver flux-system /hook
● $echo $TOKEN is the secret
Create a Discord Webhook
● assuming you have already created a discord server, if not
discord.new
● Create a text channel for your alerts
● Select the settings cog on the text channel you want to post
alerts into
● Select Create Webhook
● Give your Webhook a name, Copy the Webhook url, set aside
details for later
● Save changes
Define a provider
Create a secret with the webhook url
Create a notification provider for Discord by referencing the
above secret
$ kubectl -n flux-system create secret generic discord-url 
--from-literal=address=https://discord.com/api/webhooks/YOUR_DISCORD/WEBHOOK
export $D_CHANNEL=""
export $D_BOTUSR=""
$ flux create alert-provider naw-provider 
--type discord 
--secret-ref discord-url 
--channel $D_CHANNEL 
--username $D_BOTUSR 
--export > naw-provider.yaml
Define a provider (cont’d)
it should produce this file
# naw-provider.yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
name: naw-provder
namespace: flux-system
spec:
channel: $D_CHANNEL
secretRef:
name: discord-url
type: discord
username: $D_BOTUSR
Define an alert
Create an alert definition for all repositories and Kustomizations
Yaml output
$ flux create alert naw-alert 
--provider-ref naw-provider 
--event-severity info 
--event-source Kustomization/'*' 
--event-source GitRepository/'*' 
--namespace flux-system 
--export > naw-alert.yaml
# naw-provider.yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
name: naw-provder
namespace: flux-system
spec:
channel: $D_CHANNEL
secretRef:
name: discord-url
type: discord
username: $D_BOTUSR
Deploying the alert definitions to our
cluster
Commit the files to the repository
$ git add naw-alert.yaml
$ git add naw-provider.yaml
$ git commit -sm "Add alert, alert provider for
discord"
$ git push
Checking everything's in order
Use kubectl to get the status of the alert
$ kubectl -n flux-system get alerts
NAME READY STATUS AGE
naw-alert True Initialized 1m
Testing it out
Creating a new deployment
● Create a GitRepository source for podinfo
● Create a Kustomization for podinfo
$ flux create source git podinfo 
--url=https://github.com/stefanprodan/podinfo 
--branch=master 
--interval=30s 
--export > ./podinfo-source.yaml
$ flux create kustomization podinfo 
--source=podinfo 
--path="./kustomize" 
--prune=true 
--validation=client 
--interval=5m 
--export > ./podinfo-kustomization.yaml
Testing it out
● Commit them to git
$ git add podinfo-source.yaml
$ git add podinfo-kustomization.yaml
$ git commit -m "Add podinfo deployment"
$ git push
Testing it out: Creating some failures
● Create a invalid GitRepository source
● Delete source
$ flux create source git nonexist 
--url=https://github.com/alisondy/nonexist 
--branch=main 
--interval=30s 
--export > ./nonexist-source.yaml
$ git add nonexist-source.yaml
$ git commit -m "Add a faulty source"
$ git push
$ git rm nonexist-source.yaml
$ git commit -m "Get rid of the non existent source"
$ git push
What we did
● We setup a webhook receiver using flux
● Configured gitup to send push notifications to it
● We setup flux so it alerted in discord
With those skills you will be able to adopt one of the key gitops
principles we covered earlier...AUTOMATION!
Resources
- Flux Docs (https://fluxcd.io/docs/)
- Setup Notifications (https://fluxcd.io/docs/guides/notifications/)
- Setup Webhook Receivers
(https://fluxcd.io/docs/guides/webhook-receivers/)
- Alison’s Demo Repo (https://github.com/alisondy/flux-demos)
Alison’s slides.md
- YouTube Playlist: The Power of GitOps with Flux v2
(https://youtube.com/playlist?list=PL9lTuCFNLaD3fI_g-NXWVxopnJ0adn65d)
Migrate to Flux v2!
Sign up for our Flux Migration
Workshops!
bit.ly/FluxMigrationSurvey
Upcoming Events
April 28: CNCF Cloud Native Live: Migrating
from Flux v1 to Flux v2 (Leigh Capili)
April 29: Doing GitOps for multicloud resource management
using Crossplane and Flux2 (Leonardo Murillo @ Conf42: Cloud
Native 2021)
May 3: GitOpsCon @ KubeCon EU
June 9-10: GitOps Days 2021
GitOpsDays.com
Next Steps
• Join us on Flux discussions if you have more questions:
https://github.com/fluxcd/flux2/discussions
• Flux Community: https://fluxcd.io/community/
• Join the GitOps Community Group:
https://www.meetup.com/GitOps-Community/
• More info on GitOps? Visit www.gitops.community/
• Join the GitOps Community LinkedIn Group:
https://www.linkedin.com/groups/13914610/
THANK YOU!

More Related Content

What's hot

The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
Gibran Badrulzaman
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
Weaveworks
 

What's hot (20)

The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
 
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
Understanding the GitOps Workflow and CICD Pipeline - What It Is, Why It Matt...
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
 
Artifactory Essentials Workshop on August 27, 2020 by JFrog
Artifactory Essentials Workshop on August 27, 2020 by JFrogArtifactory Essentials Workshop on August 27, 2020 by JFrog
Artifactory Essentials Workshop on August 27, 2020 by JFrog
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
GitOps w/argocd
GitOps w/argocdGitOps w/argocd
GitOps w/argocd
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdf
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
GitOps with Gitkube
GitOps with GitkubeGitOps with Gitkube
GitOps with Gitkube
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
 
GitHub - Présentation
GitHub - PrésentationGitHub - Présentation
GitHub - Présentation
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 

Similar to Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney

Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
mpaproductions
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
Bachkoutou Toutou
 

Similar to Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney (20)

Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
Acquia BLT for the Win, or  How to speed up the project setup, development an...Acquia BLT for the Win, or  How to speed up the project setup, development an...
Acquia BLT for the Win, or How to speed up the project setup, development an...
 
Beyond Puppet
Beyond PuppetBeyond Puppet
Beyond Puppet
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
Buildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonBuildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in python
 
Cloud Native Okteto Cloud
Cloud Native Okteto Cloud Cloud Native Okteto Cloud
Cloud Native Okteto Cloud
 

More from Weaveworks

SRE and GitOps for Building Robust Kubernetes Platforms.pdf
SRE and GitOps for Building Robust Kubernetes Platforms.pdfSRE and GitOps for Building Robust Kubernetes Platforms.pdf
SRE and GitOps for Building Robust Kubernetes Platforms.pdf
Weaveworks
 
How to Avoid Kubernetes Multi-tenancy Catastrophes
How to Avoid Kubernetes Multi-tenancy CatastrophesHow to Avoid Kubernetes Multi-tenancy Catastrophes
How to Avoid Kubernetes Multi-tenancy Catastrophes
Weaveworks
 

More from Weaveworks (20)

Weave AI Controllers (Weave GitOps Office Hours)
Weave AI Controllers (Weave GitOps Office Hours)Weave AI Controllers (Weave GitOps Office Hours)
Weave AI Controllers (Weave GitOps Office Hours)
 
Flamingo: Expand ArgoCD with Flux (Office Hours)
Flamingo: Expand ArgoCD with Flux (Office Hours)Flamingo: Expand ArgoCD with Flux (Office Hours)
Flamingo: Expand ArgoCD with Flux (Office Hours)
 
Webinar: Capabilities, Confidence and Community – What Flux GA Means for You
Webinar: Capabilities, Confidence and Community – What Flux GA Means for YouWebinar: Capabilities, Confidence and Community – What Flux GA Means for You
Webinar: Capabilities, Confidence and Community – What Flux GA Means for You
 
Six Signs You Need Platform Engineering
Six Signs You Need Platform EngineeringSix Signs You Need Platform Engineering
Six Signs You Need Platform Engineering
 
SRE and GitOps for Building Robust Kubernetes Platforms.pdf
SRE and GitOps for Building Robust Kubernetes Platforms.pdfSRE and GitOps for Building Robust Kubernetes Platforms.pdf
SRE and GitOps for Building Robust Kubernetes Platforms.pdf
 
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
Webinar: End to End Security & Operations with Chainguard and Weave GitOpsWebinar: End to End Security & Operations with Chainguard and Weave GitOps
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
 
Flux Beyond Git Harnessing the Power of OCI
Flux Beyond Git Harnessing the Power of OCIFlux Beyond Git Harnessing the Power of OCI
Flux Beyond Git Harnessing the Power of OCI
 
Automated Provisioning, Management & Cost Control for Kubernetes Clusters
Automated Provisioning, Management & Cost Control for Kubernetes ClustersAutomated Provisioning, Management & Cost Control for Kubernetes Clusters
Automated Provisioning, Management & Cost Control for Kubernetes Clusters
 
How to Avoid Kubernetes Multi-tenancy Catastrophes
How to Avoid Kubernetes Multi-tenancy CatastrophesHow to Avoid Kubernetes Multi-tenancy Catastrophes
How to Avoid Kubernetes Multi-tenancy Catastrophes
 
Building internal developer platform with EKS and GitOps
Building internal developer platform with EKS and GitOpsBuilding internal developer platform with EKS and GitOps
Building internal developer platform with EKS and GitOps
 
GitOps Testing in Kubernetes with Flux and Testkube.pdf
GitOps Testing in Kubernetes with Flux and Testkube.pdfGitOps Testing in Kubernetes with Flux and Testkube.pdf
GitOps Testing in Kubernetes with Flux and Testkube.pdf
 
Intro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and LinkerdIntro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and Linkerd
 
Implementing Flux for Scale with Soft Multi-tenancy
Implementing Flux for Scale with Soft Multi-tenancyImplementing Flux for Scale with Soft Multi-tenancy
Implementing Flux for Scale with Soft Multi-tenancy
 
Accelerating Hybrid Multistage Delivery with Weave GitOps on EKS
Accelerating Hybrid Multistage Delivery with Weave GitOps on EKSAccelerating Hybrid Multistage Delivery with Weave GitOps on EKS
Accelerating Hybrid Multistage Delivery with Weave GitOps on EKS
 
The Story of Flux Reaching Graduation in the CNCF
The Story of Flux Reaching Graduation in the CNCFThe Story of Flux Reaching Graduation in the CNCF
The Story of Flux Reaching Graduation in the CNCF
 
Shift Deployment Security Left with Weave GitOps & Upbound’s Universal Crossp...
Shift Deployment Security Left with Weave GitOps & Upbound’s Universal Crossp...Shift Deployment Security Left with Weave GitOps & Upbound’s Universal Crossp...
Shift Deployment Security Left with Weave GitOps & Upbound’s Universal Crossp...
 
Securing Your App Deployments with Tunnels, OIDC, RBAC, and Progressive Deliv...
Securing Your App Deployments with Tunnels, OIDC, RBAC, and Progressive Deliv...Securing Your App Deployments with Tunnels, OIDC, RBAC, and Progressive Deliv...
Securing Your App Deployments with Tunnels, OIDC, RBAC, and Progressive Deliv...
 
Flux’s Security & Scalability with OCI & Helm Slides.pdf
Flux’s Security & Scalability with OCI & Helm Slides.pdfFlux’s Security & Scalability with OCI & Helm Slides.pdf
Flux’s Security & Scalability with OCI & Helm Slides.pdf
 
Flux Security & Scalability using VS Code GitOps Extension
Flux Security & Scalability using VS Code GitOps Extension Flux Security & Scalability using VS Code GitOps Extension
Flux Security & Scalability using VS Code GitOps Extension
 
Deploying Stateful Applications Securely & Confidently with Ondat & Weave GitOps
Deploying Stateful Applications Securely & Confidently with Ondat & Weave GitOpsDeploying Stateful Applications Securely & Confidently with Ondat & Weave GitOps
Deploying Stateful Applications Securely & Confidently with Ondat & Weave GitOps
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney

  • 1. Setting up Notifications, Alerts & Webhooks with Flux Alison Dowdney, Developer Advocate, Weaveworks Stacey Potter, Community Manager, Weaveworks
  • 2. Weaveworks is founded on open source ● Flux (& GitOps Toolkit) (CNCF): GitOps for k8s ● Flagger (CNCF): Declarative Progressive Delivery for Service Meshes ● Cortex (CNCF): Distributed, Long-term-storage TSDB compatible with Prometheus ● Weave Ignite: VMs with container UX & built-in GitOps management ● EKSctl: Create an Amazon EKS cluster with one command ● (and many many more projects!) weave.works
  • 3. Setting up Notifications, Alerts, & Webhooks w/ Flux Speakers Help/Support Duration 30-45 Minutes Alison Dowdney DX Engineer Weaveworks Stacey Potter Community Mgr Weaveworks Browser Safari copy/paste shortcuts may not work Using Zoom Questions? • Use chat (button: top left corner of screen) • Escape to exit full screen • “To Everyone” or “To all panelists and attendees” Support: https://support.zoom.us/hc/ en-us/articles/206175806-T op-Questions Troubleshooting Use chat If the issue is not easily resolved, we ask that you follow along as we demo the sample app.
  • 4. 👋 Hello GitOps and Flux Users! 👋 Flux users! 😻 Sneak peek to the power of Flux (v2)! New users! ⚡ The Power of GitOps with Flux!
  • 5. 👋 Get Connected 💬 🤝 1. Fluxcd.io 2. Check out the Flux docs at: https://toolkit.fluxcd.io/get-started/ 3. GitHub Discussions Q&A: https://github.com/fluxcd/flux2/discussi ons/categories/q-a 4. CNCF Slack #Flux channel
  • 6. ● GitOps is an app dev and operations methodology ● GitOps is a methodology, not a specific tool or technology. ● GitOps applies to everything and brings business value. What is GitOps? … and why do I want it?
  • 7. GitOps leverages: ● an entire system that is described declaratively ● code that is version controlled and ● software agents that reconcile and ensure correctness (along with alerts, etc). 4 Principles of GitOps
  • 9. Notifications, Alerts & Webhooks *Note we’re not going to be covering them in this order! :) The Plan ● Why you want notifications with Flux ● Setting up webhook received with Github ● Setting up Discord notifications with Flux
  • 10. Why? ● When you're looking at the terminal only you know what’s going on ● Surfacing alerts through messaging apps, and other services gives your team visibility, and saves you time, as you don't have to relay as many messages, flux is doing that for you ● Automation is one of the key principles of GitOps, less manual ops === more time for building cool things ● and that’s why automation is one of the key business values of gitops ● Read more at gitops.community
  • 11. tl;dr Flux ● The most powerful tool to get the GitOps experience ● A set of Kubernetes controllers ● GitOps based continuous delivery system
  • 12. Kubernet get Create a kubernetes cluster using your tool of choice I'm using k3ds eks because we're doing some loadbalancey stuff and I don't really want to expose my dev station to the world
  • 13. Bootstrap your cluster 1. Export tokens 2. Bootstrap your cluster 3. Clone the cluster repository, then cd into it $ export GITHUB_TOKEN=<your-token> $ export GITHUB_USER=<your-username> $ export REPO_NAME="woug-demo" $ flux bootstrap github --owner=$GITHUB_USER --repository=$REPO_NAME --branch=main --personal $ git clone git@github.com:$GITHUB_USER/$REPO_NAME $ cd naw-example
  • 14. Creating webhook receiver secret $ TOKEN=$(head -c 12 /dev/urandom | shasum | cut -d ' ' -f1) $ echo $TOKEN $ kubectl -n flux-system create secret generic webhook-token --from-literal=token=$TOKEN
  • 15. Create yaml for load balancer Exposing the webhook receiver apiVersion: v1 kind: Service metadata: name: receiver namespace: flux-system spec: type: LoadBalancer selector: app: notification-controller ports: - name: http port: 80 protocol: TCP targetPort: 9292
  • 16. Creating the receiver create the receiver $ flux create receiver flux-system --type github --event ping --event push --secret-ref webhook-token --resource GitRepository/flux-system --namespace flux-system --export > naw-receiver.yaml # naw-receiver.yaml apiVersion: notification.toolkit.fluxcd.io/v1beta1 kind: Receiver metadata: name: flux-system namespace: flux-system spec: type: github events: - "ping" - "push" secretRef: name: webhook-token resources: - kind: GitRepository name: flux-system It should produce the following: Commit and push this all
  • 17. Setup GitHub Webook ● Navigate to your repo's settings, and webhooks ● Create new webhook ● htto://url of loadbalancer , http insecure + path of hook flux get receiver flux-system /hook ● $echo $TOKEN is the secret
  • 18. Create a Discord Webhook ● assuming you have already created a discord server, if not discord.new ● Create a text channel for your alerts ● Select the settings cog on the text channel you want to post alerts into ● Select Create Webhook ● Give your Webhook a name, Copy the Webhook url, set aside details for later ● Save changes
  • 19. Define a provider Create a secret with the webhook url Create a notification provider for Discord by referencing the above secret $ kubectl -n flux-system create secret generic discord-url --from-literal=address=https://discord.com/api/webhooks/YOUR_DISCORD/WEBHOOK export $D_CHANNEL="" export $D_BOTUSR="" $ flux create alert-provider naw-provider --type discord --secret-ref discord-url --channel $D_CHANNEL --username $D_BOTUSR --export > naw-provider.yaml
  • 20. Define a provider (cont’d) it should produce this file # naw-provider.yaml apiVersion: notification.toolkit.fluxcd.io/v1beta1 kind: Receiver metadata: name: naw-provder namespace: flux-system spec: channel: $D_CHANNEL secretRef: name: discord-url type: discord username: $D_BOTUSR
  • 21. Define an alert Create an alert definition for all repositories and Kustomizations Yaml output $ flux create alert naw-alert --provider-ref naw-provider --event-severity info --event-source Kustomization/'*' --event-source GitRepository/'*' --namespace flux-system --export > naw-alert.yaml # naw-provider.yaml apiVersion: notification.toolkit.fluxcd.io/v1beta1 kind: Receiver metadata: name: naw-provder namespace: flux-system spec: channel: $D_CHANNEL secretRef: name: discord-url type: discord username: $D_BOTUSR
  • 22. Deploying the alert definitions to our cluster Commit the files to the repository $ git add naw-alert.yaml $ git add naw-provider.yaml $ git commit -sm "Add alert, alert provider for discord" $ git push
  • 23. Checking everything's in order Use kubectl to get the status of the alert $ kubectl -n flux-system get alerts NAME READY STATUS AGE naw-alert True Initialized 1m
  • 24. Testing it out Creating a new deployment ● Create a GitRepository source for podinfo ● Create a Kustomization for podinfo $ flux create source git podinfo --url=https://github.com/stefanprodan/podinfo --branch=master --interval=30s --export > ./podinfo-source.yaml $ flux create kustomization podinfo --source=podinfo --path="./kustomize" --prune=true --validation=client --interval=5m --export > ./podinfo-kustomization.yaml
  • 25. Testing it out ● Commit them to git $ git add podinfo-source.yaml $ git add podinfo-kustomization.yaml $ git commit -m "Add podinfo deployment" $ git push
  • 26. Testing it out: Creating some failures ● Create a invalid GitRepository source ● Delete source $ flux create source git nonexist --url=https://github.com/alisondy/nonexist --branch=main --interval=30s --export > ./nonexist-source.yaml $ git add nonexist-source.yaml $ git commit -m "Add a faulty source" $ git push $ git rm nonexist-source.yaml $ git commit -m "Get rid of the non existent source" $ git push
  • 27. What we did ● We setup a webhook receiver using flux ● Configured gitup to send push notifications to it ● We setup flux so it alerted in discord With those skills you will be able to adopt one of the key gitops principles we covered earlier...AUTOMATION!
  • 28. Resources - Flux Docs (https://fluxcd.io/docs/) - Setup Notifications (https://fluxcd.io/docs/guides/notifications/) - Setup Webhook Receivers (https://fluxcd.io/docs/guides/webhook-receivers/) - Alison’s Demo Repo (https://github.com/alisondy/flux-demos) Alison’s slides.md - YouTube Playlist: The Power of GitOps with Flux v2 (https://youtube.com/playlist?list=PL9lTuCFNLaD3fI_g-NXWVxopnJ0adn65d)
  • 29. Migrate to Flux v2! Sign up for our Flux Migration Workshops! bit.ly/FluxMigrationSurvey
  • 30. Upcoming Events April 28: CNCF Cloud Native Live: Migrating from Flux v1 to Flux v2 (Leigh Capili) April 29: Doing GitOps for multicloud resource management using Crossplane and Flux2 (Leonardo Murillo @ Conf42: Cloud Native 2021) May 3: GitOpsCon @ KubeCon EU June 9-10: GitOps Days 2021 GitOpsDays.com
  • 31. Next Steps • Join us on Flux discussions if you have more questions: https://github.com/fluxcd/flux2/discussions • Flux Community: https://fluxcd.io/community/ • Join the GitOps Community Group: https://www.meetup.com/GitOps-Community/ • More info on GitOps? Visit www.gitops.community/ • Join the GitOps Community LinkedIn Group: https://www.linkedin.com/groups/13914610/