Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

allow disabling slave replication #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
21 changes: 13 additions & 8 deletions activemq-artemis/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ data:
{{- $releaseName := printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- $releaseNamespace := .Release.Namespace -}}

{{- $connectorTypes := dict "master" "" }}
{{- if .Values.slaveReplication }}
{{- $_ := set $connectorTypes "slave" "" }}
{{- end }}

<connectors>
{{ range $i,$t := until (int .Values.replicas) }}
{{ range tuple "master" "slave" }}
{{- range $i,$t := until (int .Values.replicas) }}
{{- range tuple "master" "slave" }}
<connector name="{{ $fullname }}-{{ . }}-{{ $i }}">tcp://{{ $fullname }}-{{ . }}-{{ $i }}.{{ $releaseName }}-{{ . }}.{{ $releaseNamespace }}.svc.cluster.local:61616</connector>
{{ end }}
{{end}}
{{- end }}
{{- end}}
</connectors>


Expand All @@ -41,11 +46,11 @@ data:
<max-hops>1</max-hops>

<static-connectors>
{{ range $i,$t := until (int .Values.replicas) }}
{{ range tuple "master" "slave" }}
{{- range $i,$t := until (int .Values.replicas) }}
{{- range (keys $connectorTypes) }}
<connector-ref>{{ $fullname }}-{{ . }}-{{ $i }}</connector-ref>
{{ end }}
{{ end }}
{{- end }}
{{- end }}
</static-connectors>

</cluster-connection>
Expand Down
4 changes: 3 additions & 1 deletion activemq-artemis/templates/master-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
containers:
- name: {{ include "artemis.fullname" . }}
image: {{ template "artemis.image" . }}
imagePullPolicy: {{ .Values.image.imagePullPolicy | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 10 }}
env:
Expand Down Expand Up @@ -122,7 +122,9 @@ spec:
name: data
spec:
accessModes: [ {{ .Values.persistence.accessMode | quote }} ]
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size }}
Expand Down
6 changes: 5 additions & 1 deletion activemq-artemis/templates/slave-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.slaveReplication }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -102,11 +103,14 @@ spec:
name: data
spec:
accessModes: [ {{ .Values.persistence.accessMode | quote }} ]
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- else}}
- name: data
emptyDir: {}
{{- end}}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions activemq-artemis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ artemisUser: artemis
artemisPassword: simetraehcapa

replicas: 2
# slaveReplication: start backup brokers for failover
slaveReplication: true

# antiAffinity sets an anti affinity policy between masters and slaves as either hard or soft, default is hard
antiAffinity: "soft"
Expand Down