AIO and MUNO mode upgrade for EG 1.5.0 version
[eliot.git] / blueprints / iotgateway / playbooks / roles / rabbitmq / files / statefulset_x86.yaml
1 ---
2 apiVersion: apps/v1
3 kind: StatefulSet
4 metadata:
5   name: rabbitmq
6   namespace: default
7 spec:
8   serviceName: rabbitmq
9   replicas: 3
10   selector:
11     matchLabels:
12       app: rabbitmq
13   template:
14     metadata:
15       labels:
16         app: rabbitmq
17     spec:
18       serviceAccountName: rabbitmq
19       terminationGracePeriodSeconds: 10
20       nodeSelector:
21         kubernetes.io/os: linux
22       containers:
23         - name: rabbitmq-k8s
24           image: rabbitmq:3.7-management-alpine
25           volumeMounts:
26             - name: config-volume
27               mountPath: /etc/rabbitmq
28           ports:
29             - name: http
30               protocol: TCP
31               containerPort: 15672
32             - name: amqp
33               protocol: TCP
34               containerPort: 5672
35           livenessProbe:
36             exec:
37               command: ["rabbitmq-diagnostics", "status"]
38             initialDelaySeconds: 60
39             periodSeconds: 60
40             timeoutSeconds: 15
41           readinessProbe:
42             exec:
43               command: ["rabbitmq-diagnostics", "status"]
44             initialDelaySeconds: 20
45             periodSeconds: 60
46             timeoutSeconds: 10
47           imagePullPolicy: Always
48           env:
49             - name: MY_POD_NAME
50               valueFrom:
51                 fieldRef:
52                   apiVersion: v1
53                   fieldPath: metadata.name
54             - name: MY_POD_NAMESPACE
55               valueFrom:
56                 fieldRef:
57                   fieldPath: metadata.namespace
58             - name: RABBITMQ_USE_LONGNAME
59               value: "true"
60             - name: K8S_SERVICE_NAME
61               value: rabbitmq
62             - name: RABBITMQ_NODENAME
63               # yamllint disable rule:line-length
64               value: rabbit@$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local
65               # yamllint enable rule:line-length
66             - name: K8S_HOSTNAME_SUFFIX
67               value: .$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local
68             - name: RABBITMQ_ERLANG_COOKIE
69               value: "dW5pcXVlLWVybGFuZy1jb29raWU="
70       volumes:
71         - name: config-volume
72           configMap:
73             name: rabbitmq-config
74             items:
75               - key: rabbitmq.conf
76                 path: rabbitmq.conf
77               - key: enabled_plugins
78                 path: enabled_plugins