ntfy-alertmanager.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: ntfy-alertmanager
  6. namespace: monitoring
  7. spec:
  8. selector:
  9. matchLabels:
  10. app: ntfy-alertmanager
  11. replicas: 1
  12. template:
  13. metadata:
  14. labels:
  15. app: ntfy-alertmanager
  16. spec:
  17. containers:
  18. - name: ntfy-alertmanager
  19. image: xenrox/ntfy-alertmanager:latest
  20. args: ["--config", "/config/config.yaml"]
  21. ports:
  22. - containerPort: 8080
  23. name: http-web-svc
  24. volumeMounts:
  25. - mountPath: "/config"
  26. name: "config"
  27. volumes:
  28. - name: config
  29. secret:
  30. secretName: ntfy-alertmanager
  31. ---
  32. apiVersion: v1
  33. kind: Service
  34. metadata:
  35. name: ntfy-alertmanager
  36. namespace: monitoring
  37. spec:
  38. selector:
  39. app: ntfy-alertmanager
  40. type: ClusterIP
  41. ports:
  42. - name: ntfy-alertmanager-port
  43. protocol: TCP
  44. port: 80
  45. targetPort: http-web-svc
  46. ---
  47. apiVersion: networking.k8s.io/v1
  48. kind: Ingress
  49. metadata:
  50. name: ntfy-alertmanager
  51. namespace: monitoring
  52. annotations:
  53. traefik.ingress.kubernetes.io/router.entrypoints: websecure
  54. spec:
  55. rules:
  56. - host: ntfy-alertmanager.jibby.org
  57. http:
  58. paths:
  59. - path: /
  60. pathType: Prefix
  61. backend:
  62. service:
  63. name: ntfy-alertmanager
  64. port:
  65. number: 80
  66. ---
  67. apiVersion: external-secrets.io/v1
  68. kind: ExternalSecret
  69. metadata:
  70. name: ntfy-alertmanager
  71. namespace: monitoring
  72. spec:
  73. target:
  74. name: ntfy-alertmanager
  75. deletionPolicy: Delete
  76. template:
  77. type: Opaque
  78. data:
  79. ntfyamuser: |-
  80. {{ .ntfyamuser }}
  81. ntfyampass: |-
  82. {{ .ntfyampass }}
  83. config.yaml: |-
  84. # Ref: https://git.xenrox.net/~xenrox/ntfy-alertmanager/tree/master/item/config.scfg
  85. # Public facing base URL. Required for the "Silence" feature.
  86. base-url https://ntfy-alertmanager.jibby.org
  87. # http listen address
  88. http-address :8080
  89. # Log level (either debug, info, warning, error)
  90. log-level info
  91. # Log format (either text or json)
  92. log-format text
  93. # When multiple alerts are grouped together by Alertmanager, they can either be sent
  94. # each on their own (single mode) or be kept together (multi mode) (either single or multi; default is multi)
  95. alert-mode single
  96. # Optionally protect with HTTP basic authentication
  97. user {{ .ntfyamuser }}
  98. password {{ .ntfyampass }}
  99. labels {
  100. order "severity,instance"
  101. severity "critical" {
  102. priority 5
  103. tags "rotating_light"
  104. }
  105. severity "info" {
  106. priority 1
  107. }
  108. instance "example.com" {
  109. tags "computer,example"
  110. }
  111. }
  112. # Settings for resolved alerts
  113. resolved {
  114. tags "resolved,partying_face"
  115. priority 1
  116. }
  117. ntfy {
  118. # URL of the ntfy topic - required
  119. topic https://ntfy.jibby.org/alertmanager-alerts
  120. # ntfy authentication via Basic Auth (https://docs.ntfy.sh/publish/#username-password)
  121. user {{ .ntfyuser }}
  122. password {{ .ntfypass }}
  123. }
  124. alertmanager {
  125. silence-duration 24h
  126. url http://alertmanager-operated.monitoring.svc.cluster.local:9093
  127. }
  128. data:
  129. - secretKey: ntfyamuser
  130. sourceRef:
  131. storeRef:
  132. name: bitwarden-login
  133. kind: ClusterSecretStore
  134. remoteRef:
  135. key: af0ecb7c-25e5-4907-82be-b3f80121ceae
  136. property: username
  137. - secretKey: ntfyampass
  138. sourceRef:
  139. storeRef:
  140. name: bitwarden-login
  141. kind: ClusterSecretStore
  142. remoteRef:
  143. key: af0ecb7c-25e5-4907-82be-b3f80121ceae
  144. property: password
  145. - secretKey: ntfyuser
  146. sourceRef:
  147. storeRef:
  148. name: bitwarden-login
  149. kind: ClusterSecretStore
  150. remoteRef:
  151. key: 674fbf3d-531a-4ca6-afec-b1d7012d1a8a
  152. property: username
  153. - secretKey: ntfypass
  154. sourceRef:
  155. storeRef:
  156. name: bitwarden-login
  157. kind: ClusterSecretStore
  158. remoteRef:
  159. key: 674fbf3d-531a-4ca6-afec-b1d7012d1a8a
  160. property: password