diff --git a/kubernetes/apps/observability/alertmanager/ks.yaml b/kubernetes/apps/observability/alertmanager/ks.yaml index 1279419f..26c72087 100644 --- a/kubernetes/apps/observability/alertmanager/ks.yaml +++ b/kubernetes/apps/observability/alertmanager/ks.yaml @@ -1,5 +1,5 @@ --- -# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: @@ -21,3 +21,24 @@ spec: dependsOn: - name: external-secrets-stores - name: rook-ceph-cluster +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app alertmanager-silencer + namespace: flux-system +spec: + targetNamespace: observability + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: "./kubernetes/apps/observability/alertmanager/silencer" + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/apps/observability/alertmanager/silencer/helmrelease.yaml b/kubernetes/apps/observability/alertmanager/silencer/helmrelease.yaml new file mode 100644 index 00000000..b304a8ea --- /dev/null +++ b/kubernetes/apps/observability/alertmanager/silencer/helmrelease.yaml @@ -0,0 +1,56 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: alertmanager-silencer +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.0.4 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + strategy: rollback + dependsOn: + - name: kube-prometheus-stack + namespace: observability + values: + controllers: + alertmanager-silencer: + type: cronjob + cronjob: + schedule: "@daily" + containers: + app: + image: + repository: ghcr.io/onedr0p/kubanetics + tag: 2024.10.6 + env: + SCRIPT_NAME: alertmanager-silencer.sh + ALERTMANAGER_URL: http://alertmanager.observability.svc.cluster.local:9093 + MATCHERS_0: alertname=CephPGImbalance job=rook-ceph-exporter + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + resources: + requests: + cpu: 25m + limits: + memory: 128Mi + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + runAsNonRoot: true diff --git a/kubernetes/apps/observability/alertmanager/silencer/kustomization.yaml b/kubernetes/apps/observability/alertmanager/silencer/kustomization.yaml new file mode 100644 index 00000000..17cbc72b --- /dev/null +++ b/kubernetes/apps/observability/alertmanager/silencer/kustomization.yaml @@ -0,0 +1,6 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml