apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: rabbitmq
  namespace: rabbitmq
spec:
  interval: 5m
  timeout: 10m
  postRenderers:
    - kustomize:
        patches:
          - target:
              group: apps
              version: v1
              kind: StatefulSet
              namespace: rabbitmq
            patch: |-
              - op: add
                path: /spec/template/spec/nodeSelector
                value:
                  node.deckhouse.io/group: generic
              - op: add
                path: /spec/template/spec/tolerations
                value: []
          - target:
              group: cert-manager.io
              version: v1
              kind: Certificate
              namespace: gateway
              name: rmq-tls
            patch: |-
              $patch: delete
              apiVersion: cert-manager.io/v1
              kind: Certificate
              metadata:
                name: rmq-tls
                namespace: gateway
          - target:
              group: networking.istio.io
              version: v1beta1
              kind: Gateway
              namespace: gateway
              name: rmq-gateway
            patch: |-
              $patch: delete
              apiVersion: networking.istio.io/v1beta1
              kind: Gateway
              metadata:
                name: rmq-gateway
                namespace: gateway
          - target:
              group: networking.istio.io
              version: v1
              kind: VirtualService
              namespace: rabbitmq
              name: rmq-virt-service
            patch: |-
              $patch: delete
              apiVersion: networking.istio.io/v1
              kind: VirtualService
              metadata:
                name: rmq-virt-service
                namespace: rabbitmq
  values:
    global:
      security:
        allowInsecureImages: true
    virtualService: null
    gateway: null
    certificate: null
    metrics:
      serviceMonitor:
        enabled: false
        default:
          enabled: false
        perObject:
          enabled: false
        detailed:
          enabled: false
    extraServiceMonitors: []
    replicaCount: 1
    resources:
      requests:
        memory: 1Gi
    persistence:
      storageClass: nfs01
      size: 10Gi
    auth:
      securePassword: true
      enableLoopbackUser: false
      existingPasswordSecret: ""
      vault:
        enabled: true
        role: rabbitmq
        authPath: auth/kubernetes
        secretPath: secrets/data/rabbitmq/auth
        usernameKey: username
        passwordKey: password
    advancedConfiguration: |-
      [
        {rabbit, [
          {loopback_users, []}
        ]}
      ].
