apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: "2026-04-04T02:19:56Z"
  generation: 1
  labels:
    app.kubernetes.io/component: rabbitmq
    app.kubernetes.io/name: notifications-rabbitmq
    app.kubernetes.io/part-of: rabbitmq
  name: notifications-rabbitmq-server
  namespace: openstack
  ownerReferences:
  - apiVersion: rabbitmq.com/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: RabbitmqCluster
    name: notifications-rabbitmq
    uid: 7f46b4bb-9717-4249-a318-a71756976c05
  resourceVersion: "45611"
  uid: 5b6aecac-e477-4a35-89b0-c6adbfd1c0ec
spec:
  persistentVolumeClaimRetentionPolicy:
    whenDeleted: Retain
    whenScaled: Retain
  podManagementPolicy: Parallel
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/name: notifications-rabbitmq
  serviceName: notifications-rabbitmq-nodes
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: rabbitmq
        app.kubernetes.io/name: notifications-rabbitmq
        app.kubernetes.io/part-of: rabbitmq
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - notifications-rabbitmq
              topologyKey: kubernetes.io/hostname
            weight: 100
      automountServiceAccountToken: true
      containers:
      - args:
        - /usr/lib/rabbitmq/bin/rabbitmq-server
        env:
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: K8S_SERVICE_NAME
          value: notifications-rabbitmq-nodes
        - name: RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS
          value: '-kernel inetrc ''/etc/rabbitmq/erl_inetrc'' -proto_dist inet_tls
            -ssl_dist_optfile /etc/rabbitmq/inter-node-tls.config '
        - name: RABBITMQ_CTL_ERL_ARGS
          value: -proto_dist inet_tls -ssl_dist_optfile /etc/rabbitmq/inter-node-tls.config
        - name: RABBITMQ_UPGRADE_LOG
          value: /var/lib/rabbitmq/rabbitmq_upgrade.log
        - name: HOME
          value: /var/lib/rabbitmq
        - name: PATH
          value: /usr/lib/rabbitmq/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        - name: RABBITMQ_ENABLED_PLUGINS_FILE
          value: /operator/enabled_plugins
        - name: RABBITMQ_USE_LONGNAME
          value: "true"
        - name: RABBITMQ_NODENAME
          value: rabbit@$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE)
        - name: K8S_HOSTNAME_SUFFIX
          value: .$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE)
        image: 38.102.83.110:5001/podified-master-centos10/openstack-rabbitmq:watcher_latest
        imagePullPolicy: IfNotPresent
        lifecycle:
          preStop:
            exec:
              command:
              - /bin/bash
              - -c
              - if [ ! -z "$(cat /etc/pod-info/skipPreStopChecks)" ]; then exit 0;
                fi; rabbitmq-upgrade await_online_quorum_plus_one -t 604800 && rabbitmq-upgrade
                await_online_synchronized_mirror -t 604800 || true && rabbitmq-upgrade
                drain -t 604800
        name: rabbitmq
        ports:
        - containerPort: 4369
          name: epmd
          protocol: TCP
        - containerPort: 5671
          name: amqps
          protocol: TCP
        - containerPort: 15671
          name: management-tls
          protocol: TCP
        - containerPort: 15691
          name: prometheus-tls
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: amqps
          timeoutSeconds: 5
        resources:
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: "1"
            memory: 2Gi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/lib/rabbitmq/
          name: rabbitmq-erlang-cookie
        - mountPath: /var/lib/rabbitmq/mnesia/
          name: persistence
        - mountPath: /etc/rabbitmq/inter-node-tls.config
          name: config-data
          readOnly: true
          subPath: inter_node_tls.config
        - mountPath: /operator
          name: rabbitmq-plugins
        - mountPath: /etc/rabbitmq/conf.d/10-operatorDefaults.conf
          name: rabbitmq-confd
          subPath: operatorDefaults.conf
        - mountPath: /etc/rabbitmq/conf.d/90-userDefinedConfiguration.conf
          name: rabbitmq-confd
          subPath: userDefinedConfiguration.conf
        - mountPath: /etc/pod-info/
          name: pod-info
        - mountPath: /etc/rabbitmq/conf.d/11-default_user.conf
          name: rabbitmq-confd
          subPath: default_user.conf
        - mountPath: /etc/rabbitmq/advanced.config
          name: server-conf
          subPath: advanced.config
        - mountPath: /etc/rabbitmq/erl_inetrc
          name: server-conf
          subPath: erl_inetrc
        - mountPath: /etc/rabbitmq-tls/
          name: rabbitmq-tls
          readOnly: true
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - sh
        - -c
        - cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie
          && chmod 600 /var/lib/rabbitmq/.erlang.cookie ; cp /tmp/rabbitmq-plugins/enabled_plugins
          /operator/enabled_plugins ; echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf
          && sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf
          >> /var/lib/rabbitmq/.rabbitmqadmin.conf && chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf
          ; sleep 30
        image: 38.102.83.110:5001/podified-master-centos10/openstack-rabbitmq:watcher_latest
        imagePullPolicy: IfNotPresent
        name: setup-container
        resources:
          limits:
            cpu: 20m
            memory: 64Mi
          requests:
            cpu: 20m
            memory: 64Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp/rabbitmq-plugins/
          name: plugins-conf
        - mountPath: /var/lib/rabbitmq/
          name: rabbitmq-erlang-cookie
        - mountPath: /tmp/erlang-cookie-secret/
          name: erlang-cookie-secret
        - mountPath: /operator
          name: rabbitmq-plugins
        - mountPath: /var/lib/rabbitmq/mnesia/
          name: persistence
        - mountPath: /tmp/default_user.conf
          name: rabbitmq-confd
          subPath: default_user.conf
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: notifications-rabbitmq-server
      serviceAccountName: notifications-rabbitmq-server
      terminationGracePeriodSeconds: 604800
      topologySpreadConstraints:
      - labelSelector:
          matchLabels:
            app.kubernetes.io/name: notifications-rabbitmq
        maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: ScheduleAnyway
      volumes:
      - configMap:
          defaultMode: 272
          items:
          - key: inter_node_tls.config
            path: inter_node_tls.config
          name: notifications-rabbitmq-config-data
        name: config-data
      - configMap:
          defaultMode: 420
          name: notifications-rabbitmq-plugins-conf
        name: plugins-conf
      - name: rabbitmq-confd
        projected:
          defaultMode: 420
          sources:
          - configMap:
              items:
              - key: operatorDefaults.conf
                path: operatorDefaults.conf
              - key: userDefinedConfiguration.conf
                path: userDefinedConfiguration.conf
              name: notifications-rabbitmq-server-conf
          - secret:
              items:
              - key: default_user.conf
                path: default_user.conf
              name: notifications-rabbitmq-default-user
      - emptyDir: {}
        name: rabbitmq-erlang-cookie
      - name: erlang-cookie-secret
        secret:
          defaultMode: 420
          secretName: notifications-rabbitmq-erlang-cookie
      - emptyDir: {}
        name: rabbitmq-plugins
      - downwardAPI:
          defaultMode: 420
          items:
          - fieldRef:
              apiVersion: v1
              fieldPath: metadata.labels['skipPreStopChecks']
            path: skipPreStopChecks
        name: pod-info
      - configMap:
          defaultMode: 420
          name: notifications-rabbitmq-server-conf
        name: server-conf
      - name: rabbitmq-tls
        projected:
          defaultMode: 400
          sources:
          - secret:
              items:
              - key: tls.crt
                path: tls.crt
              - key: tls.key
                path: tls.key
              name: cert-notifications-rabbitmq-svc
              optional: true
          - secret:
              items:
              - key: ca.crt
                path: ca.crt
              name: cert-notifications-rabbitmq-svc
              optional: true
  updateStrategy:
    rollingUpdate:
      partition: 0
    type: RollingUpdate
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: rabbitmq
        app.kubernetes.io/name: notifications-rabbitmq
        app.kubernetes.io/part-of: rabbitmq
      name: persistence
      namespace: openstack
      ownerReferences:
      - apiVersion: rabbitmq.com/v1beta1
        blockOwnerDeletion: false
        controller: true
        kind: RabbitmqCluster
        name: notifications-rabbitmq
        uid: 7f46b4bb-9717-4249-a318-a71756976c05
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: local-storage
      volumeMode: Filesystem
    status:
      phase: Pending
status:
  availableReplicas: 1
  collisionCount: 0
  currentReplicas: 1
  currentRevision: notifications-rabbitmq-server-548987fc7b
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  updateRevision: notifications-rabbitmq-server-548987fc7b
  updatedReplicas: 1
