Skip to content

Commit

Permalink
adding mailgun and alerting
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and TheBigLee committed Nov 21, 2023
1 parent 7d54ca2 commit 3edb433
Show file tree
Hide file tree
Showing 22 changed files with 4,963 additions and 32 deletions.
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

0 comments on commit 3edb433

Please sign in to comment.