Updates README (#3)

* Updates README
  * Update helm instructions.
* Generates README for helm chart
* Adds a schema.json file for helm chart
This commit is contained in:
Iain Sproat
2022-11-07 22:43:17 +00:00
committed by GitHub
parent 82e9275166
commit a15481f294
5 changed files with 302 additions and 12 deletions
+8
View File
@@ -22,6 +22,7 @@ repos:
- id: check-vcs-permalinks
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: "deploy/helm/README.md"
- repo: https://github.com/syntaqx/git-hooks
rev: "v0.0.17"
@@ -44,5 +45,12 @@ repos:
- id: go-build
- id: go-mod-tidy
- repo: https://github.com/norwoodj/helm-docs
rev: v1.2.0
hooks:
- id: helm-docs
args:
- --chart-search-root=deploy/helm
ci:
autoupdate_schedule: quarterly
+25 -5
View File
@@ -1,12 +1,12 @@
# alertmanager-discord
Give this a webhook (with the DISCORD_WEBHOOK environment variable) and point it as a webhook on alertmanager, and it will post your alerts into a discord channel for you as they trigger:
This is a webserver that accepts webhooks from AlertManager. It will post your Prometheus alert notifications into a Discord channel as they trigger:
![](/.github/demo-new.png)
## Warning
This program is not a replacement to alertmanager, it accepts webhooks from alertmanager, not prometheus.
This program is not a replacement to alertmanager, it accepts webhooks from alertmanager, not Prometheus.
The standard "dataflow" should be:
@@ -25,7 +25,7 @@ alerting: receivers:
```
## Example alertmanager config:
## Example alertmanager config
```
global:
@@ -53,6 +53,26 @@ receivers:
- url: 'http://localhost:9094'
```
## Docker
## Deployment
If you run a fancy docker/k8s infra, you can find the docker hub repo here: https://hub.docker.com/r/benjojo/alertmanager-discord/
### Docker
If you wish to deploy this to docker infra, you can find the docker hub repo here: https://hub.docker.com/r/speckle/alertmanager-discord/
### Kubernetes Helm Chart
If you wish to deploy this to Kubernetes, this repository contains a Helm Chart.
```shell
helm upgrade --install \
--create-namespace \
--namespace alertmanager-discord
alertmanager-discord \
./deploy/helm
```
You can optionally also provide a values yaml file, `--values ./your-values.yaml`, to override the default values.
## Acknowledgements
This repository is forked from https://github.com/benjojo/alertmanager-discord under the Apache 2.0 license
+40
View File
@@ -0,0 +1,40 @@
# alertmanager-discord
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
A Helm chart to deploy alertmanager-discord to Kubernetes
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| ciliumNetworkPolicy.alertManagerSelectorLabels | object | `{}` | the labels applied to the alertmanager which will send data to this service. If Cilium Network Policy is enabled, ingress to this service is only allowed from a pod matching these labels. |
| ciliumNetworkPolicy.enabled | bool | `false` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"speckle/alertmanager-discord"` | |
| image.tag | string | `"latest"` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext.fsGroup | int | `2000` | |
| replicaCount | int | `1` | |
| resources.limits.cpu | string | `"100m"` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"50m"` | |
| resources.requests.memory | string | `"64Mi"` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| securityContext.readOnlyRootFilesystem | bool | `true` | |
| securityContext.runAsNonRoot | bool | `true` | |
| securityContext.runAsUser | int | `1000` | |
| server.discordWebhookSecret.key | string | `"discord-uri"` | key within the Opaque Kubernetes Secret |
| server.discordWebhookSecret.name | string | `"discord-webhook"` | name of the Kubernetes Secret containing the Discord webhook url. Must be in the same namespace as this helm chart is deployed. |
| service.port | int | `9094` | The port to which alertmanager should push alerts |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | |
+218
View File
@@ -0,0 +1,218 @@
{
"title": "Chart Values",
"type": "object",
"properties": {
"replicaCount": {
"type": "number",
"description": "The number of replicas of the alertmanager-discord pod to deploy",
"default": 1
},
"image": {
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "The OCI compatible repository containing the image to deploy",
"default": "speckle/alertmanager-discord"
},
"pullPolicy": {
"type": "string",
"description": "Controls when the image should be pulled from the repository.",
"default": "Always"
},
"tag": {
"type": "string",
"description": "Overrides the image tag whose default is the chart appVersion.",
"default": "latest"
}
}
},
"imagePullSecrets": {
"type": "array",
"description": "If the image is in a private repository, pull secrets are required.",
"default": [],
"items": {}
},
"nameOverride": {
"type": "string",
"description": "Override the name of this Helm Release",
"default": ""
},
"fullnameOverride": {
"type": "string",
"description": "Override the full name generated for this Helm Release",
"default": ""
},
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "Specifies whether a service account should be created",
"default": true
},
"annotations": {
"type": "object",
"description": "Annotations to add to the service account",
"default": {}
},
"name": {
"type": "string",
"description": "The name of the service account to use. If not set and create is true, a name is generated using the fullname template",
"default": ""
}
}
},
"podAnnotations": {
"type": "object",
"description": "Annotations to apply to pods generated by this Helm Chart",
"default": {}
},
"podSecurityContext": {
"type": "object",
"properties": {
"fsGroup": {
"type": "number",
"description": "The group number in which the pod user will operate",
"default": 2000
}
}
},
"securityContext": {
"type": "object",
"properties": {
"capabilities": {
"type": "object",
"properties": {
"drop": {
"type": "array",
"description": "The kernel capabilities to remove from this pod.",
"default": [
"ALL"
],
"items": {
"type": "string"
}
}
}
},
"readOnlyRootFilesystem": {
"type": "boolean",
"description": "Deteremines whether the root file system is readonly.",
"default": true
},
"runAsNonRoot": {
"type": "boolean",
"description": "Deteremines whether the user is non-root.",
"default": true
},
"runAsUser": {
"type": "number",
"description": "The uid of the user under which the pod is run.",
"default": 1000
}
}
},
"service": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type of service (e.g. ClusterIP or Loadbalancer)",
"default": "ClusterIP"
},
"port": {
"type": "number",
"description": "The port to which alertmanager should push alerts",
"default": 9094
}
}
},
"resources": {
"type": "object",
"properties": {
"limits": {
"type": "object",
"properties": {
"cpu": {
"type": "string",
"description": "The maximum CPU that will be made available to the pod",
"default": "100m"
},
"memory": {
"type": "string",
"description": "The maximum memory that will be made available to the pod. Above this value the pod runs the risk of being OOMKilled",
"default": "128Mi"
}
}
},
"requests": {
"type": "object",
"properties": {
"cpu": {
"type": "string",
"description": "The CPU that is requested by this pod when deployed, used for space allocation on nodes.",
"default": "50m"
},
"memory": {
"type": "string",
"description": "The memory that is requested by this pod when deployed, used for space allocation on nodes.",
"default": "64Mi"
}
}
}
}
},
"nodeSelector": {
"type": "object",
"description": "Assign the pods deployed by this Helm Chart to a specific node which matches the selector.",
"default": {}
},
"tolerations": {
"type": "array",
"description": "Allows the pods deployed by this Helm Chart to tolerate specific criteria which may be found applied to nodes.",
"default": [],
"items": {}
},
"affinity": {
"type": "object",
"description": "The pods deployed by this Helm Chart will tend to this specific criteria which may be found applied to nodes.",
"default": {}
},
"server": {
"type": "object",
"properties": {
"discordWebhookSecret": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the Kubernetes Secret containing the Discord webhook url. Must be in the same namespace as this helm chart is deployed.",
"default": "discord-webhook"
},
"key": {
"type": "string",
"description": "The key within the Opaque Kubernetes Secret containing the webhook value.",
"default": "discord-uri"
}
}
}
}
},
"ciliumNetworkPolicy": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "If enabled, deploys a Cilium Network Policy to restrict network ingress and egress to the pods deployed by this Helm Chart",
"default": false
},
"alertManagerSelectorLabels": {
"type": "object",
"description": "The labels expected to be applied to the AlertManager pods which will send data to this service. If Cilium Network Policy is enabled, ingress to this service is only allowed from a pod matching these labels.",
"default": {}
}
}
}
}
}
+11 -7
View File
@@ -3,7 +3,7 @@ replicaCount: 1
image:
repository: speckle/alertmanager-discord
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
# -- Overrides the image tag whose default is the chart appVersion.
tag: "latest"
imagePullSecrets: []
@@ -11,11 +11,11 @@ nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
# -- Specifies whether a service account should be created
create: true
# Annotations to add to the service account
# -- Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
@@ -34,6 +34,7 @@ securityContext:
service:
type: ClusterIP
# -- The port to which alertmanager should push alerts
port: 9094
resources:
@@ -52,9 +53,12 @@ affinity: {}
server:
discordWebhookSecret:
name: discord-webhook # name of the Kubernetes Secret containing the Discord webhook url. Must be in the same namespace as this helm chart is deployed.
key: "discord-uri" # key within the Opaque Kubernetes Secret
# -- name of the Kubernetes Secret containing the Discord webhook url. Must be in the same namespace as this helm chart is deployed.
name: discord-webhook
# -- key within the Opaque Kubernetes Secret
key: "discord-uri"
ciliumNetworkPolicy:
enabled: false
alertManagerSelectorLabels: {} # the labels applied to the alertmanager which will send data to this service. If Cilium Network Policy is enabled, ingress to this service is only allowed from a pod matching these labels.
# -- the labels applied to the alertmanager which will send data to this service. If Cilium Network Policy is enabled, ingress to this service is only allowed from a pod matching these labels.
alertManagerSelectorLabels: {}