Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notification component #73

Merged
merged 4 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
curl https://raw.githubusercontent.com/fluxcd/source-controller/master/docs/spec/v1alpha1/helmrepositories.md > docs/components/source/helmrepositories.md
curl https://raw.githubusercontent.com/fluxcd/kustomize-controller/master/docs/api/kustomize.md > docs/components/kustomize/api.md
curl https://raw.githubusercontent.com/fluxcd/kustomize-controller/master/docs/spec/v1alpha1/kustomization.md > docs/components/kustomize/kustomization.md
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/api/notification.md > docs/components/notification/api.md
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/event.md > docs/components/notification/event.md
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/alert.md > docs/components/notification/alert.md
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/provider.md > docs/components/notification/provider.md
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
Expand Down
2 changes: 1 addition & 1 deletion cmd/tk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func init() {
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "", false,
"print generated objects")
rootCmd.PersistentFlags().StringSliceVar(&components, "components",
[]string{"source-controller", "kustomize-controller"},
[]string{"source-controller", "kustomize-controller", "notification-controller"},
"list of components, accepts comma-separated values")
}

Expand Down
2 changes: 1 addition & 1 deletion docs/components/kustomize/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Features:
- Health assessment of the deployed workloads
- Runs pipelines in a specific order (depends-on relationship)
- Prunes objects removed from source (garbage collection)
- Reports cluster state changes (Slack/Discord)
- Reports cluster state changes (alerting provided by notification-controller)

Links:

Expand Down
16 changes: 16 additions & 0 deletions docs/components/notification/controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Notification Controller

The Notification Controller is a Kubernetes operator,
specialized in dispatching events to external systems such as
Slack, Microsoft Teams, Discord and Rocket chat.

The controller receives events via HTTP and dispatch them to external
webhooks based on event severity and involved objects.

The controller can be configured with Kubernetes custom resources that
define how events are processed and where to dispatch them.

Links:

- Source code [fluxcd/notification-controller](https://github.com/fluxcd/notification-controller)
- Specification [docs](https://github.com/fluxcd/notification-controller/tree/master/docs/spec)
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Components:
- [HelmRepository CRD](components/source/helmrepositories.md)
- [Kustomize Controller](components/kustomize/controller.md)
- [Kustomization CRD](components/kustomize/kustomization.md)
- [Notification Controller](components/notification/controller.md)
- [Provider CRD](components/notification/provider.md)
- [Alert CRD](components/notification/alert.md)
- Helm Controller (TBA)

To get started with the toolkit please follow this [guide](get-started/index.md).
6 changes: 3 additions & 3 deletions docs/roadmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Non-Goals
Tasks

- Review the git source and kustomize APIs
- Design the events API
- ~~Design the events API~~
- Implement events in source and kustomize controllers
- Implement Prometheus metrics in source and kustomize controllers
- Make the kustomize-controller apply/gc events on-par with Flux v1 apply events
- Design the notifications and events filtering API
- Implement a notification controller for Slack, MS Teams, Discord, Rocket
- ~~Design the notifications and events filtering API~~
- ~~Implement a notification controller for Slack, MS Teams, Discord, Rocket~~
- Implement the migration command in tk
- Create a migration guide for `flux.yaml` kustomize users

Expand Down
11 changes: 9 additions & 2 deletions manifests/bases/kustomize-controller/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/fluxcd/kustomize-controller/config//crd?ref=v0.0.1
- github.com/fluxcd/kustomize-controller/config//manager?ref=v0.0.1
- github.com/fluxcd/kustomize-controller/config//crd?ref=v0.0.2
- github.com/fluxcd/kustomize-controller/config//manager?ref=v0.0.2
patchesJson6902:
- target:
group: apps
version: v1
kind: Deployment
name: kustomize-controller
path: patch.yaml
3 changes: 3 additions & 0 deletions manifests/bases/kustomize-controller/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: add
path: /spec/template/spec/containers/0/args/0
value: --events-addr=http://notification-controller/
5 changes: 5 additions & 0 deletions manifests/bases/notification-controller/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/fluxcd/notification-controller/config//crd?ref=v0.0.1-alpha.2
- github.com/fluxcd/notification-controller/config//manager?ref=v0.0.1-alpha.2
1 change: 1 addition & 0 deletions manifests/install/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- namespace.yaml
- ../bases/source-controller
- ../bases/kustomize-controller
- ../bases/notification-controller
- ../rbac
- ../policies
transformers:
Expand Down
3 changes: 3 additions & 0 deletions manifests/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ rules:
- apiGroups: ['kustomize.fluxcd.io']
resources: ['*']
verbs: ['*']
- apiGroups: ['notification.fluxcd.io']
resources: ['*']
verbs: ['*']
- apiGroups:
- ""
resources:
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ nav:
- Overview: components/kustomize/controller.md
- Kustomization CRD: components/kustomize/kustomization.md
- Kustomize API Reference: components/kustomize/api.md
- Notification Controller:
- Overview: components/notification/controller.md
- Profile CRD: components/notification/profile.md
- Alert CRD: components/notification/alert.md
- Event: components/notification/event.md
- Notification API Reference: components/notification/api.md
- Toolkit CLI:
- Overview: cmd/tk.md
- Bootstrap: cmd/tk_bootstrap.md
Expand Down