apiVersion: apps/v1
kind: Deployment
metadata:
  name: semaphore-service-mirror
  labels:
    app: semaphore-service-mirror
spec:
  replicas: 1
  selector:
    matchLabels:
      app: semaphore-service-mirror
  template:
    metadata:
      labels:
        app: semaphore-service-mirror
    spec:
      serviceAccountName: semaphore-service-mirror
      containers:
        - name: semaphore-service-mirror
          image: semaphore-service-mirror
          env:
            - name: SSM_CONFIG
              value: "/etc/semaphore-service-mirror/config.json"
          volumeMounts:
            - name: token
              mountPath: /etc/semaphore-service-mirror/tokens/c1
              readOnly: true
            - name: config
              mountPath: /etc/semaphore-service-mirror/
          ports:
            - name: readiness-port
              containerPort: 8080
          livenessProbe:
            httpGet:
              path: /healthz
              port: readiness-port
            periodSeconds: 10
            failureThreshold: 6
            initialDelaySeconds: 30
            successThreshold: 1
            timeoutSeconds: 1
      volumes:
        - name: token
          secret:
            secretName: service-mirror-token
        - name: config
          configMap:
            name: semaphore-service-mirror-config
