kubealerta is a Kubernetes plugin/operator designed to streamline notifications to Teams channels based on filtered resources. Please note that the project is currently under construction, and we are actively working on enhancing its features.
Note
Currently, kubealerta is configured to send notifications specifically for nodes..
Follow these steps to deploy kubealerta in your Kubernetes cluster:
- Download the manifest file from here.
- Deploy the manifest file in your Kubernetes cluster using the following command:
kubectl apply -f manifest.yaml
OR
kubectl apply -f https://raw.githubusercontent.com/valipashask26/KubeAlerta/main/deploy/manifest/manifest.yaml
The manifest will create:
- Namespace
- ServiceAccount
- ClusterRole
- ClusterRoleBinding
- Deployment
- CRDs
Here, it will deploy 3 types of CRDs:
-
Notify:
- To add Teams links, use the following example YAML:
apiVersion: kubealerta.io/v1 kind: Notify metadata: name: example-notify namespace: kubealerta labels: test: kubealerta-01 spec: webhookURL: "https://teams.webhook.url"
- To add Teams links, use the following example YAML:
-
NamespacedFilter:
- Specify the resources you want to get notified about (e.g., pod, deployment, daemonset). Follow the example YAML:
apiVersion: kubealerta.io/v1 kind: NamespacedFilter metadata: name: filter2 namespace: kubealerta labels: test: kubealerta-02 spec: resource: Deployment rNames: - docker-dind-deployment namespaces: - sample
- Specify the resources you want to get notified about (e.g., pod, deployment, daemonset). Follow the example YAML:
-
ClusterFilter:
- Specify cluster-level resources you want to get notified about (e.g., Nodes). Follow the example YAML:
apiVersion: kubealerta.io/v1 kind: ClusterFilter metadata: name: node-alert namespace: kubealerta labels: test: kubealerta-01 spec: resource: Nodes nodesNames: - aks-agent1pool
- Specify cluster-level resources you want to get notified about (e.g., Nodes). Follow the example YAML:
Within this configuration, you possess the option to specify either the individual nodeName or the nodepool name. However, it's important to note that in the spec.resource field, you must explicitly mention "Nodes," even when intending to target nodes using the nodepool name as a prefix. In such cases, kubeAlerta will recognize the provided nodepool name as a prefix and subsequently retrieve events for all nodes sharing that specified prefix.
NOTE:
- The
notifyCRD is mandatory to create. - When creating a CRD with
clusterfilterornamespacedfilter, the labels you use should match with thenotifyyou are going to create. For example:- If you have created a
namespacedfilter(sample-01) with labelsapp: nginx, then use the same labels for thenotifyCRD (notify-01) to establish a connection. - Labels in sample-01 should not match with sample-02.
- Create all the resources in "kubealerta" Namespace only.
- If you have created a
This project is licensed under the MIT License - see the LICENSE file for details...