cluster

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

mas_deployment.yaml (3062B)


      1 apiVersion: apps/v1
      2 kind: Deployment
      3 metadata:
      4   name: mas
      5 spec:
      6   replicas: 0
      7   strategy:
      8     rollingUpdate:
      9       maxSurge: 25%
     10       maxUnavailable: 25%
     11     type: RollingUpdate
     12   selector:
     13     matchLabels:
     14       app: mas
     15   template:
     16     metadata:
     17       labels:
     18         app: mas
     19     spec:
     20       affinity:
     21         podAntiAffinity:
     22           requiredDuringSchedulingIgnoredDuringExecution:
     23             - labelSelector:
     24                 matchExpressions:
     25                   - key: app
     26                     operator: In
     27                     values:
     28                       - mas
     29               topologyKey: "kubernetes.io/hostname"
     30       containers:
     31         - name: mas
     32           resources:
     33             limits: {}
     34             requests:
     35               memory: "100Mi"
     36               cpu: "28m"
     37           image: ghcr.io/element-hq/matrix-authentication-service:0.15.0
     38           # Normal mode
     39           args: ["server"]
     40           #args: [ "help" ]
     41           ports:
     42             - containerPort: 8080
     43             - containerPort: 8081
     44           # Mount the mas config which is stored in the mas-config secret at the config path and should go to /config.yaml
     45           volumeMounts:
     46             - name: mas-config
     47               mountPath: /config.yaml
     48               subPath: config
     49           # Set MAS_CONIG env variable to the path of the config file
     50           env:
     51             - name: MAS_CONFIG
     52               value: /config.yaml
     53       initContainers:
     54         - name: mas-config
     55           image: ghcr.io/element-hq/matrix-authentication-service:0.15.0
     56           imagePullPolicy: Always
     57           # Sync config
     58           args: ["config", "sync"]
     59           # Mount the mas config which is stored in the mas-config secret at the config path and should go to /config.yaml
     60           volumeMounts:
     61             - name: mas-config
     62               mountPath: /config.yaml
     63               subPath: config
     64           # Set MAS_CONIG env variable to the path of the config file
     65           env:
     66             - name: MAS_CONFIG
     67               value: /config.yaml
     68       livenessProbe:
     69         httpGet:
     70           path: /health
     71           port: 8081
     72         initialDelaySeconds: 10
     73         timeoutSeconds: 5
     74       readinessProbe:
     75         httpGet:
     76           path: /health
     77           port: 8081
     78         initialDelaySeconds: 10
     79         timeoutSeconds: 5
     80       # Mount the mas config which is stored in the mas-config secret at the config path and should go to /config.yaml
     81       volumes:
     82         - name: mas-config
     83           secret:
     84             secretName: mas-config
     85 ---
     86 apiVersion: v1
     87 kind: Service
     88 metadata:
     89   name: mas
     90 spec:
     91   selector:
     92     app: mas
     93   ports:
     94     - name: http
     95       protocol: TCP
     96       port: 8080
     97       targetPort: 8080
     98 ---
     99 apiVersion: gateway.networking.k8s.io/v1
    100 kind: HTTPRoute
    101 metadata:
    102   name: mas
    103   namespace: matrix
    104 spec:
    105   parentRefs:
    106     - name: envoy-gateway
    107       namespace: envoy-gateway
    108   hostnames:
    109     - mas.matrix.midnightthoughts.space
    110   rules:
    111     - backendRefs:
    112         - name: mas
    113           port: 8080
    114       timeouts:
    115         request: 240s
    116         backendRequest: 0s