cluster

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

deployment.yaml (4743B)


      1 apiVersion: v1
      2 kind: PersistentVolumeClaim
      3 metadata:
      4   name: d4all-persistent-storage
      5   namespace: matrix
      6 spec:
      7   accessModes:
      8     - ReadWriteMany
      9   resources:
     10     requests:
     11       storage: 5Gi
     12 ---
     13 apiVersion: apps/v1
     14 kind: Deployment
     15 metadata:
     16   name: draupnir4all
     17   namespace: matrix
     18   labels:
     19     app.kubernetes.io/component: appservice
     20     app.kubernetes.io/instance: main-process
     21     app.kubernetes.io/name: draupnir4all
     22 spec:
     23   strategy:
     24     rollingUpdate:
     25       maxSurge: 25%
     26       maxUnavailable: 25%
     27     type: RollingUpdate
     28   selector:
     29     matchLabels:
     30       app: draupnir4all
     31   template:
     32     metadata:
     33       labels:
     34         app: draupnir4all
     35         app.kubernetes.io/component: appservice
     36         app.kubernetes.io/instance: main-process
     37         app.kubernetes.io/name: draupnir4all
     38     spec:
     39       affinity:
     40         podAntiAffinity:
     41           requiredDuringSchedulingIgnoredDuringExecution:
     42             - labelSelector:
     43                 matchExpressions:
     44                   - key: app
     45                     operator: In
     46                     values:
     47                       - draupnir4all
     48               topologyKey: "kubernetes.io/hostname"
     49       containers:
     50         - name: draupnir4all
     51           #image: gnuxie/draupnir:develop
     52           #imagePullPolicy: Always
     53           image: ghcr.io/mtrnord/draupnir:latest
     54           imagePullPolicy: Always
     55           #   env:
     56           #     - name: TRACING_ENABLED
     57           #       value: "true"
     58           #     - name: TRACING_DIAG_ENABLED
     59           #       value: "false"
     60           #     - name: TRACING_DIAG_VERBOSE
     61           #       value: "true"
     62           #     - name: TRACING_TRACE_URL
     63           #       value: http://tempo.monitoring.svc.cluster.local:4318/v1/traces
     64           #     - name: TRACING_METRIC_URL
     65           #       value: http://tempo.monitoring.svc.cluster.local:4318/v1/metrics
     66           env:
     67             - name: NODE_OPTIONS
     68               value: "--trace-warnings"
     69           command: ["./draupnir-entrypoint.sh"]
     70           args: ["appservice", "-c", "/data/config/config.appservice.yaml", "-f", "/data/config/draupnir-registration.yaml", "--draupnir-config", "/data/config/draupnir-config.yaml", "-p", "9000"]
     71           resources:
     72             limits: {}
     73             requests:
     74               memory: "344Mi"
     75               cpu: "252m"
     76           securityContext:
     77             runAsUser: 1000
     78             runAsGroup: 1000
     79             readOnlyRootFilesystem: true
     80           ports:
     81             - containerPort: 9001
     82               name: api
     83               protocol: TCP
     84             - containerPort: 9000
     85               name: appservice
     86               protocol: TCP
     87           volumeMounts:
     88             - name: configs
     89               mountPath: "/data/config"
     90               readOnly: true
     91             - mountPath: /data/storage
     92               name: storage
     93             - mountPath: /tmp
     94               name: tmp
     95           livenessProbe:
     96             httpGet:
     97               path: /healthz
     98               port: appservice
     99               scheme: HTTP
    100             initialDelaySeconds: 15
    101             periodSeconds: 10
    102           startupProbe:
    103             httpGet:
    104               path: /healthz
    105               port: appservice
    106             initialDelaySeconds: 15
    107             failureThreshold: 30
    108             periodSeconds: 10
    109         - name: draupnir4all-web
    110           image: ghcr.io/mtrnord/draupnir4all-web:latest
    111           imagePullPolicy: Always
    112           env:
    113             - name: SESSION_SECRET
    114               valueFrom:
    115                 secretKeyRef:
    116                   name: draupnir4all-web
    117                   key: session-secret
    118             - name: D4ALL_INSTANCE_ADDRESS
    119               value: "http://localhost:9001"
    120           resources:
    121             limits: {}
    122             requests:
    123               memory: "344Mi"
    124               cpu: "252m"
    125           securityContext:
    126             runAsUser: 1000
    127             runAsGroup: 1000
    128             readOnlyRootFilesystem: true
    129           ports:
    130             - containerPort: 3000
    131               name: web
    132               protocol: TCP
    133           volumeMounts:
    134             - mountPath: /tmp
    135               name: tmp
    136           livenessProbe:
    137             httpGet:
    138               path: /
    139               port: web
    140               scheme: HTTP
    141             initialDelaySeconds: 15
    142             periodSeconds: 10
    143           startupProbe:
    144             httpGet:
    145               path: /
    146               port: web
    147             initialDelaySeconds: 15
    148             failureThreshold: 30
    149             periodSeconds: 10
    150       volumes:
    151         - name: configs
    152           secret:
    153             secretName: draupnir-appservice
    154         - name: storage
    155           persistentVolumeClaim:
    156             claimName: d4all-persistent-storage
    157         - name: tmp
    158           emptyDir:
    159             sizeLimit: 2048Mi