RabbitMQ on Kubernetes without Bitnami, with Kapitan
RabbitMQ with the RabbitMQ Cluster Operator, in place of Bitnami's rabbitmq chart: three nodes on the official image, with persistent queues. The default user's credentials are in the Secret production-default-user. Needs the RabbitMQ Cluster Operator, which takes its webhook certificate from cert-manager. Queues, users and policies come from the same generator but need the Messaging Topology Operator, which this recipe leaves out.
- Replaces the Bitnami charts:
rabbitmq - Generators: kubernetes, rabbitmq
- Operators: RabbitMQ Cluster Operator, cert-manager
Inventory class
inventory/classes/recipes/rabbitmq.yml, as on the main branch of kadet-hub/examples. A target includes it next to the pins below.
# RabbitMQ with the RabbitMQ Cluster Operator, in place of Bitnami's rabbitmq
# chart: three nodes on the official image, with persistent queues. The
# default user's credentials are in the Secret production-default-user.
# Needs the RabbitMQ Cluster Operator, which takes its webhook certificate
# from cert-manager. Queues, users and policies come from the same generator
# but need the Messaging Topology Operator, which this recipe leaves out.
classes:
- recipes.lib.kubernetes
- recipes.lib.rabbitmq
parameters:
generators:
kubernetes:
namespaces:
messaging: {}
rabbitmq:
namespace: messaging
rabbitmqcluster:
production:
spec:
image: docker.io/library/rabbitmq:4.3.4-management
replicas: 3
persistence:
storage: 10Gi
resources:
requests: {cpu: 250m, memory: 1Gi}
limits: {memory: 1Gi}
Compile classes
The class includes one per generator; each compiles its generator once, so a target can combine several recipes.
inventory/classes/recipes/lib/kubernetes.yml
# Compiles the kubernetes generator; recipes include this class, so a target that
# combines several recipes compiles it once.
parameters:
kapitan:
compile:
- {input_type: kadet, output_type: yml, input_paths: [lib/kubernetes], output_path: kubernetes/}
inventory/classes/recipes/lib/rabbitmq.yml
# Compiles the rabbitmq generator; recipes include this class, so a target that
# combines several recipes compiles it once.
parameters:
kapitan:
compile:
- {input_type: kadet, output_type: yml, input_paths: [lib/rabbitmq], output_path: rabbitmq/}
Generator pins
The entries of inventory/classes/generators.yml for these generators, pinned by version and digest.
parameters:
kapitan:
dependencies:
- output_path: lib/rabbitmq
source: ghcr.io/kadet-hub/rabbitmq:1.0.3@sha256:7d7586b162faa9105d8d7dd5d330ec150fa66c5870925bb7857f4deb6e335aeb
type: oci
- output_path: lib/kubernetes
source: ghcr.io/kadet-hub/kubernetes:1.2.0@sha256:52017626e77dd5bf7293ce465ff0c3dc7a61dae1ae8353a56a53ffebe1bfb67c
type: oci
How it is checked
The examples CI verifies the signed index and the attestation of every pinned generator, compiles the target, validates the output against the generators' schemas, deploys it to a new kind cluster with the operators above and fails unless the RabbitmqCluster reports AllReplicasReady. The Chainsaw test holds the assertions.