infra: add K8s deployment manifest for monitoring-service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-02 21:38:08 +01:00
parent 9e20337ee4
commit dd14d58fc3

View File

@@ -0,0 +1,117 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: monitoring-service
namespace: foxhunt
labels:
app.kubernetes.io/name: monitoring-service
app.kubernetes.io/part-of: foxhunt
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/name: monitoring-service
template:
metadata:
annotations:
gitlab.com/prometheus_scrape: "true"
gitlab.com/prometheus_port: "9099"
gitlab.com/prometheus_path: "/metrics"
labels:
app.kubernetes.io/name: monitoring-service
app.kubernetes.io/part-of: foxhunt
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
imagePullSecrets:
- name: scw-registry
nodeSelector:
k8s.scaleway.com/pool-name: foxhunt
containers:
- name: monitoring-service
image: rg.fr-par.scw.cloud/foxhunt-ci/foxhunt-runtime:latest
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
command: ["/binaries/monitoring_service"]
ports:
- containerPort: 50057
name: grpc
- containerPort: 9099
name: metrics
env:
- name: PROMETHEUS_URL
value: "http://gitlab-prometheus-server.foxhunt.svc:80"
- name: GRPC_PORT
value: "50057"
- name: METRICS_PORT
value: "9099"
- name: STREAM_INTERVAL_SECS
value: "3"
- name: RUST_LOG
value: info
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://tempo.foxhunt.svc.cluster.local:4317"
volumeMounts:
- name: binaries
mountPath: /binaries
readOnly: true
- name: tmp
mountPath: /tmp
readinessProbe:
tcpSocket:
port: 50057
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 50057
initialDelaySeconds: 10
periodSeconds: 15
failureThreshold: 5
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
volumes:
- name: binaries
persistentVolumeClaim:
claimName: foxhunt-binaries
readOnly: true
- name: tmp
emptyDir:
sizeLimit: 10Mi
---
apiVersion: v1
kind: Service
metadata:
name: monitoring-service
namespace: foxhunt
labels:
app.kubernetes.io/name: monitoring-service
app.kubernetes.io/part-of: foxhunt
spec:
selector:
app.kubernetes.io/name: monitoring-service
ports:
- port: 50057
targetPort: 50057
name: grpc
- port: 9099
targetPort: 9099
name: metrics