From fb55a8167760634065be5b6d9306bf0c56a5ae97 Mon Sep 17 00:00:00 2001 From: Tom Neuber Date: Thu, 5 Dec 2024 22:10:13 +0100 Subject: [PATCH] feat(sb-server-monitor): move deployment to core repo --- app-files/apps.yaml | 21 ++++++++++++ sb-server-monitor/0-namespace.yaml | 5 +++ sb-server-monitor/1-service-account.yaml | 9 +++++ sb-server-monitor/2-deployment.yaml | 42 ++++++++++++++++++++++++ sb-server-monitor/3-service.yaml | 19 +++++++++++ sb-server-monitor/4-service-monitor.yaml | 21 ++++++++++++ sb-server-monitor/kustomization.yaml | 13 ++++++++ 7 files changed, 130 insertions(+) create mode 100644 sb-server-monitor/0-namespace.yaml create mode 100644 sb-server-monitor/1-service-account.yaml create mode 100644 sb-server-monitor/2-deployment.yaml create mode 100644 sb-server-monitor/3-service.yaml create mode 100644 sb-server-monitor/4-service-monitor.yaml create mode 100644 sb-server-monitor/kustomization.yaml diff --git a/app-files/apps.yaml b/app-files/apps.yaml index a963ed5..5071e96 100644 --- a/app-files/apps.yaml +++ b/app-files/apps.yaml @@ -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 diff --git a/sb-server-monitor/0-namespace.yaml b/sb-server-monitor/0-namespace.yaml new file mode 100644 index 0000000..05bf915 --- /dev/null +++ b/sb-server-monitor/0-namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: sb-server-monitor diff --git a/sb-server-monitor/1-service-account.yaml b/sb-server-monitor/1-service-account.yaml new file mode 100644 index 0000000..d6b88a8 --- /dev/null +++ b/sb-server-monitor/1-service-account.yaml @@ -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 diff --git a/sb-server-monitor/2-deployment.yaml b/sb-server-monitor/2-deployment.yaml new file mode 100644 index 0000000..9df6bc4 --- /dev/null +++ b/sb-server-monitor/2-deployment.yaml @@ -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 diff --git a/sb-server-monitor/3-service.yaml b/sb-server-monitor/3-service.yaml new file mode 100644 index 0000000..3e0e8f6 --- /dev/null +++ b/sb-server-monitor/3-service.yaml @@ -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 diff --git a/sb-server-monitor/4-service-monitor.yaml b/sb-server-monitor/4-service-monitor.yaml new file mode 100644 index 0000000..2b5fb33 --- /dev/null +++ b/sb-server-monitor/4-service-monitor.yaml @@ -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 diff --git a/sb-server-monitor/kustomization.yaml b/sb-server-monitor/kustomization.yaml new file mode 100644 index 0000000..6faf0b9 --- /dev/null +++ b/sb-server-monitor/kustomization.yaml @@ -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