commit bf81f4080c837ce8b8a3ba01ecf9fd4d5cd9f0f9
parent b5e66727726afc0b9e6b37cd88aecb51317726dc
Author: MTRNord <MTRNord@users.noreply.github.com>
Date: Mon, 30 Jun 2025 11:41:09 +0200
Deploy a stage deployment
Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>
Diffstat:
5 files changed, 257 insertions(+), 89 deletions(-)
diff --git a/apps/base/envoy-gateway/release.yaml b/apps/base/envoy-gateway/release.yaml
@@ -574,6 +574,18 @@ spec:
certificateRefs:
- kind: Secret
name: api.connectivity-tester.mtrnord.blog-tls
+ - name: https-stage-connectivity-tester-mtrnord-blog
+ protocol: HTTPS
+ hostname: "stage.connectivity-tester.mtrnord.blog"
+ port: 443
+ allowedRoutes:
+ namespaces:
+ from: "All"
+ tls:
+ mode: Terminate
+ certificateRefs:
+ - kind: Secret
+ name: stage.connectivity-tester.mtrnord.blog-tls
- name: https-connectivity-tester-mtrnord-blog
protocol: HTTPS
hostname: "connectivity-tester.mtrnord.blog"
diff --git a/apps/base/matrix/connectivity-tester/deployment.yaml b/apps/base/matrix/connectivity-tester/deployment.yaml
@@ -1,4 +1,3 @@
----
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -22,11 +21,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
@@ -36,48 +35,48 @@ spec:
image: ghcr.io/mtrnord/matrix-connection-tester-ui:main
imagePullPolicy: Always
lifecycle:
- preStop:
- exec:
- command:
- - sleep
- - "10"
+ 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
+ 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: apps/v1
kind: Deployment
@@ -102,11 +101,11 @@ spec:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - connectivity-tester-api
+ matchExpressions:
+ - key: app
+ operator: In
+ values:
+ - connectivity-tester-api
topologyKey: "kubernetes.io/hostname"
imagePullSecrets:
- name: ghcr-pull
@@ -116,32 +115,32 @@ spec:
image: ghcr.io/mtrnord/rust-federation-tester:v0.1.0
imagePullPolicy: IfNotPresent
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
+ 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
---
apiVersion: flagger.app/v1beta1
kind: MetricTemplate
@@ -242,18 +241,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: 2
+ max: 2
interval: 1m
- name: latency
templateRef:
- name: connectivity-tester-latency
- namespace: matrix
+ name: connectivity-tester-latency
+ namespace: matrix
# seconds
thresholdRange:
- max: 1
+ max: 1
interval: 30s
sessionAffinity:
cookieName: flagger-cookie
@@ -264,13 +263,13 @@ spec:
url: http://flagger-loadtester.flagger-system/
timeout: 15s
metadata:
- type: bash
- cmd: "curl -s http://connectivity-tester-canary.matrix:3000"
+ type: bash
+ cmd: "curl -s http://connectivity-tester-canary.matrix:3000"
- name: load-test
url: http://flagger-loadtester.flagger-system/
timeout: 10m
metadata:
- cmd: "hey -z 10m -q 10 -c 2 http://connectivity-tester-canary.matrix/?serverName=mtrnord.blog"
+ cmd: "hey -z 10m -q 10 -c 2 http://connectivity-tester-canary.matrix/?serverName=mtrnord.blog"
---
apiVersion: flagger.app/v1beta1
kind: Canary
@@ -323,18 +322,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: 2
+ max: 2
interval: 1m
- name: latency
templateRef:
- name: connectivity-tester-latency
- namespace: matrix
+ name: connectivity-tester-latency
+ namespace: matrix
# seconds
thresholdRange:
- max: 1
+ max: 1
interval: 30s
sessionAffinity:
cookieName: flagger-cookie
@@ -345,10 +344,10 @@ spec:
url: http://flagger-loadtester.flagger-system/
timeout: 15s
metadata:
- type: bash
- cmd: "curl -s http://connectivity-tester-api.matrix-canary:8080/healthz | grep 'OK'"
+ type: bash
+ cmd: "curl -s http://connectivity-tester-api.matrix-canary:8080/healthz | grep 'OK'"
- name: load-test
url: http://flagger-loadtester.flagger-system/
timeout: 10m
metadata:
- cmd: "hey -z 10m -q 10 -c 2 http://connectivity-tester-api-canary.matrix/api/federation-ok?serverName=mtrnord.blog&no_cache=true"
+ cmd: "hey -z 10m -q 10 -c 2 http://connectivity-tester-api-canary.matrix/api/federation-ok?serverName=mtrnord.blog&no_cache=true"
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
@@ -12,12 +12,12 @@ spec:
- federationtester.mtrnord.blog
rules:
- matches:
- - path:
- value: /api
- type: PathPrefix
+ - path:
+ value: /api
+ type: PathPrefix
backendRefs:
- - name: connectivity-tester-api-primary
- port: 8080
+ - name: connectivity-tester-api-primary
+ port: 8080
timeouts:
- request: 240s
- backendRequest: 0s
+ request: 240s
+ backendRequest: 0s
diff --git a/apps/base/matrix/connectivity-tester/staging_deployment.yaml b/apps/base/matrix/connectivity-tester/staging_deployment.yaml
@@ -0,0 +1,157 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: connectivity-tester-stage
+ namespace: matrix
+spec:
+ progressDeadlineSeconds: 120
+ strategy:
+ rollingUpdate:
+ maxUnavailable: 0
+ type: RollingUpdate
+ selector:
+ matchLabels:
+ app: connectivity-tester-stage
+ template:
+ metadata:
+ labels:
+ app: connectivity-tester-stage
+ spec:
+ affinity:
+ podAntiAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ - labelSelector:
+ matchExpressions:
+ - key: app
+ operator: In
+ values:
+ - connectivity-tester-stage
+ topologyKey: "kubernetes.io/hostname"
+ imagePullSecrets:
+ - name: ghcr-pull
+ hostNetwork: true
+ containers:
+ - name: federation-tester-api
+ image: ghcr.io/mtrnord/rust-federation-tester:main
+ imagePullPolicy: Always
+ resources:
+ limits: {}
+ requests:
+ memory: "344Mi"
+ cpu: "252m"
+ securityContext:
+ runAsUser: 1000
+ runAsGroup: 1000
+ readOnlyRootFilesystem: true
+ ports:
+ - containerPort: 8080
+ hostPort: 8081
+ name: api
+ protocol: TCP
+ readinessProbe:
+ httpGet:
+ path: /healthz
+ port: api
+ scheme: HTTP
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: api
+ scheme: HTTP
+ startupProbe:
+ 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"
+ ports:
+ - containerPort: 3000
+ hostPort: 3001
+ name: web
+ protocol: TCP
+ volumeMounts:
+ - 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
+ readinessProbe:
+ httpGet:
+ path: /
+ port: web
+ scheme: HTTP
+ startupProbe:
+ httpGet:
+ path: /
+ port: web
+ volumes:
+ - name: configs
+ configMap:
+ name: connectivity-tester-config
+ - name: tmp
+ emptyDir:
+ sizeLimit: 2048Mi
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: connectivity-tester-stage
+spec:
+ selector:
+ app: connectivity-tester-stage
+ ports:
+ - port: 8080
+ targetPort: 8081
+ - port: 3000
+ targetPort: 3001
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+ name: connectivity-tester-stage
+ namespace: matrix
+spec:
+ parentRefs:
+ - name: envoy-gateway
+ namespace: envoy-gateway
+ hostnames:
+ - stage.connectivity-tester.mtrnord.blog
+ rules:
+ - matches:
+ - path:
+ value: /api
+ type: PathPrefix
+ backendRefs:
+ - name: connectivity-tester-stage
+ port: 8080
+ timeouts:
+ request: 240s
+ backendRequest: 0s
+ - matches:
+ - path:
+ value: /
+ type: PathPrefix
+ backendRefs:
+ - name: connectivity-tester-stage
+ port: 3000
+ timeouts:
+ request: 240s
+ backendRequest: 0s