Skip to content

Commit

Permalink
feat(blackbox-exporter): deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jfroy committed Dec 29, 2024
1 parent aa4329f commit a9253cf
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kyverno.io/v2
kind: PolicyException
metadata:
name: blackbox-exporter
namespace: kyverno
spec:
exceptions:
- policyName: psa-baseline
ruleNames:
- baseline
match:
any:
- resources:
kinds:
- Pod
- Deployment
names:
- blackbox-exporter*
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- blackbox-exporter.yaml
- buildkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: blackbox-exporter
spec:
interval: 30m
chartRef:
kind: OCIRepository
name: blackbox-exporter
namespace: flux-system
driftDetection:
mode: enabled
install:
crds: CreateReplace
remediation:
retries: 3
upgrade:
crds: CreateReplace
remediation:
retries: 3
values:
fullnameOverride: blackbox-exporter
securityContext:
capabilities:
add: ["NET_RAW"]
config:
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
follow_redirects: true
http_2xx_ipv4:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
follow_redirects: true
preferred_ip_protocol: ipv4
ip_protocol_fallback: false
http_2xx_ipv6:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
follow_redirects: true
preferred_ip_protocol: ipv6
ip_protocol_fallback: false
serviceMonitor:
selfMonitor:
enabled: true
enabled: true
defaults:
interval: 1m
scrapeTimeout: 10s
targets:
- name: cloudflare-ipv4
url: https://cloudflare.com
module: http_2xx_ipv4
- name: cloudflare-ipv6
url: https://cloudflare.com
module: http_2xx_ipv6
- name: google-ipv4
url: https://google.com
module: http_2xx_ipv4
- name: google-ipv6
url: https://google.com
module: http_2xx_ipv6
- name: github-ipv4
url: https://github.com
module: http_2xx_ipv4
- name: github-ipv6
url: https://github.com
module: http_2xx_ipv6
prometheusRule:
enabled: true
rules:
- alert: BlackboxProbeFailed
expr: probe_success == 0
for: 15m
labels:
severity: critical
annotations:
summary: |-
The host {{ $labels.target }} is currently unreachable
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml
19 changes: 19 additions & 0 deletions kubernetes/apps/observability/blackbox-exporter/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app blackbox-exporter
namespace: flux-system
spec:
targetNamespace: observability
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/observability/blackbox-exporter/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
1 change: 1 addition & 0 deletions kubernetes/apps/observability/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
- ./namespace.yaml
# --
- ./alloy/ks.yaml
- ./blackbox-exporter/ks.yaml
- ./exportarr/ks.yaml
- ./gatus/ks.yaml
- ./grafana/ks.yaml
Expand Down
14 changes: 14 additions & 0 deletions kubernetes/flux/repositories/oci/prometheus-community.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ spec:
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: blackbox-exporter
namespace: flux-system
spec:
interval: 2h
layerSelector:
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
operation: copy
url: oci://ghcr.io/prometheus-community/charts/prometheus-blackbox-exporter
ref:
semver: 9.1.0
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: kube-state-metrics
namespace: flux-system
Expand Down

0 comments on commit a9253cf

Please sign in to comment.