# services/maintenance/vault-sync-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: maintenance-vault-sync
  namespace: maintenance
spec:
  replicas: 1
  selector:
    matchLabels:
      app: maintenance-vault-sync
  template:
    metadata:
      labels:
        app: maintenance-vault-sync
      annotations:
        maintenance.bstein.dev/restart-at: "2026-04-13T05:57:00Z"
    spec:
      nodeSelector:
        node-role.kubernetes.io/worker: "true"
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/hostname
                    operator: NotIn
                    values: ["titan-13", "titan-15", "titan-17", "titan-19"]
      serviceAccountName: maintenance-vault-sync
      containers:
        - name: sync
          image: alpine:3.20
          command: ["/bin/sh", "-c"]
          args:
            - "sleep infinity"
          volumeMounts:
            - name: vault-secrets
              mountPath: /vault/secrets
              readOnly: true
      volumes:
        - name: vault-secrets
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: maintenance-vault
