cluster

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

deployment.yaml (6829B)


      1 apiVersion: apps/v1
      2 kind: Deployment
      3 metadata:
      4   name: continuwuity
      5 spec:
      6   replicas: 1
      7   selector:
      8     matchLabels:
      9       app: continuwuity
     10   strategy:
     11     type: Recreate
     12   template:
     13     metadata:
     14       labels:
     15         app: continuwuity
     16       annotations:
     17         # Explicit Kopia backup for this hcloud-volume (no CSI snapshots available)
     18         backup.velero.io/backup-volumes: continuwuity-data
     19         # Freeze the process during Velero backup to ensure consistent RocksDB snapshot
     20         pre.hook.backup.velero.io/command: '["/bin/sh", "-c", "kill -STOP 1"]'
     21         pre.hook.backup.velero.io/timeout: "30s"
     22         post.hook.backup.velero.io/command: '["/bin/sh", "-c", "kill -CONT 1"]'
     23         post.hook.backup.velero.io/timeout: "30s"
     24     spec:
     25       automountServiceAccountToken: false
     26       enableServiceLinks: false
     27       securityContext:
     28         fsGroup: 1000
     29       containers:
     30         - name: continuwuity
     31           securityContext:
     32             allowPrivilegeEscalation: false
     33             readOnlyRootFilesystem: true
     34             runAsNonRoot: true
     35             runAsUser: 1000
     36             runAsGroup: 1000
     37             capabilities:
     38               drop:
     39                 - ALL
     40             seccompProfile:
     41               type: RuntimeDefault
     42           resources:
     43             limits:
     44               cpu: "2000m"
     45               memory: "3Gi"
     46             requests:
     47               memory: "1Gi"
     48               cpu: "500m"
     49           image: registry.midnightthoughts.space/mtrnord/cluster/continuwuity:20260428-041716 # {"$imagepolicy": "flux-system:continuwuity"}
     50           #image: forgejo.ellis.link/continuwuation/continuwuity:pr-1099-head
     51           imagePullPolicy: Always
     52           ports:
     53             - containerPort: 8448
     54           # Mount the continuwuity config which is stored in the continuwuity-config secret at the config path and should go to /config.yaml
     55           volumeMounts:
     56             - name: continuwuity-config
     57               mountPath: /etc/conduwuit
     58               readOnly: true
     59             - name: continuwuity-data
     60               mountPath: /var/lib/continuwuity
     61             - name: tmp
     62               mountPath: /tmp
     63           env:
     64             - name: CONTINUWUITY_CONFIG
     65               value: /etc/conduwuit/conduwuit.toml
     66           startupProbe:
     67             httpGet:
     68               path: /_matrix/client/versions
     69               port: 8448
     70             failureThreshold: 60
     71             periodSeconds: 10
     72             timeoutSeconds: 5
     73           livenessProbe:
     74             httpGet:
     75               path: /_matrix/client/versions
     76               port: 8448
     77             timeoutSeconds: 5
     78             failureThreshold: 10
     79           readinessProbe:
     80             httpGet:
     81               path: /_matrix/client/versions
     82               port: 8448
     83             timeoutSeconds: 5
     84       # Mount the continuwuity config which is stored in the continuwuity-config secret at the config path and should go to /config.yaml
     85       volumes:
     86         - name: continuwuity-config
     87           secret:
     88             secretName: continuwuity-config
     89         - name: continuwuity-data
     90           persistentVolumeClaim:
     91             claimName: continuwuity-3
     92         - name: tmp
     93           emptyDir: {}
     94 ---
     95 apiVersion: v1
     96 kind: Service
     97 metadata:
     98   name: continuwuity
     99 spec:
    100   selector:
    101     app: continuwuity
    102   ports:
    103     - name: http
    104       protocol: TCP
    105       port: 8448
    106       targetPort: 8448
    107 ---
    108 apiVersion: gateway.networking.k8s.io/v1
    109 kind: HTTPRoute
    110 metadata:
    111   name: continuwuity
    112   namespace: continuwuity
    113 spec:
    114   parentRefs:
    115     - name: envoy-gateway
    116       namespace: envoy-gateway
    117   hostnames:
    118     - matrix.mtrnord.blog
    119   rules:
    120     - name: client-traffic
    121       matches:
    122         - path:
    123             type: PathPrefix
    124             value: /_matrix/client
    125       backendRefs:
    126         - name: continuwuity
    127           port: 8448
    128       timeouts:
    129         request: 240s
    130         backendRequest: 0s
    131     - name: media-traffic
    132       matches:
    133         - path:
    134             type: PathPrefix
    135             value: /_matrix/media
    136       backendRefs:
    137         - name: continuwuity
    138           port: 8448
    139     - name: federation-traffic
    140       matches:
    141         - path:
    142             type: PathPrefix
    143             value: /_matrix/federation
    144       backendRefs:
    145         - name: continuwuity
    146           port: 8448
    147       timeouts:
    148         request: 240s
    149         backendRequest: 0s
    150     - name: fallback
    151       backendRefs:
    152         - name: continuwuity
    153           port: 8448
    154 ---
    155 apiVersion: gateway.envoyproxy.io/v1alpha1
    156 kind: BackendTrafficPolicy
    157 metadata:
    158   name: continuwuity-general-ratelimit
    159   namespace: continuwuity
    160 spec:
    161   targetRefs:
    162     - group: gateway.networking.k8s.io
    163       kind: HTTPRoute
    164       name: continuwuity
    165   circuitBreaker:
    166     maxConnections: 1500
    167     maxPendingRequests: 300
    168     maxParallelRequests: 700
    169     maxParallelRetries: 50
    170 ## Blocked by https://github.com/envoyproxy/gateway/pull/6888
    171 # ---
    172 # apiVersion: gateway.envoyproxy.io/v1alpha1
    173 # kind: BackendTrafficPolicy
    174 # metadata:
    175 #     name: continuwuity-client-traffic-cb
    176 #     namespace: continuwuity
    177 # spec:
    178 #     targetRefs:
    179 #         - group: gateway.networking.k8s.io
    180 #           kind: HTTPRoute
    181 #           name: continuwuity
    182 #           sectionName: "client-traffic"
    183 #     circuitBreaker:
    184 #         maxConnections: 200
    185 #         maxPendingRequests: 100
    186 #         maxParallelRequests: 150
    187 #         maxParallelRetries: 10
    188 # ---
    189 # apiVersion: gateway.envoyproxy.io/v1alpha1
    190 # kind: BackendTrafficPolicy
    191 # metadata:
    192 #     name: continuwuity-media-traffic-cb
    193 #     namespace: continuwuity
    194 # spec:
    195 #     targetRefs:
    196 #         - group: gateway.networking.k8s.io
    197 #           kind: HTTPRoute
    198 #           name: continuwuity
    199 #           sectionName: "media-traffic"
    200 #     circuitBreaker:
    201 #         maxConnections: 200
    202 #         maxPendingRequests: 200
    203 #         maxParallelRequests: 250
    204 #         maxParallelRetries: 10
    205 # ---
    206 # apiVersion: gateway.envoyproxy.io/v1alpha1
    207 # kind: BackendTrafficPolicy
    208 # metadata:
    209 #     name: continuwuity-federation-traffic-cb
    210 #     namespace: continuwuity
    211 # spec:
    212 #     targetRefs:
    213 #         - group: gateway.networking.k8s.io
    214 #           kind: HTTPRoute
    215 #           name: continuwuity
    216 #           sectionName: "federation-traffic"
    217 #     circuitBreaker:
    218 #         maxConnections: 1500
    219 #         maxPendingRequests: 300
    220 #         maxParallelRequests: 700
    221 #         maxParallelRetries: 50
    222 # ---
    223 # apiVersion: gateway.envoyproxy.io/v1alpha1
    224 # kind: BackendTrafficPolicy
    225 # metadata:
    226 #     name: continuwuity-fallback-traffic-cb
    227 #     namespace: continuwuity
    228 # spec:
    229 #     targetRefs:
    230 #         - group: gateway.networking.k8s.io
    231 #           kind: HTTPRoute
    232 #           name: continuwuity
    233 #           sectionName: "fallback-traffic"
    234 #     circuitBreaker:
    235 #         maxConnections: 50
    236 #         maxPendingRequests: 300
    237 #         maxParallelRequests: 50
    238 #         maxParallelRetries: 50