Skip to content
Snippets Groups Projects
Commit e0456690 authored by xavki's avatar xavki
Browse files

update 20 rabbitmq - rabbitmq standard in k8s

parent 9fd6f9cc
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rabbitmq
namespace: rabbitmq
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
......
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: rabbitmq
spec:
maxUnavailable: 1
selector:
matchLabels:
app: rabbitmq
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: rabbitmq
namespace: rabbitmq
spec:
maxUnavailable: 1
selector:
matchLabels:
app: rabbitmq
......@@ -12,5 +12,5 @@ spec:
values:
nfs:
server: 192.168.12.20
path: /srv/provisionner/
path: /srv/rabbitmq/
......@@ -2,11 +2,13 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: rabbitmq
namespace: rabbitmq
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rabbitmq
namespace: rabbitmq
rules:
- apiGroups:
- ""
......
......@@ -2,6 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: rabbitmq-secret
namespace: rabbitmq
type: Opaque
data:
RABBITMQ_ERLANG_COOKIE: dGVzdDEyMzQ1Ngo=
......@@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: rabbitmq
namespace: rabbitmq
spec:
serviceName: rabbitmq
replicas: 3
......@@ -44,6 +45,13 @@ spec:
name: discovery
- containerPort: 5672
name: amqp
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 1
memory: 500Mi
env:
- name: RABBIT_POD_NAME
valueFrom:
......
......@@ -8,7 +8,6 @@ metadata:
spec:
clusterIP: None
ports:
ports:
- port: 4369
targetPort: 4369
name: discovery
......
%title: RABBITMQ
%author: xavki
# RABBITMQ : les fédérations
https://medium.com/trendyol-tech/rabbitmq-federation-plugin-cb87f7450365
https://victor.4devs.io/en/queue-servers/rabbitmq-federation-plugin.html
%title: RABBITMQ
%author: xavki
# RABBITMQ : perf test
https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/
%title: RABBITMQ
%author: xavki
# RABBITMQ : DEFINITIONS & CONCEPTS
<br>
producer > queue > consumer
<br>
* un peu plus compliqué / abouti
<br>
PRODUCER
* créé des messages
* met en forme les messages (json, plain text...)
* connexions au broker
* envoi du message
<br>
BROKER
* un serveur rabbitmq
* héberge les queues
* association à un cluster potentiel
* gestion sécurité (user/vhost...)
<br>
CONSUMER
* abonnement à une queue
* consomment les messages
<br>
ROLES
Producer > Broker > Consumer
<br>
BROKER - EXCHANGES
* responsable de la réception des messages
* différents types : direct / fanout / topic / headers
<br>
BROKER - EXCHANGES - Binding
* lien (connexion) d'un échange à une queue
* différent de la routing key (niveau messages)
<br>
BROKER - EXCHANGES - Routing Key
* routing des messages via une clef de chacun des messages
* couplé au type d'exchange
<br>
BROKER - CHANNEL
* multiplex de connexions
* élément de la connexion
```
channel, err := connection.Channel()
...
err = channel.Publish(
...
)
```
<br>
BROKER - QUEUES
* stockage des messages
* différents types (classic / quorum / stream)
* durabilité
<br>
BROKER - VHOST
* séparation / isolation
* sur un ou plusieurs broker
Producer > Channel > Exchange > Binding > Routing Key > Queue > Consumer
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment