98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
# services/quality/sonarqube-exporter-deployment.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: sonarqube-exporter
|
|
namespace: quality
|
|
labels:
|
|
app: sonarqube-exporter
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: sonarqube-exporter
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: sonarqube-exporter
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/port: "9798"
|
|
prometheus.io/path: /metrics
|
|
spec:
|
|
nodeSelector:
|
|
node-role.kubernetes.io/worker: "true"
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/arch
|
|
operator: In
|
|
values: ["arm64"]
|
|
- key: hardware
|
|
operator: In
|
|
values: ["rpi5"]
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
preference:
|
|
matchExpressions:
|
|
- key: hardware
|
|
operator: In
|
|
values: ["rpi5"]
|
|
containers:
|
|
- name: exporter
|
|
image: python:3.12-slim
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/sh
|
|
- -ec
|
|
args:
|
|
- |
|
|
cp /config/exporter.py /app/exporter.py
|
|
python /app/exporter.py
|
|
env:
|
|
- name: SONARQUBE_URL
|
|
value: http://sonarqube.quality.svc.cluster.local:9000
|
|
- name: SONARQUBE_EXPORTER_PORT
|
|
value: "9798"
|
|
- name: SONARQUBE_EXPORTER_CACHE_TTL_SECONDS
|
|
value: "45"
|
|
- name: SONARQUBE_PROJECT_LIMIT
|
|
value: "250"
|
|
ports:
|
|
- name: metrics
|
|
containerPort: 9798
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /-/healthy
|
|
port: 9798
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /-/healthy
|
|
port: 9798
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 20
|
|
resources:
|
|
requests:
|
|
cpu: 25m
|
|
memory: 96Mi
|
|
limits:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
volumeMounts:
|
|
- name: exporter-script
|
|
mountPath: /config
|
|
readOnly: true
|
|
- name: app-tmp
|
|
mountPath: /app
|
|
volumes:
|
|
- name: exporter-script
|
|
configMap:
|
|
name: sonarqube-exporter-script
|
|
defaultMode: 493
|
|
- name: app-tmp
|
|
emptyDir: {}
|