ci: Rabbitmq progress (wip) (#7233)

* ci: rabbitmq service (wip)

* ci: customize rabbitmq config
This commit is contained in:
Jennifer Richards 2024-03-19 14:24:39 +10:00 committed by Nicolas Giard
parent f6db3e8e1b
commit c987bacc95
4 changed files with 91 additions and 9 deletions

View file

@ -5,3 +5,59 @@ metadata:
data: data:
settings_local.py: |- settings_local.py: |-
{{- .Files.Get "settings_local.py" | indent 4 }} {{- .Files.Get "settings_local.py" | indent 4 }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: rabbitmq-configmap
data:
definitions.json: |-
{
"permissions": [
{
"configure": ".*",
"read": ".*",
"user": "datatracker",
"vhost": "dt",
"write": ".*"
}
],
"users": [
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"limits": {},
"name": "datatracker",
"password_hash": "HJxcItcpXtBN+R/CH7dUelfKBOvdUs3AWo82SBw2yLMSguzb",
"tags": []
}
],
"vhosts": [
{
"limits": [],
"metadata": {
"description": "",
"tags": []
},
"name": "dt"
}
]
}
rabbitmq.conf: |-
# prevent guest from logging in over tcp
loopback_users.guest = true
# load saved definitions
load_definitions = /etc/rabbitmq/definitions.json
# Ensure that enough disk is available to flush to disk. To do this, need to limit the
# memory available to the container to something reasonable. See
# https://www.rabbitmq.com/production-checklist.html#monitoring-and-resource-usage
# for recommendations.
# 1-1.5 times the memory available to the container is adequate for disk limit
disk_free_limit.absolute = 6000MB
# This should be ~40% of the memory available to the container. Use an
# absolute number because relative will be proprtional to the full machine
# memory.
vm_memory_high_watermark.absolute = 1600MB

View file

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: rabbitmq
labels: {{- include "datatracker.labels" . | nindent 4 }}
{{- with .Values.rabbitmq.service.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
type: {{.Values.rabbitmq.service.type}}
clusterIP: None # headless service
ports:
- port: {{ default "5672" .Values.rabbitmq.service.port}}
targetPort: amqp
protocol: TCP
name: amqp
selector: {{- include "datatracker.selectorLabels" . | nindent 4}}

View file

@ -1,5 +1,5 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: {{ include "datatracker.rabbitmq.fullname" . }} name: {{ include "datatracker.rabbitmq.fullname" . }}
labels: labels:
@ -41,8 +41,8 @@ spec:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
ports: ports:
- name: http - name: amqp
containerPort: 8000 containerPort: 5672
protocol: TCP protocol: TCP
livenessProbe: livenessProbe:
{{- toYaml $podValues.livenessProbe | nindent 12 }} {{- toYaml $podValues.livenessProbe | nindent 12 }}

View file

@ -387,11 +387,11 @@ beat:
# ------------------------------------------------------------- # -------------------------------------------------------------
rabbitmq: rabbitmq:
name: rabbitmq name: "rabbitmq"
image: image:
repository: "ghcr.io/ietf-tools/datatracker-mq" repository: "rabbitmq"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: "latest" tag: "3.13"
imagePullSecrets: [] imagePullSecrets: []
nameOverride: "" nameOverride: ""
@ -433,7 +433,7 @@ rabbitmq:
service: service:
type: ClusterIP type: ClusterIP
port: 80 port: 5672
serviceAccount: serviceAccount:
# Specifies whether a service account should be created # Specifies whether a service account should be created
@ -456,14 +456,19 @@ rabbitmq:
command: ["rabbitmq-diagnostics", "-q", "ping"] command: ["rabbitmq-diagnostics", "-q", "ping"]
# Additional volumes on the output Deployment definition. # Additional volumes on the output Deployment definition.
volumes: [] volumes:
- name: "rabbitmq-config"
configMap:
name: "rabbitmq-configmap"
# - name: foo # - name: foo
# secret: # secret:
# secretName: mysecret # secretName: mysecret
# optional: false # optional: false
# Additional volumeMounts on the output Deployment definition. # Additional volumeMounts on the output Deployment definition.
volumeMounts: [] volumeMounts:
- name: "rabbitmq-config"
mountPath: "/etc/rabbitmq"
# - name: foo # - name: foo
# mountPath: "/etc/foo" # mountPath: "/etc/foo"
# readOnly: true # readOnly: true
@ -557,3 +562,4 @@ env:
DBUSER: "django" DBUSER: "django"
DBPASS: "RkTkDPFnKpko" DBPASS: "RkTkDPFnKpko"
DJANGO_SECRET_KEY: "PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHk" DJANGO_SECRET_KEY: "PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHk"
CELERY_BROKER_URL: "amqp://datatracker:frog@rabbitmq/dt"