All Projects → nanit → Kubernetes Rabbitmq Cluster

nanit / Kubernetes Rabbitmq Cluster

Licence: mit
Deploy-ready rabbitmq cluster for kubernetes

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Kubernetes Rabbitmq Cluster

Cony
Simple AMQP wrapper around github.com/streadway/amqp
Stars: ✭ 158 (-15.51%)
Mutual labels:  rabbitmq
Rabbitmq Mqtt
RabbitMQ MQTT plugin
Stars: ✭ 169 (-9.63%)
Mutual labels:  rabbitmq
Go init
一个用go组织项目结构,主要包括 gin, goredis, gorm, websocket, rabbitmq等。👉
Stars: ✭ 183 (-2.14%)
Mutual labels:  rabbitmq
Springboot Rabbitmq
RabbitMQ为异步消息处理提出了一个很好的解决方案,它是一个非常好用的消息中间件,主要用于中间件的解耦,同时,Spring Boot为RabbitMQ提供了支持, Spring Boot为Rabbit准备了spring-boot-starter-amqp,spring-rabbit 支持 AMQP(即Advanced Message Queuing Protocol,高级消息队列协议,是应用层协议的一个开放标准),并且为RabbitTemplate和RabbitMQ提供了自动配置选项
Stars: ✭ 159 (-14.97%)
Mutual labels:  rabbitmq
Springbootlearning
《Spring Boot教程》源码
Stars: ✭ 2,065 (+1004.28%)
Mutual labels:  rabbitmq
Seckill
基于Spring Boot的高性能秒杀系统
Stars: ✭ 171 (-8.56%)
Mutual labels:  rabbitmq
Queue
本人的RabbitMQ和Kafka详细笔记以及示例代码
Stars: ✭ 158 (-15.51%)
Mutual labels:  rabbitmq
Rabbitmq Erlang Client
Erlang client for RabbitMQ
Stars: ✭ 184 (-1.6%)
Mutual labels:  rabbitmq
Microservices Sample
Sample project to create an application using microservices architecture
Stars: ✭ 167 (-10.7%)
Mutual labels:  rabbitmq
Messagebus
A MessageBus (CommandBus, EventBus and QueryBus) implementation in PHP7
Stars: ✭ 178 (-4.81%)
Mutual labels:  rabbitmq
Visual Chatbot
☁️ 👀 💬 Visual Chatbot
Stars: ✭ 161 (-13.9%)
Mutual labels:  rabbitmq
Code4java
Repository for my java projects.
Stars: ✭ 164 (-12.3%)
Mutual labels:  rabbitmq
Rabtap
RabbitMQ wire tap and swiss army knife
Stars: ✭ 171 (-8.56%)
Mutual labels:  rabbitmq
Stove
Domain Driven Design oriented application framework, meets CRUD needs
Stars: ✭ 160 (-14.44%)
Mutual labels:  rabbitmq
Kombu
Kombu is a messaging library for Python.
Stars: ✭ 2,263 (+1110.16%)
Mutual labels:  rabbitmq
Spring Boot Examples
个人学习 SpringBoot2.x 写的一些示例程序,目前正在持续更新中.....
Stars: ✭ 159 (-14.97%)
Mutual labels:  rabbitmq
Ketchup
ketchup (番茄酱) 是一个基于dotnet core的微服务框架。
Stars: ✭ 170 (-9.09%)
Mutual labels:  rabbitmq
Ebook Chat App Spring Websocket Cassandra Redis Rabbitmq
Pro Java Clustering and Scalability: Building Real-Time Apps with Spring, Cassandra, Redis, WebSocket and RabbitMQ
Stars: ✭ 186 (-0.53%)
Mutual labels:  rabbitmq
Openmessaging Benchmark
OpenMessaging Benchmark Framework
Stars: ✭ 184 (-1.6%)
Mutual labels:  rabbitmq
Ng2 Stompjs
Angular 6 and 7 - Stomp service over Websockets
Stars: ✭ 170 (-9.09%)
Mutual labels:  rabbitmq

kubernetes-rabbitmq-cluster

A ready to deploy rabbitmq cluster to work on top of Kubernetes.

It uses rabbitmq clusterer plugin to achieve clustering.

