Last active
September 28, 2020 14:29
-
-
Save p-le/36c03bcb2d358853a355a278d3e25122 to your computer and use it in GitHub Desktop.
k3d + vagrant + rabbitmq statefulset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: rabbitmq | |
spec: | |
serviceName: rabbitmq | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: rabbitmq | |
template: | |
metadata: | |
labels: | |
app: rabbitmq | |
spec: | |
serviceAccountName: rabbitmq | |
terminationGracePeriodSeconds: 10 | |
nodeSelector: | |
kubernetes.io/os: linux | |
containers: | |
- name: rabbitmq-k8s | |
image: rabbitmq:3.8 | |
volumeMounts: | |
- name: config-volume | |
mountPath: /etc/rabbitmq | |
ports: | |
- name: http | |
protocol: TCP | |
containerPort: 15672 | |
- name: amqp | |
protocol: TCP | |
containerPort: 5672 | |
livenessProbe: | |
exec: | |
command: ["rabbitmq-diagnostics", "status"] | |
initialDelaySeconds: 60 | |
periodSeconds: 60 | |
timeoutSeconds: 15 | |
readinessProbe: | |
exec: | |
command: ["rabbitmq-diagnostics", "ping"] | |
initialDelaySeconds: 20 | |
periodSeconds: 60 | |
timeoutSeconds: 10 | |
imagePullPolicy: Always | |
env: | |
- name: MY_POD_NAME | |
valueFrom: | |
fieldRef: | |
apiVersion: v1 | |
fieldPath: metadata.name | |
- name: MY_POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
- name: RABBITMQ_USE_LONGNAME | |
value: "true" | |
- name: K8S_SERVICE_NAME | |
value: rabbitmq | |
- name: RABBITMQ_NODENAME | |
value: rabbit@$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local | |
- name: K8S_HOSTNAME_SUFFIX | |
value: .$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local | |
- name: RABBITMQ_ERLANG_COOKIE | |
value: "mycookie" | |
volumes: | |
- name: config-volume | |
configMap: | |
name: rabbitmq-config | |
items: | |
- key: rabbitmq.conf | |
path: rabbitmq.conf | |
- key: enabled_plugins | |
path: enabled_plugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment