apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    meta.helm.sh/release-name: staffeln
    meta.helm.sh/release-namespace: openstack
    openstackhelm.openstack.org/release_uuid: ""
  creationTimestamp: "2026-04-07T15:38:43Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
    application: staffeln
    component: api
    release_group: staffeln
  name: staffeln-api
  namespace: openstack
  resourceVersion: "10352"
  uid: c1b8bdc9-d3f5-46f9-95c6-592f4e47265e
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      application: staffeln
      component: api
      release_group: staffeln
  strategy:
    rollingUpdate:
      maxSurge: 3
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations:
        configmap-bin-hash: b3f4f73275255f12624ed24bea6af0cba303b560549383a082efe21750e864ce
        configmap-etc-hash: 53305ea1839708910a613c044c60685ab1d6e9566eea655931c7199c75757028
        openstackhelm.openstack.org/release_uuid: ""
      creationTimestamp: null
      labels:
        application: staffeln
        component: api
        release_group: staffeln
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: release_group
                  operator: In
                  values:
                  - staffeln
                - key: application
                  operator: In
                  values:
                  - staffeln
                - key: component
                  operator: In
                  values:
                  - api
              topologyKey: kubernetes.io/hostname
            weight: 10
      containers:
      - command:
        - /tmp/staffeln-api.sh
        - start
        image: harbor.atmosphere.dev/ghcr.io/vexxhost/staffeln:latest@sha256:ff76e0c282c9a4bbdb0656353fb3e32e94fb2b9e50f69bf63262dd81fee24c4b
        imagePullPolicy: IfNotPresent
        lifecycle:
          preStop:
            exec:
              command:
              - /tmp/staffeln-api.sh
              - stop
        name: staffeln-api
        ports:
        - containerPort: 8808
          name: s-api
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /v1/health
            port: 8808
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp
          name: pod-tmp
        - mountPath: /var/lib/staffeln
          name: state-tmp
        - mountPath: /etc/staffeln
          name: etcstaffeln
        - mountPath: /etc/staffeln/staffeln.conf
          name: staffeln-etc
          readOnly: true
          subPath: staffeln.conf
        - mountPath: /tmp/staffeln-api.sh
          name: staffeln-bin
          readOnly: true
          subPath: staffeln-api.sh
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - kubernetes-entrypoint
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: INTERFACE_NAME
          value: eth0
        - name: PATH
          value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
        - name: DEPENDENCY_SERVICE
          value: openstack:percona-xtradb-haproxy,openstack:keystone-api
        - name: DEPENDENCY_JOBS
          value: staffeln-db-sync
        - name: DEPENDENCY_DAEMONSET
        - name: DEPENDENCY_CONTAINER
        - name: DEPENDENCY_POD_JSON
        - name: DEPENDENCY_CUSTOM_RESOURCE
        image: harbor.atmosphere.dev/ghcr.io/vexxhost/kubernetes-entrypoint:edge@sha256:8921b64b87af184a1421dd856b2703bcf3cff9f50863cd0d18371cf964a87bd3
        imagePullPolicy: IfNotPresent
        name: init
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsUser: 65534
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      nodeSelector:
        openstack-control-plane: enabled
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        runAsUser: 42424
      serviceAccount: staffeln-api
      serviceAccountName: staffeln-api
      terminationGracePeriodSeconds: 30
      volumes:
      - emptyDir: {}
        name: pod-tmp
      - emptyDir: {}
        name: state-tmp
      - emptyDir: {}
        name: etcstaffeln
      - name: staffeln-etc
        secret:
          defaultMode: 292
          secretName: staffeln-etc
      - configMap:
          defaultMode: 365
          name: staffeln-bin
        name: staffeln-bin
status:
  conditions:
  - lastTransitionTime: "2026-04-07T15:38:43Z"
    lastUpdateTime: "2026-04-07T15:38:43Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2026-04-07T15:38:43Z"
    lastUpdateTime: "2026-04-07T15:38:43Z"
    message: ReplicaSet "staffeln-api-f57f9ffc" is progressing.
    reason: ReplicaSetUpdated
    status: "True"
    type: Progressing
  observedGeneration: 1
  replicas: 1
  unavailableReplicas: 1
  updatedReplicas: 1
