Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom AMQP protocol and external INVENIO_SEARCH_HOSTS #125

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion charts/invenio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,30 @@
{{- end }}
{{- end -}}

########################## RabbitMQ protocol ##########################
{{/*
This template renders the protocol for RabbitMQ.
*/}}
{{- define "invenio.rabbitmq.protocol" -}}
{{- if .Values.rabbitmq.enabled }}
{{- "amqp" }}
{{- else }}
{{- required "Missing .Values.rabbitmqExternal.protocol" .Values.rabbitmqExternal.protocol }}
{{- end }}
{{- end -}}

########################## RabbitMQ vhost ##########################
{{/*
This template renders the vhost for RabbitMQ.
*/}}
{{- define "invenio.rabbitmq.vhost" -}}
{{- if .Values.rabbitmq.enabled }}
{{- "" }}
{{- else }}
{{- required "Missing .Values.rabbitmqExternal.vhost" .Values.rabbitmqExternal.vhost }}
{{- end }}
{{- end -}}

########################## Celery broker URI ##########################
{{/*
This template renders the URI for connecting to RabbitMQ.
Expand All @@ -112,7 +136,9 @@
{{- $password := (include "invenio.rabbitmq.password" .) -}}
{{- $port := (include "invenio.rabbitmq.amqpPort" .) -}}
{{- $hostname := (include "invenio.rabbitmq.hostname" .) -}}
{{- printf "amqp://%s:%s@%s:%v/" $username $password $hostname $port }}
{{- $protocol := (include "invenio.rabbitmq.protocol" .) -}}
{{- $vhost := (include "invenio.rabbitmq.vhost" .) -}}
{{- printf "%s://%s:%s@%s:%v/%s" $protocol $username $password $hostname $port $vhost}}
{{- end -}}

########################### RabbitMQ API URI ###########################
Expand Down
2 changes: 2 additions & 0 deletions charts/invenio/templates/invenio-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ data:
INVENIO_CELERY_RESULT_BACKEND: 'redis://{{ include "invenio.redis.hostname" . }}:6379/2'
INVENIO_RATELIMIT_STORAGE_URL: 'redis://{{ include "invenio.redis.hostname" . }}:6379/3'
INVENIO_COMMUNITIES_IDENTITIES_CACHE_REDIS_URL: 'redis://{{ include "invenio.redis.hostname" . }}:6379/4'
{{- if not (hasKey .Values.invenio.extra_config "INVENIO_SEARCH_HOSTS") }}
INVENIO_SEARCH_HOSTS: {{ printf "[{'host': '%s'}]" (include "invenio.opensearch.hostname" .) | quote }}
{{- end }}
INVENIO_SITE_HOSTNAME: '{{ include "invenio.hostname" $ }}'
INVENIO_SITE_UI_URL: 'https://{{ include "invenio.hostname" $ }}'
INVENIO_SITE_API_URL: 'https://{{ include "invenio.hostname" $ }}/api'
Expand Down
1 change: 1 addition & 0 deletions charts/invenio/templates/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec:
targetPort: 8080
selector:
app: web
type: {{ .Values.web.service.type }}
lindhe marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions charts/invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ web:
cpu: '1'
memory: 100Mi
annotations: []
service:
type: ClusterIP

worker:
enabled: true
Expand Down