Requirements:

  1. Kubernetes version 1.5.X (We're using StatefulSet)
  2. kubectl configured to work with your Kubernetes API
  3. Tested on Kubernetes 1.5.2 on top of AWS (See future work)
  4. Optional - Access to your own docker repository to store your own images. That's relevant if you don't want to use the default images offered here.

Contents:

  1. A 3 nodes rabbitmq cluster as StatefulSet
  2. A rabbitmq-headless headless service to control the StatefulSet domain
  3. a rabbitmq service to access the cluster
  4. An optional, rabbitmq-management service to access the admin control panel

Environment Variables:

Name Default Value Purpose
NAMESPACE default Change it if you want to create the RabbitMQ cluster in a custom Kubernetes namespace. If the namespace does not exist in the moment of deployment, it will be created for you.
DOCKER_REPOSITORY nanit Change it if you want to build and use custom docker repository
POD_MEMORY_REQUEST None memory allocated per pod by default
POD_CPU_REQUEST None cpu per pod
SUDO sudo Should docker commands be prefixed with sudo. Change to "" to omit sudo.
RBAC FALSE Should create a role/system account and role binding
RABBITMQ_REPLICAS 3 Number of nodes in the cluster
RABBITMQ_DEFAULT_USER None The default username to access the management console
RABBITMQ_DEFAULT_PASS None The default password to access the management console
RABBITMQ_ERLANG_COOKIE None Erlang secret needed for nodes communication
RABBITMQ_EXPOSE_MANAGEMENT FALSE Should RMQ management console be exposed as a service
RABBITMQ_MANAGEMENT_SERVICE_TYPE LoadBalancer Kubernetes service type for the management console
RABBITMQ_HA_POLICY None Set this variable to automatically set HA policy on all queues
RABBITMQ_LOG_LEVEL info Log levels are set for all RabbitMQ log types: connection, mirroring, channel and federation. Valid values are: none, error, warning, info, debug
RABBITMQ_ADDITIONAL_YAML "" Inject additional arbitrary YAML into the stateful set

Deployment:

  1. Clone this repository
  2. Run:
export NAMESPACE=default && \
export DOCKER_REPOSITORY=nanit && \
export POD_CPU_REQUEST=300m && \
export POD_MEMORY_REQUEST=5Gi && \
export RABBITMQ_REPLICAS=5 && \
export RABBITMQ_DEFAULT_USER=username && \
export RABBITMQ_DEFAULT_PASS=password && \
export RABBITMQ_ERLANG_COOKIE=secret && \
export RABBITMQ_EXPOSE_MANAGEMENT=TRUE && \
export RABBITMQ_MANAGEMENT_SERVICE_TYPE=LoadBalancer && \
export RABBITMQ_HA_POLICY='{\"ha-mode\":\"all\"}' && \
export RABBITMQ_LOG_LEVEL=info && \
export RABBITMQ_ADDITIONAL_YAML="" && \
export SUDO="" && \
make deploy

Usage:

At the end of the installation you should have a service named rabbitmq which you can use to connect to the cluster. If you've set the environment variable RABBITMQ_HA_POLICY a policy named ha-all is created to match all queues. These are the resource you're supposed to see on the cluster when running kubectl get pods,svc:

k8s-resources

Please note the following:

  1. The number of rabbitmq pods may be different in case you chose a different number of RABBITMQ_REPLICAS than 5
  2. The rabbitmq-management service will only be available if you've set RABBITMQ_EXPOSE_MANAGEMENT to TRUE

Changing the number of nodes:

Number of nodes is configurable with RABBITMQ_REPLICAS environment variable. Note that changing the number of nodes after the initial deployment of the cluster is problematic since old rabbitmq instance won't fetch the new nodes hosts into the clusterer.config file.

For now, the best option is to:

  1. Delete the current statefulset with kubectl delete statefulset rabbitmq
  2. Re-deploy the cluster with the new RABBITMQ_REPLICAS value

Building your own images:

If you want to build use your own images make sure to change the DOCKER_REPOSITORY environment variable to your own docker repository. It will build the images, push them to your docker repository and use them to create all the needed kubernetes deployments.

Docker Compose:

You can run the same setup in docker-compose using

$ docker-compose build && docker-compose up

Then, go to localhost:15672 and you'll see the cluster is already formed up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].