I have a Kubernetes cluster with 2 applications and an Active MQ message broker, is it possible to scale the brokers to make my application faster. I tried scaling it with a StatefulSet
however it just spawned 2 different brokers that are operating on their own.
This is my deployment file for Active MQ:
apiVersion: apps/v1
kind: Deployment
metadata:
name: active-mq
labels:
app: active-mq
namespace: active-mq
spec:
replicas: 1
selector:
matchLabels:
app: active-mq
template:
metadata:
labels:
app: active-mq
spec:
containers:
- image: <IP REDACTED>:5000/active-mq
name: active-mq
resources:
requests:
memory: 500Mi
cpu: 200m
limits:
memory: 1000Mi
cpu: 400m
imagePullSecrets:
- name: reg-key
restartPolicy: Always
This is my Dockerfile
for Active MQ:
FROM openjdk:8-jre-alpine
WORKDIR /home/alpine
RUN apk update && apk add wget
RUN wget https://www.apache.org/dist/activemq/5.16.3/apache-activemq-5.16.3-bin.tar.gz -O - | tar -xz
EXPOSE 8161 61616 5672 61613 1833
CMD ["/bin/sh","apache-activemq-5.16.3/bin/activemq", "console"]
I was following this tutorial to create my deployment, and changed some properties.
Deploying Active-MQ in a Kubernetes cluster