apiVersion: apps/v1 kind: StatefulSet metadata: name: tclip spec: selector: matchLabels: app: tclip serviceName: tclip replicas: 1 template: metadata: labels: app: tclip spec: volumes: - name: litestream configMap: name: tclip-litestream - name: config configMap: name: tclip initContainers: - name: init-litestream image: litestream/litestream:sha-749bc0d args: ['restore', '-if-db-not-exists', '-if-replica-exists', '-v', '/data/data.db'] volumeMounts: - name: data mountPath: /data - name: litestream mountPath: /etc/litestream.yml subPath: tclip.yml envFrom: - secretRef: name: tclip-litestream-s3 containers: - name: tclip image: git.gmem.ca/arch/tclip:arm imagePullPolicy: Always resources: limits: memory: "128Mi" cpu: "500m" requests: memory: "64Mi" cpu: "100m" envFrom: - secretRef: name: tclip volumeMounts: - name: data mountPath: /data env: - name: DATA_DIR value: /data - name: USE_FUNNEL value: "true" - name: litestream image: litestream/litestream:sha-749bc0d args: ['replicate'] volumeMounts: - name: data mountPath: /data - name: litestream mountPath: /etc/litestream.yml subPath: tclip.yml envFrom: - secretRef: name: tclip-litestream-s3 ports: - name: metrics containerPort: 9090 resources: limits: memory: "128Mi" cpu: "300m" requests: memory: "64Mi" cpu: "100m" volumeClaimTemplates: - metadata: name: data spec: storageClassName: nfs-client accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 1Gi --- apiVersion: v1 kind: Service metadata: name: tclip-metrics annotations: prometheus.io/port: "9090" prometheus.io/scrape: "true" prometheus.io/path: "/metrics" spec: selector: app: tclip ports: - port: 9090 targetPort: 9090 name: litestream-metrics --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: tclip spec: selector: matchLabels: app: tclip endpoints: - port: metrics interval: 30s