Skip to content

Commit ae2ce25

Browse files
author
a.b.christie
committed
feat: Add priority, better resources and rabbitmq version
1 parent fc88fa0 commit ae2ce25

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

roles/infrastructure/defaults/main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ kc_admin_password: "{{ lookup('password', '/dev/null length=12 chars=ascii_lette
109109
# the Keycloak DB is (at the moment) part of the core database installation.
110110
rabbitmq_state: present
111111

112+
# The RabbitMQ management server version to deploy,
113+
# the version will have '-management' automatically applied as a postfix.
114+
rabbitmq_version: 4.2.1
115+
112116
# The hostname of the server that will host Keycloak,
113117
# devoid of the protocol (i.e. 'https://' assumed so just 'example.com').
114118
# If not set (blank) no ingress is created.
@@ -122,7 +126,7 @@ rabbitmq_cert_issuer: production
122126
rabbitmq_user: admin
123127
rabbitmq_user_password: "{{ lookup('password', '/dev/null length=12 chars=ascii_letters') }}"
124128

125-
rabbitmq_replicas: 1
129+
rabbitmq_replicas: 2
126130

127131
rabbitmq_vol_storageclass: " "
128132
rabbitmq_vol_size_g: 1

roles/infrastructure/templates/rabbitmqcluster.yaml.j2

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
apiVersion: rabbitmq.com/v1beta1
33
kind: RabbitmqCluster
44
metadata:
5-
name: {{ infra_namespace }}
5+
# The instance name can be called pretty-much anything...
6+
# except rabbitmq!?
7+
name: rabbit
68
namespace: {{ infra_namespace }}
79
spec:
10+
image: rabbitmq:{{ rabbitmq_version }}-management
811
replicas: {{ rabbitmq_replicas }}
912
rabbitmq:
1013
additionalPlugins:
@@ -14,12 +17,31 @@ spec:
1417
- rabbitmq_stream
1518
- rabbitmq_stream_management
1619
resources:
20+
{% if rabbitmq_cpu_request or rabbitmq_mem_request %}
1721
requests:
22+
{% if rabbitmq_cpu_request %}
1823
cpu: {{ rabbitmq_cpu_request }}
24+
{% endif %}
25+
{% if rabbitmq_mem_request %}
1926
memory: {{ rabbitmq_mem_request }}
27+
{% endif %}
28+
{% endif %}
29+
{% if rabbitmq_cpu_limit or rabbitmq_mem_limit %}
2030
limits:
31+
{% if rabbitmq_cpu_limit %}
2132
cpu: {{ rabbitmq_cpu_limit }}
33+
{% endif %}
34+
{% if rabbitmq_mem_limit %}
2235
memory: {{ rabbitmq_mem_limit }}
36+
{% endif %}
37+
{% endif %}
2338
persistence:
2439
storageClassName: {{ rabbitmq_vol_storageclass }}
2540
storage: {{ rabbitmq_vol_size_g }}Gi
41+
override:
42+
statefulSet:
43+
spec:
44+
template:
45+
spec:
46+
containers: []
47+
priorityClassName: im-application-high

0 commit comments

Comments
 (0)