-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathamq-service.yaml
79 lines (79 loc) · 1.68 KB
/
amq-service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
apiVersion: v1
kind: Secret
data:
erlang-cookie: Yy1pcy1mb3ItY29va2llLXRoYXRzLWdvb2QtZW5vdWdoLWZvci1tZQ==
metadata:
name: rabbitmq-config
type: Opaque
---
apiVersion: v1
kind: Service
metadata:
# Expose the management HTTP port on each node
name: rabbitmq-management
labels:
app: rabbitmq
spec:
ports:
- name: http
protocol: TCP
port: 15672
targetPort: 15672
selector:
app: rabbitmq
type: LoadBalancer # Or LoadBalancer in production w/ proper security
---
apiVersion: v1
kind: Service
metadata:
# The required headless service for StatefulSets
name: rabbitmq
labels:
app: rabbitmq
spec:
ports:
- port: 5672
protocol: TCP
targetPort: 5672
name: amqp
- port: 4369
protocol: TCP
name: epmd
- port: 25672
protocol: TCP
name: rabbitmq-dist
selector:
app: rabbitmq
type: LoadBalancer # Or LoadBalancer in production w/ proper security
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: rabbitmq
spec:
serviceName: "rabbitmq"
replicas: 2
template:
metadata:
labels:
app: rabbitmq
spec:
imagePullSecrets:
- name: regcred
containers:
- name: rabbitmq
#If you want to build your custm rabbitmq image, you may use the dockerfile attached
image: rabbitmq:3.8.0-management
imagePullPolicy: Always
env:
- name: RABBITMQ_ERLANG_COOKIE
valueFrom:
secretKeyRef:
name: rabbitmq-config
key: erlang-cookie
- name: RABBITMQ_VM_MEMORY_HIGH_WATERMARK
value: "150MiB"
ports:
- containerPort: 5672
- containerPort: 15672
- containerPort: 25672