Skip to content

Instantly share code, notes, and snippets.

@enesusta
Last active October 21, 2023 23:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save enesusta/e2ac956104dc0fa4130c795e7270bfc2 to your computer and use it in GitHub Desktop.
Save enesusta/e2ac956104dc0fa4130c795e7270bfc2 to your computer and use it in GitHub Desktop.
Install RabbitMQ on k8s guide

Deploy RabbitMQ on Kubernetes

Helm, the Kubernetes application package manager, can streamline the installation process and deploy resources throughout the cluster very quickly. To successfully deploy RabbitMQ, we will have to install the Helm package manager.

Install Helm

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

or

brew install helm

Once the installation process has been completed, initiate the Helm package manager by typing the following command:

helm init

then:

helm repo add stable https://charts.helm.sh/stable

Create a Namespace for the RabbitMQ Deployment

All resources in Kubernetes are started in a namespace. Unless one is specified, the system uses the default namespace. To have better control over the deployment process use the following command to create a distinct namespace:

kubectl create namespace rabbit

Install RabbitMQ on Kubernetes

With Helm successfully installed and a designated namespace you are ready to start the RabbitMQ deployment process. Enter the following command to apply a default stable/rabbitmq chart from a git repository:

helm install rabbit --set service.type=NodePort stable/rabbitmq --namespace rabbit-system

RabbitMQ Credentials

STDOUT'ta username'i goreceksiniz.

Username'in user olmasi muhtemel.

  • Password icin:
echo $(kubectl get secret --namespace rabbit mu-rabbit-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 --decode)

RabbitMQ can be accessed within the cluster on port at mu-rabbit-rabbitmq.rabbit.svc.cluster.local

To access for outside the cluster, perform the following steps:

kubectl port-forward --namespace rabbit svc/mu-rabbit-rabbitmq 5672:5672

To Access the RabbitMQ Management interface:

kubectl port-forward --namespace rabbit svc/mu-rabbit-rabbitmq 15672:15672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment