Skip to content

Commit b9c4a09

Browse files
make crowdsec slack channel configurable
1 parent ec2a07a commit b9c4a09

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

kbaseresources/database-postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ func (props *Postgres) Render(scope kgen.Scope) {
6262
EnvFromSecretRef: []string{scope.ID() + "-passwords"},
6363
LivenessProbe: &corev1.Probe{ProbeHandler: corev1.ProbeHandler{Exec: &corev1.ExecAction{Command: []string{
6464
"/bin/sh", "-c", fmt.Sprintf(`exec pg_isready -U "%s" -d "dbname=%s" -h 127.0.0.1 -p 5432`, "postgres", "postgres"),
65-
}}}, FailureThreshold: 6, InitialDelaySeconds: 30, PeriodSeconds: 10, SuccessThreshold: 1, TimeoutSeconds: 5},
65+
}}}, FailureThreshold: 6, InitialDelaySeconds: 30, PeriodSeconds: 20, SuccessThreshold: 1, TimeoutSeconds: 5},
6666
ReadinessProbe: &corev1.Probe{ProbeHandler: corev1.ProbeHandler{Exec: &corev1.ExecAction{Command: []string{
6767
"/bin/sh", "-c", "-e", fmt.Sprintf(`exec pg_isready -U "%s" -d "dbname=%s" -h 127.0.0.1 -p 5432`, "postgres", "postgres"),
68-
}}}, FailureThreshold: 6, InitialDelaySeconds: 5, PeriodSeconds: 10, SuccessThreshold: 1, TimeoutSeconds: 5},
68+
}}}, FailureThreshold: 6, InitialDelaySeconds: 5, PeriodSeconds: 20, SuccessThreshold: 1, TimeoutSeconds: 5},
6969
Resources: *props.Resources,
7070
ExtraVolumeMounts: []corev1.VolumeMount{
7171
{Name: "empty-dir", MountPath: "/tmp", SubPath: "tmp-dir"},

kbaseresources/monitoring-crowdsec.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Crowdsec struct {
2828
Notifiers []string `json:"notifiers"`
2929
PersistentVolumeName string `json:"persistentVolumeName"`
3030
Tolerations []corev1.Toleration `json:"tolerations"`
31+
SlackChannel string `json:"slackChannel"`
3132
// HelmChartInfo k8sapp.ChartInfo `json:"helm"`
3233
}
3334

@@ -314,7 +315,7 @@ fi;
314315
`),
315316

316317
"webhook": "${SLACK_API_URL}",
317-
"channel": "#crowdsec",
318+
"channel": props.SlackChannel,
318319
"username": "CrowdSec",
319320
"icon_url": "https://avatars.githubusercontent.com/u/63284097?s=200&v=4",
320321
}),

kbaseresources/values-default.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ crowdsec:
204204
image:
205205
repository: crowdsecurity/crowdsec
206206
tag: v1.6.5
207+
slackChannel: "#crowdsec"
207208
notifiers:
208209
- slack
209210
# - telegram
@@ -395,6 +396,9 @@ alertmanager:
395396
url: https://github.com/prometheus-operator/kube-prometheus/raw/main/manifests/alertmanager-prometheusRule.yaml
396397
replacements:
397398
'job="alertmanager-main"': 'job="alertmanager"'
399+
alertReplacements:
400+
AlertmanagerFailedToSendAlerts:
401+
"for: 5m": "for: 15m" # to fix noisy alerts
398402
node-exporter:
399403
image:
400404
repository: quay.io/prometheus/node-exporter

0 commit comments

Comments
 (0)