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 mailgun and alerting alerting to Redis #257

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion component/class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ parameters:
appcat:
registry: ghcr.io
repository: vshn/appcat
tag: v4.41.1
tag: v4.42.0
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand Down
11 changes: 11 additions & 0 deletions component/component/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ local openShiftTemplate(name, displayName, description, iconClass, tags, message
message: message,
};

local emailAlerting(alertingSettings) = {
emailAlertingEnabled: std.toString(alertingSettings.enabled),
emailAlertingSecretNamespace: alertingSettings.secretNamespace,
emailAlertingSecretName: alertingSettings.secretName,
emailAlertingSmtpFromAddress: alertingSettings.smtpFromAddress,
emailAlertingSmtpUsername: alertingSettings.smtpUsername,
emailAlertingSmtpHost: alertingSettings.smtpHost,
};

local getAppCatImageTag() = std.strReplace(params.images.appcat.tag, '/', '_');

local getApiserverImageTag() = std.strReplace(params.images.apiserver.tag, '/', '_');
Expand Down Expand Up @@ -177,4 +186,6 @@ local argoCDAnnotations() = {
removeField(obj, name),
ArgoCDAnnotations():
argoCDAnnotations(),
EmailAlerting(alertingSettings):
emailAlerting(alertingSettings),
}
2 changes: 1 addition & 1 deletion component/component/prometheus.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ local generatePrometheusNonSLORules(serviceName, memoryContainerName, additional
runbook_url: 'https://hub.syn.tools/appcat/runbooks/vshn-generic.html#MemoryCritical',
summary: 'Memory usage critical',
},
expr: std.strReplace(topPod('(container_memory_working_set_bytes{container="%s"} / on(container,pod,namespace) kube_pod_container_resource_limits{resource="memory"} * 100) > 85') % memoryContainerName, toReplace, 'vshn-' + serviceNameLower),
expr: std.strReplace(topPod('(max(container_memory_working_set_bytes{container="%s"}) without (name, id) / on(container,pod,namespace) kube_pod_container_resource_limits{resource="memory"} * 100) > 85') % memoryContainerName, toReplace, 'vshn-' + serviceNameLower),
'for': '120m',
labels: {
severity: 'critical',
Expand Down
8 changes: 1 addition & 7 deletions component/component/vshn_postgres.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -912,16 +912,10 @@ local composition(restore=false) =
data: {
imageTag: common.GetAppCatImageTag(),
sgNamespace: pgParams.sgNamespace,
emailAlertingEnabled: std.toString(params.services.vshn.emailAlerting.enabled),
emailAlertingSecretNamespace: params.services.vshn.emailAlerting.secretNamespace,
emailAlertingSecretName: params.services.vshn.emailAlerting.secretName,
emailAlertingSmtpFromAddress: params.services.vshn.emailAlerting.smtpFromAddress,
emailAlertingSmtpUsername: params.services.vshn.emailAlerting.smtpUsername,
emailAlertingSmtpHost: params.services.vshn.emailAlerting.smtpHost,
externalDatabaseConnectionsEnabled: std.toString(params.services.vshn.externalDatabaseConnectionsEnabled),
quotasEnabled: std.toString(params.services.vshn.quotasEnabled),
sideCars: std.toString(pgParams.sideCars),
},
} + common.EmailAlerting(params.services.vshn.emailAlerting),
},
container: {
image: 'postgresql',
Expand Down
2 changes: 1 addition & 1 deletion component/component/vshn_redis.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ local composition =
controlNamespace: params.services.controlNamespace,
restoreSA: 'redisrestoreserviceaccount',
quotasEnabled: std.toString(params.services.vshn.quotasEnabled),
},
} + common.EmailAlerting(params.services.vshn.emailAlerting),
},
container: {
image: 'redis',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.41.1
imageTag: v4.42.0
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
minioChartVersion: 5.0.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.41.1
image: ghcr.io/vshn/appcat:v4.42.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
alertmanagerConfigRef:
description: AlertmanagerConfigRef contains the name of
the AlertmanagerConfig that should be copied over to the
namespace of the PostgreSQL instance.
namespace of the instance.
type: string
alertmanagerConfigSecretRef:
description: AlertmanagerConfigSecretRef contains the name
Expand Down
Loading
Loading