cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

commit 8ec04145d3fbd2581314d0b831b2e737a03440a9
parent a455042fc7d554ba98b20beb800f584fdb7ac4a7
Author: MTRNord <MTRNord@users.noreply.github.com>
Date:   Sat, 28 Jun 2025 20:41:12 +0200

Adjust the canary deployment a bit

Diffstat:
Mapps/base/matrix/connectivity-tester/deployment.yaml | 132+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
Mapps/base/matrix/connectivity-tester/kustomization.yaml | 2+-
Mapps/base/matrix/connectivity-tester/service.yaml | 14+++++++-------
Mapps/base/victoria-metrics-k8s-stack/dashboards/kustomization.yaml | 58+++++++++++++++++++++++++++++-----------------------------
Mapps/base/victoria-metrics-k8s-stack/pg_dashboard_configmap.yaml | 3+--
5 files changed, 114 insertions(+), 95 deletions(-)

diff --git a/apps/base/matrix/connectivity-tester/deployment.yaml b/apps/base/matrix/connectivity-tester/deployment.yaml @@ -1,14 +1,13 @@ ---- apiVersion: apps/v1 kind: Deployment metadata: name: connectivity-tester namespace: matrix spec: + progressDeadlineSeconds: 120 strategy: rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% + maxUnavailable: 0 type: RollingUpdate selector: matchLabels: @@ -21,11 +20,11 @@ spec: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - connectivity-tester + matchExpressions: + - key: app + operator: In + values: + - connectivity-tester topologyKey: "kubernetes.io/hostname" imagePullSecrets: - name: ghcr-pull @@ -35,62 +34,78 @@ spec: image: ghcr.io/mtrnord/rust-federation-tester:main imagePullPolicy: Always resources: - limits: {} - requests: - memory: "344Mi" - cpu: "252m" + limits: {} + requests: + memory: "344Mi" + cpu: "252m" securityContext: - runAsUser: 1000 - runAsGroup: 1000 - readOnlyRootFilesystem: true + runAsUser: 1000 + runAsGroup: 1000 + readOnlyRootFilesystem: true ports: - - containerPort: 8080 - name: api - protocol: TCP + - containerPort: 8080 + name: api + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: api + scheme: HTTP livenessProbe: - httpGet: - path: /healthz - port: api - scheme: HTTP + httpGet: + path: /healthz + port: api + scheme: HTTP startupProbe: - httpGet: - path: /healthz - port: api + httpGet: + path: /healthz + port: api - name: connection-checker-ui image: ghcr.io/mtrnord/matrix-connection-tester-ui:main imagePullPolicy: Always + lifecycle: + preStop: + exec: + command: + - sleep + - "10" resources: - limits: {} - requests: - memory: "344Mi" - cpu: "252m" + limits: {} + requests: + memory: "344Mi" + cpu: "252m" ports: - - containerPort: 3000 - name: web - protocol: TCP + - containerPort: 3000 + name: web + protocol: TCP volumeMounts: - - name: configs - mountPath: "/usr/share/nginx/html/config.json" - subPath: config.json - readOnly: true - - mountPath: /tmp - name: tmp + - name: configs + mountPath: "/usr/share/nginx/html/config.json" + subPath: config.json + readOnly: true + - mountPath: /tmp + name: tmp livenessProbe: - httpGet: - path: / - port: web - scheme: HTTP + httpGet: + path: / + port: web + scheme: HTTP + readinessProbe: + httpGet: + path: / + port: web + scheme: HTTP startupProbe: - httpGet: - path: / - port: web + httpGet: + path: / + port: web volumes: - name: configs configMap: - name: connectivity-tester-config + name: connectivity-tester-config - name: tmp emptyDir: - sizeLimit: 2048Mi + sizeLimit: 2048Mi --- apiVersion: flagger.app/v1beta1 kind: MetricTemplate @@ -172,6 +187,10 @@ spec: gatewayRefs: - name: envoy-gateway namespace: envoy-gateway + retries: + attempts: 10 + perTryTimeout: 5s + retryOn: "gateway-error,connect-failure,refused-stream" analysis: # schedule interval (default 60s) interval: 1m @@ -188,18 +207,18 @@ spec: # max error rate (5xx responses) # percentage (0-100) templateRef: - name: connectivity-tester-error-rate - namespace: matrix + name: connectivity-tester-error-rate + namespace: matrix thresholdRange: - max: 1 + max: 1 interval: 1m - name: latency templateRef: - name: connectivity-tester-latency - namespace: matrix + name: connectivity-tester-latency + namespace: matrix # seconds thresholdRange: - max: 0.5 + max: 0.5 interval: 30s # testing (optional) webhooks: @@ -208,10 +227,11 @@ spec: url: http://flagger-loadtester.flagger-system/ timeout: 15s metadata: - type: bash - cmd: "curl -s http://connectivity-tester.matrix:3000 && curl -s http://connectivity-tester.matrix:8080/healthz | grep 'OK'" + type: bash + cmd: "curl -s http://connectivity-tester.matrix:3000 && curl -s http://connectivity-tester.matrix:8080/healthz + | grep 'OK'" - name: load-test url: http://flagger-loadtester.flagger-system/ timeout: 5s metadata: - cmd: "hey -z 2m -q 10 -c 2 -host connectivity-tester.mtrnord.blog http://connectivity-tester.matrix:3000/" + cmd: "hey -z 2m -q 10 -c 2 -host connectivity-tester.mtrnord.blog http://connectivity-tester.matrix:3000/" diff --git a/apps/base/matrix/connectivity-tester/kustomization.yaml b/apps/base/matrix/connectivity-tester/kustomization.yaml @@ -8,4 +8,4 @@ configMapGenerator: - name: connectivity-tester-config namespace: matrix files: - - config.json=config.json + - config.json=config.json diff --git a/apps/base/matrix/connectivity-tester/service.yaml b/apps/base/matrix/connectivity-tester/service.yaml @@ -28,12 +28,12 @@ spec: - federationtester.mtrnord.blog rules: - matches: - - path: - value: /api - type: PathPrefix + - path: + value: /api + type: PathPrefix backendRefs: - - name: connectivity-tester - port: 8080 + - name: connectivity-tester + port: 8080 timeouts: - request: 240s - backendRequest: 0s + request: 240s + backendRequest: 0s diff --git a/apps/base/victoria-metrics-k8s-stack/dashboards/kustomization.yaml b/apps/base/victoria-metrics-k8s-stack/dashboards/kustomization.yaml @@ -5,45 +5,45 @@ configMapGenerator: - name: grafana-dashboards-matrix namespace: monitoring files: - - draupnir4all_status.json=draupnir4all_status.json - - synapse.json=synapse.json + - draupnir4all_status.json=draupnir4all_status.json + - synapse.json=synapse.json options: - labels: - grafana_dashboard: "1" - annotations: - grafana_folder: Matrix + labels: + grafana_dashboard: "1" + annotations: + grafana_folder: Matrix - name: grafana-dashboards-flux namespace: monitoring files: - - flux-control-plane-dashboard.json=flux-control-plane-dashboard.json - - flux-cluster-dashboard.json=flux-cluster-dashboard.json - - flux-logs-dashboard.json=flux-logs-dashboard.json - - flagger.json=flagger.json + - flux-control-plane-dashboard.json=flux-control-plane-dashboard.json + - flux-cluster-dashboard.json=flux-cluster-dashboard.json + - flux-logs-dashboard.json=flux-logs-dashboard.json + - flagger.json=flagger.json options: - labels: - grafana_dashboard: "1" - annotations: - grafana_folder: Flux + labels: + grafana_dashboard: "1" + annotations: + grafana_folder: Flux - name: grafana-dashboards-ceph namespace: monitoring files: - - ceph-cluster-dashboard.json=ceph-cluster-dashboard.json - - ceph-osd-single-dashboard.json=ceph-osd-single-dashboard.json - - ceph-pools-dashboard.json=ceph-pools-dashboard.json + - ceph-cluster-dashboard.json=ceph-cluster-dashboard.json + - ceph-osd-single-dashboard.json=ceph-osd-single-dashboard.json + - ceph-pools-dashboard.json=ceph-pools-dashboard.json options: - labels: - grafana_dashboard: "1" - annotations: - grafana_folder: Ceph + labels: + grafana_dashboard: "1" + annotations: + grafana_folder: Ceph - name: grafana-dashboards-envoy namespace: monitoring files: - - envoy-clusters.json=envoy-clusters.json - - envoy-gateway-global.json=envoy-gateway-global.json - - envoy-proxy-global.json=envoy-proxy-global.json - - global-ratelimit.json=global-ratelimit.json + - envoy-clusters.json=envoy-clusters.json + - envoy-gateway-global.json=envoy-gateway-global.json + - envoy-proxy-global.json=envoy-proxy-global.json + - global-ratelimit.json=global-ratelimit.json options: - labels: - grafana_dashboard: "1" - annotations: - grafana_folder: Envoy + labels: + grafana_dashboard: "1" + annotations: + grafana_folder: Envoy diff --git a/apps/base/victoria-metrics-k8s-stack/pg_dashboard_configmap.yaml b/apps/base/victoria-metrics-k8s-stack/pg_dashboard_configmap.yaml @@ -7,8 +7,7 @@ metadata: annotations: grafana_folder: Postgres data: - postgres.json: - "{\n\"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana + postgres.json: "{\n\"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n},\n\"description\": \"Performance metrics for Postgres\",\n\"editable\": true,\n\"gnetId\": 455,\n\"graphTooltip\": 0,\n\"id\": 1,\n\"iteration\": 1603191461722,\n\"links\":