Rabbit MQ Operatör ile Kubernetes Üzerinde Cluster Kurulumu
Published in
1 min readSep 5, 2023
Kurulumlar rabbit namespace altında yapmak üzere ilgili namespace oluşturulur.
kubectl create namespace rabbit
StorageClass Dosyasinin Olusturulması
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
labels:
addonmanager.kubernetes.io/mode: EnsureExists
kubernetes.io/cluster-service: "true"
name: azurefile-rt
mountOptions:
- mfsymlinks
- actimeo=30
- nosharesock
parameters:
skuName: Standard_LRS
provisioner: file.csi.azure.com
reclaimPolicy: Retain
volumeBindingMode: Immediate
allowVolumeExpansion: true
RabbitMQ Operatorün Kurulması
###Install the RabbitMQ operator
kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
###Check if the components are healthy in the rabbitmq-system namespace
kubectl get all -o wide -n rabbitmq-system
RabbitMQ Operator ile RabbitMQ Cluster Oluşturma
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: dev-rabbitmqcluster
namespace: rabbit
spec:
replicas: 3
persistence:
storageClassName: azurefile-rt
storage: 5Gi
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 1
memory: 2Gi
rabbitmq:
additionalPlugins:
- rabbitmq_management
- rabbitmq_peer_discovery_k8s
additionalConfig: |
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
cluster_formation.k8s.host = kubernetes.default.svc.cluster.local
cluster_formation.k8s.address_type = hostname
vm_memory_high_watermark_paging_ratio = 0.85
cluster_formation.node_cleanup.interval = 10
cluster_partition_handling = autoheal
queue_master_locator = min-masters
loopback_users.guest = false
default_user = ******
default_pass = *******
advancedConfig: ""
service:
type: ClusterIP
Yaml dosyaları oluşturulduktan sonra sırasıyla aşağıdaki komutla çalıştırılır.
kubectl apply -f filename