1
0
Fork 0

rabbitmq: Switch to using volume claim templates

This will make it easier to "blow away" the RabbitMQ data volume on the
occasions when it gets into a weird state.  Simply scale the StatefulSet
down to 0 replicas, delete the PVC, then scale back up.  Kubernetes will
handle creating a new PVC automatically.
pull/37/head
Dustin 2024-11-21 22:48:06 -06:00
parent 14492d827a
commit 121e6e7111
1 changed files with 15 additions and 20 deletions

View File

@ -1,19 +1,4 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rabbitmq
labels:
app.kubernetes.io/name: rabbitmq
app.kubernetes.io/component: rabbitmq
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
labels:
@ -82,7 +67,7 @@ spec:
name: tmp
subPath: tmp
- mountPath: /var/lib/rabbitmq
name: rabbitmq-data
name: data
subPath: data
securityContext:
runAsNonRoot: true
@ -98,10 +83,20 @@ spec:
- name: rabbitmq-config
configMap:
name: rabbitmq
- name: rabbitmq-data
persistentVolumeClaim:
claimName: rabbitmq
- name: tmp
emptyDir:
medium: Memory
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
labels:
app.kubernetes.io/name: rabbitmq
app.kubernetes.io/component: rabbitmq
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi