feat(sb-server-monitor): move deployment to core repo #372

Merged
tom merged 1 commit from tn-add-sb-server-monitor-deployment into main 2024-12-05 22:23:04 +01:00
7 changed files with 130 additions and 0 deletions

View file

@ -93,3 +93,24 @@ spec:
automated:
selfHeal: false
prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sb-server-monitor
namespace: argocd
spec:
project: default
source:
repoURL: https://git.ar21.de/yolokube/core-deployments.git
targetRevision: HEAD
path: sb-server-monitor
destination:
server: https://kubernetes.default.svc
namespace: sb-server-monitor
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
prune: true

View file

@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: sb-server-monitor

View file

@ -0,0 +1,9 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter
name: sb-server-monitor-exporter-service-account
namespace: sb-server-monitor

View file

@ -0,0 +1,42 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sb-server-monitor-exporter
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter
name: sb-server-monitor-exporter
namespace: sb-server-monitor
spec:
replicas: 1
selector:
matchLabels:
app: sb-server-monitor-exporter
template:
metadata:
labels:
app: sb-server-monitor-exporter
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter
spec:
containers:
- env:
- name: SBSERVERMONITOR_SCRAPE_INTERVAL
value: "300"
image: git.ar21.de/yolokube/sb-server-monitor:latest
imagePullPolicy: IfNotPresent
name: sb-server-monitor-exporter
ports:
- containerPort: 9192
name: http-metrics
protocol: TCP
resources:
limits:
cpu: "2"
memory: 4Gi
requests:
cpu: 500m
memory: 2Gi
restartPolicy: Always
serviceAccountName: sb-server-monitor-exporter-service-account

View file

@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
labels:
app: sb-server-monitor-exporter
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter
name: sb-server-monitor-exporter
namespace: sb-server-monitor
spec:
ports:
- name: http-metrics
port: 9192
protocol: TCP
targetPort: http-metrics
selector:
app: sb-server-monitor-exporter
type: ClusterIP

View file

@ -0,0 +1,21 @@
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: sb-server-monitor-exporter
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter
name: sb-server-monitor-exporter-servicemonitor
namespace: sb-server-monitor
spec:
endpoints:
- interval: 5m
path: /metrics
port: http-metrics
scheme: http
jobLabel: jobLabel
selector:
matchLabels:
app.kubernetes.io/instance: sb-server-monitor
app.kubernetes.io/name: sb-server-monitor-exporter

View file

@ -0,0 +1,13 @@
resources:
- ./0-namespace.yaml
- ./1-service-account.yaml
- ./2-deployment.yaml
- ./3-service.yaml
- ./4-service-monitor.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: git.ar21.de/yolokube/sb-server-monitor
newName: git.ar21.de/yolokube/sb-server-monitor
newTag: "12"
namespace: fail2ban-prometheus