| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: {{ include "rabbitmq.fullname" . }}
- labels:
- {{ include "rabbitmq.labels" . | indent 4 }}
- spec:
- serviceName: {{ include "rabbitmq.fullname" . }}-headless
- replicas: {{ .Values.replicaCount }}
- selector:
- matchLabels:
- app.kubernetes.io/name: {{ include "rabbitmq.fullname" . }}
- template:
- metadata:
- labels:
- {{ include "rabbitmq.labels" . | nindent 8 }}
- spec:
- {{- if .Values.nodeSelector }}
- nodeSelector:
- {{ toYaml .Values.nodeSelector | indent 8 }}
- {{- end }}
- {{- if .Values.tolerations }}
- tolerations:
- {{ toYaml .Values.tolerations | indent 8 }}
- {{- end }}
- containers:
- - name: rabbitmq
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- ports:
- - containerPort: 5672
- name: amqp
- - containerPort: 15672
- name: management
- - containerPort: 1883
- name: mqtt
- env:
- - name: RABBITMQ_DEFAULT_USER
- valueFrom:
- secretKeyRef:
- name: {{ include "rabbitmq.fullname" . }}-credentials
- key: username
- - name: RABBITMQ_DEFAULT_PASS
- valueFrom:
- secretKeyRef:
- name: {{ include "rabbitmq.fullname" . }}-credentials
- key: password
- readinessProbe:
- tcpSocket:
- port: 5672
- initialDelaySeconds: 10
- periodSeconds: 10
- livenessProbe:
- tcpSocket:
- port: 5672
- initialDelaySeconds: 20
- periodSeconds: 20
- volumeMounts:
- - name: rabbitmq-data
- mountPath: /var/lib/rabbitmq
- - name: rabbitmq-plugins
- mountPath: /etc/rabbitmq/enabled_plugins
- subPath: enabled_plugins
- - name: rabbitmq-conf
- mountPath: /etc/rabbitmq/rabbitmq.conf
- subPath: rabbitmq.conf
- {{- if .Values.definitions.enabled }}
- - name: rabbitmq-definitions
- mountPath: /etc/rabbitmq/definitions.json
- subPath: definitions.json
- {{- end }}
- volumes:
- - name: rabbitmq-plugins
- configMap:
- name: {{ include "rabbitmq.fullname" . }}-enabled-plugins
- items:
- - key: enabled_plugins
- path: enabled_plugins
- - name: rabbitmq-conf
- configMap:
- name: {{ include "rabbitmq.fullname" . }}-conf
- items:
- - key: rabbitmq.conf
- path: rabbitmq.conf
- {{- if .Values.definitions.enabled }}
- - name: rabbitmq-definitions
- configMap:
- name: {{ include "rabbitmq.fullname" . }}-definitions
- items:
- - key: definitions.json
- path: definitions.json
- {{- end }}
- volumeClaimTemplates:
- - metadata:
- name: rabbitmq-data
- spec:
- accessModes: [ "ReadWriteOnce" ]
- {{- if .Values.persistence.storageClass }}
- storageClassName: {{ .Values.persistence.storageClass }}
- {{- end }}
- resources:
- requests:
- storage: {{ .Values.persistence.size }}
|