apiVersion: apps/v1
kind: StatefulSet
metadata:
  annotations:
    a8r.io/repository: ssh://git@git.tr1ceracop.de:222/gitea_admin/k8s-and-chill.git
  labels:
    app: server
    app.kubernetes.io/instance: victoria-metrics-single
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: victoria-metrics-single
    app.kubernetes.io/version: v1.138.0
    helm.sh/chart: victoria-metrics-single-0.33.0
  name: victoria-metrics-single-server
  namespace: monitoring
spec:
  podManagementPolicy: OrderedReady
  replicas: 1
  selector:
    matchLabels:
      app: server
      app.kubernetes.io/instance: victoria-metrics-single
      app.kubernetes.io/name: victoria-metrics-single
  serviceName: victoria-metrics-single-server
  template:
    metadata:
      labels:
        app: server
        app.kubernetes.io/instance: victoria-metrics-single
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: victoria-metrics-single
        app.kubernetes.io/version: v1.138.0
        helm.sh/chart: victoria-metrics-single-0.33.0
    spec:
      automountServiceAccountToken: true
      containers:
        - args:
            - --envflag.enable
            - --envflag.prefix=VM_
            - --httpListenAddr=:8428
            - --loggerFormat=json
            - --promscrape.config=/scrapeconfig/scrape.yml
            - --retentionPeriod=1
            - --storageDataPath=/storage
          image: victoriametrics/victoria-metrics:v1.138.0
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 10
            initialDelaySeconds: 30
            periodSeconds: 30
            tcpSocket:
              port: http
            timeoutSeconds: 5
          name: vmsingle
          ports:
            - containerPort: 8428
              name: http
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 15
            timeoutSeconds: 5
          resources:
            limits:
              memory: 512Mi
            requests:
              cpu: 100m
              memory: 256Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
          volumeMounts:
            - mountPath: /storage
              name: server-volume
            - mountPath: /scrapeconfig
              name: scrapeconfig
      securityContext:
        fsGroup: 1000
        runAsGroup: 1000
        runAsNonRoot: true
        runAsUser: 1000
        seccompProfile:
          type: RuntimeDefault
      serviceAccountName: victoria-metrics-single-server
      terminationGracePeriodSeconds: 60
      volumes:
        - configMap:
            name: victoria-metrics-single-server-scrapeconfig
          name: scrapeconfig
  updateStrategy: {}
  volumeClaimTemplates:
    - apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: server-volume
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
        storageClassName: standard
