apiVersion: apps/v1
kind: Deployment
metadata:
  name: synapse
  namespace: synapse
spec:
  replicas: 1
  selector:
    matchLabels:
      app: synapse
  template:
    metadata:
      labels:
        app: synapse
    spec:
      securityContext:
        fsGroup: 991
      containers:
        - name: synapse
          image: ghcr.io/element-hq/synapse:v1.127.1
          ports:
            - containerPort: 8008
            - containerPort: 9009
          volumeMounts:
            - mountPath: "/data"
              name: synapse-data
            - mountPath: "/data/homeserver.yaml"
              name: synapse-config-file
              subPath: homeserver.yaml
            - mountPath: "/data/matrix.halis.io.log.config"
              name: synapse-log-config-file
              subPath: matrix.halis.io.log.config
            - mountPath: "/data/double-puppeting.yaml"
              name: synapse-secret-doublepuppeting
              subPath: double-puppeting.yaml
            - mountPath: "/data/signal.yaml"
              name: signal-secret-registration
              subPath: signal.yaml
            - mountPath: "/data/telegram.yaml"
              name: telegram-secret-registration
              subPath: telegram.yaml
            - mountPath: "/data/discord.yaml"
              name: discord-secret-registration
              subPath: discord.yaml
            - mountPath: "/data/messenger.yaml"
              name: messenger-secret-registration
              subPath: messenger.yaml
            - mountPath: "/data/instagram.yaml"
              name: instagram-secret-registration
              subPath: instagram.yaml
            - mountPath: "/data/whatsapp.yaml"
              name: whatsapp-secret-registration
              subPath: whatsapp.yaml
      volumes:
        - name: synapse-data
          persistentVolumeClaim:
            claimName: synapse-pvc
        - name: synapse-config-file
          secret:
            secretName: synapse-secret-config
        - name: synapse-log-config-file
          configMap:
            name: synapse-config
        - name: synapse-secret-doublepuppeting
          secret:
            secretName: synapse-secret-doublepuppeting
        - name: signal-secret-registration
          secret:
            secretName: signal-secret-registration
        - name: telegram-secret-registration
          secret:
            secretName: telegram-secret-registration
        - name: discord-secret-registration
          secret:
            secretName: discord-secret-registration
        - name: messenger-secret-registration
          secret:
            secretName: messenger-secret-registration
        - name: instagram-secret-registration
          secret:
            secretName: instagram-secret-registration
        - name: whatsapp-secret-registration
          secret:
            secretName: whatsapp-secret-registration