Skip to content

Commit

Permalink
use autopopulated vals for rmq host/port
Browse files Browse the repository at this point in the history
  • Loading branch information
artntek committed Nov 22, 2023
1 parent 7d2f59d commit 38312c5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
12 changes: 7 additions & 5 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ This is applicable when no passwords are set and therefore the random password i

More information about the credentials may be found at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases.

RabbitMQ can be accessed within the cluster on port {{ .Values.rabbitmq.hostport }} at {{ .Values.rabbitmq.hostname }}
{{- $rmqHostPort := default .Values.rabbitmq.service.ports.amqp .Values.rabbitmq.hostport -}}

RabbitMQ can be accessed within the cluster on port {{ $rmqHostPort }} at {{ include "idxworker.rabbitmq.hostname" . }}

Access the web console by port-forwarding:

kubectl -n {{ .Release.Namespace }} port-forward pod/{{ .Release.Name }}-rabbitmq-0 {{ .Values.rabbitmq.hostport }}:{{ .Values.rabbitmq.hostport }} &
kubectl -n {{ .Release.Namespace }} port-forward pod/{{ .Release.Name }}-rabbitmq-0 {{ $rmqHostPort }}:{{ $rmqHostPort }} &

...then login to the Rabbitmq web console: http://localhost:{{ .Values.rabbitmq.hostport }}
...then login to the Rabbitmq web console: http://localhost:{{ $rmqHostPort }}

{{- if .Values.rabbitmq.metrics.enabled }}

Expand Down Expand Up @@ -53,9 +55,9 @@ To get the Solr credentials execute the following commands:

Connect to the SOLR Dashboard by creating a kube proxy, and then browse to the local address:

kubectl -n {{ .Release.Namespace }} port-forward service/{{ .Release.Name }}-solr {{ .Values.global.solrPort }}:{{ .Values.rabbitmq.hostport }} &
kubectl -n {{ .Release.Namespace }} port-forward service/{{ .Release.Name }}-solr {{ .Values.global.solrPort }}:{{ .Values.global.solrPort }} &

Solr URL: http://127.0.0.1:{{ .Values.rabbitmq.hostport }}/solr/
Solr URL: http://127.0.0.1:{{ .Values.global.solrPort }}/solr/

{{- if .Values.solr.metrics.enabled }}

Expand Down
11 changes: 11 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
set RabbitMQ HostName
*/}}
{{- define "idxworker.rabbitmq.hostname" -}}
{{- if not .Values.rabbitmq.hostname }}
{{- .Release.Name }}-rabbitmq-headless
{{- else }}
{{- .Values.rabbitmq.hostname }}
{{- end }}
{{- end }}
3 changes: 2 additions & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ spec:
- sh
- -c
- >
until nc -z {{ .Values.rabbitmq.hostname }} {{ .Values.rabbitmq.hostport }} >
until nc -z {{ include "idxworker.rabbitmq.hostname" . }}{{- print " " }}
{{- default .Values.rabbitmq.service.ports.amqp .Values.rabbitmq.hostport }} >
{{- print " " }}/dev/null; do echo waiting for RabbitMQ; sleep 2; done;
- name: init-solr
image: busybox:latest
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ rabbitmq:
## Leave this value unset (`hostname: ""`) to have it automatically populated
##
hostname: ""
## @param rabbitmq.hostname idxworker param: hostport of the rabbitmq service
## @param rabbitmq.hostport idxworker param: hostport of the rabbitmq service
## Leave this value unset (`hostport: ""`) to have it automatically populated
##
hostport: ""
Expand Down

0 comments on commit 38312c5

Please sign in to comment.