After many attempts, I made it work using the customLivenessProbe parameter and specifying it in the values block like below.
I tried it before and it failed but I think that was due to a misconfiguration in the customReadinessProbe block.
Thanks to @Marko E for the help !
resource "helm_release" "rabbitmq" {
count = var.deploy_map.eema ? 1 : 0
repository = var.repository
description = var.description
lint = var.lint
verify = var.verify
name = var.name
version = var.version
chart = var.chart
namespace = var.namespace
create_namespace = var.create_namespace
set {
name = "service.type"
value = var.service_type
}
set {
name = "readinessProbe.enabled"
value = false
}
values = [
<<EOF
service:
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/azure-load-balancer-internal-subnet: "my-subnet"
customLivenessProbe:
exec:
command:
- bin/sh
- '-ec'
- rabbitmq-diagnostics -q ping
initialDelaySeconds: 120
timeoutSeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 6
EOF
]
}