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

Portability fixes for custom Kubernetes clusters #47

Open
wants to merge 5 commits 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
1 change: 1 addition & 0 deletions activemq-artemis/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apiVersion: v1
name: activemq-artemis
version: 0.0.1
appVersion: 2.6.2
Expand Down
2 changes: 1 addition & 1 deletion activemq-artemis/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ActiveMQ Artemis can be accessed via ports:

On the following DNS name from within your cluster:

- {{ include "artemis.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
- {{ include "artemis.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}

To get your password run:

Expand Down
2 changes: 1 addition & 1 deletion activemq-artemis/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data:
<connectors>
{{ 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>
<connector name="{{ $fullname }}-{{ . }}-{{ $i }}">tcp://{{ $fullname }}-{{ . }}-{{ $i }}.{{ $releaseName }}-{{ . }}.{{ $releaseNamespace }}.svc.{{ $.Values.global.clusterDomain }}:61616</connector>
{{ end }}
{{end}}
</connectors>
Expand Down
2 changes: 1 addition & 1 deletion activemq-artemis/templates/master-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ spec:
{{- else}}
- name: data
emptyDir: {}
{{- end}}
{{- end}}
10 changes: 3 additions & 7 deletions activemq-artemis/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

{{- if .Values.loadbalancer.enabled }}

{{- if .Values.services.type }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -21,11 +19,9 @@ spec:
- name: amqp
port: 5672
targetPort: amqp
type: LoadBalancer
type: {{ .Values.services.type }}
selector:
app: {{ template "artemis.name" . }}
release: {{ .Release.Name | quote }}
sessionAffinity: "ClientIP"


{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion activemq-artemis/templates/slave-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.slaves.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -46,4 +47,5 @@ data:
-N activemq="urn:activemq" \
-N core="urn:activemq:core" \
-u "/activemq:configuration/core:core/core:cluster-connections/core:cluster-connection[@name='{{ $releaseName }}']/core:connector-ref" \
-v "${HOSTNAME}" /var/lib/artemis/etc-override/broker-10.xml
-v "${HOSTNAME}" /var/lib/artemis/etc-override/broker-10.xml
{{- end }}
2 changes: 2 additions & 0 deletions activemq-artemis/templates/slave-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.slaves.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -27,3 +28,4 @@ spec:
app: {{ template "artemis.name" . }}
release: {{ .Release.Name | quote }}
component: slave
{{- end }}
8 changes: 5 additions & 3 deletions activemq-artemis/templates/slave-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.slaves.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -8,7 +9,7 @@ metadata:
{{ include "artemis.labels.standard" . | indent 4 }}
spec:
serviceName: {{ include "artemis.fullname" . }}-slave
replicas: {{ .Values.replicas }}
replicas: {{ .Values.slaves.enabled }}
podManagementPolicy: "Parallel"
revisionHistoryLimit: 10
updateStrategy:
Expand Down Expand Up @@ -106,7 +107,8 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- else}}
{{- else }}
- name: data
emptyDir: {}
{{- end}}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: ARTEMIS_HOST
value: {{ include "artemis.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
value: {{ include "artemis.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}
- name: ARTEMIS_PORT
value: "8161"
- name: ARTEMIS_USERNAME
Expand Down
15 changes: 12 additions & 3 deletions activemq-artemis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ artemisUser: artemis
# artemisPassword sets the artemis admin user password
artemisPassword: simetraehcapa

# number of master nodes in the cluster
replicas: 2

# number of slaves nodes in the cluster
slaves:
enabled: true
replicas: 2

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

Expand All @@ -32,6 +38,8 @@ antiAffinity: "soft"
# nameSuffix:

global:
# define default kubernetes internal cluster FQDN
clusterDomain: cluster.local
# namePrefix sets the global prefix for the fullname in the template "global prefix + prefix + name + suffix + global suffix"
# namePrefix: Global prefix
# nameSuffix sets the global suffix for the fullname in the template "global prefix + prefix + name + suffix + global suffix"
Expand Down Expand Up @@ -67,10 +75,11 @@ resources:
memory: 256Mi
cpu: 100m

# A load balander might confuse Minikube when installing with Helm and --wait
# A load balancer might confuse Minikube when installing with Helm and --wait
# Probably this is only useful for minikube environments and CI
loadbalancer:
enabled: true
# services types (LoadBalancer|ClusterIP|NodePort|Null=Disabled)
services:
type: LoadBalancer

## Prometheus Exporters / Metrics
##
Expand Down