-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPSEXP-1862: add message broker support (#89)
- Loading branch information
Showing
11 changed files
with
173 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
charts/alfresco-repository/templates/configmap-message-broker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if not .Values.configuration.messageBroker.existingConfigMap.name }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: >- | ||
{{- $mqconfigCtx := dict "Values" (dict "nameOverride" "configmap-mq") "Chart" .Chart "Release" .Release }} | ||
{{ template "alfresco-repository.fullname" $mqconfigCtx }} | ||
labels: | ||
{{- include "alfresco-repository.labels" . | nindent 4 }} | ||
data: | ||
BROKER_URL: >- | ||
{{- with .Values.configuration.messageBroker }} | ||
{{- $reqmsg := "You must either provide a valid Message broker URL or use an existingConfigMap.name with that URL" }} | ||
{{- $mqurl := required $reqmsg .url }} | ||
{{- hasPrefix "failover:(" $mqurl | ternary $mqurl (printf "failover:(%s)" $mqurl) | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
charts/alfresco-repository/templates/secret-message-broker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if and (not .Values.configuration.messageBroker.existingSecret.name) .Values.configuration.messageBroker.username .Values.configuration.messageBroker.password }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
{{- $mqsecretCtx := dict "Values" (dict "nameOverride" "secret-mq") "Chart" .Chart "Release" .Release }} | ||
name: {{ template "alfresco-repository.fullname" $mqsecretCtx }} | ||
labels: | ||
{{- include "alfresco-repository.labels" . | nindent 4 }} | ||
type: Opaque | ||
data: | ||
BROKER_USERNAME: {{ .Values.configuration.messageBroker.username | b64enc | quote }} | ||
BROKER_PASSWORD: {{ .Values.configuration.messageBroker.password | b64enc | quote }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
suite: test Message Queue Broker | ||
templates: | ||
- secret-message-broker.yaml | ||
- deployment.yaml | ||
- configmap-message-broker.yaml | ||
tests: | ||
- it: should render ActiveMQ minimal config | ||
values: &testvalues | ||
- values/test_values.yaml | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: BROKER_URL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: RELEASE-NAME-configmap-mq | ||
key: BROKER_URL | ||
template: deployment.yaml | ||
- equal: | ||
path: data.BROKER_URL | ||
value: failover:(tcp://localhost:61616) | ||
template: configmap-message-broker.yaml | ||
|
||
- it: should render custom secret | ||
values: | ||
- values/test_values.yaml | ||
set: | ||
configuration: | ||
messageBroker: | ||
existingSecret: | ||
name: mqSecret | ||
keys: | ||
username: mquser | ||
password: mqpass | ||
existingConfigMap: | ||
name: mqConfigmap | ||
keys: | ||
url: myurl | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: BROKER_URL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: mqConfigmap | ||
key: myurl | ||
template: deployment.yaml | ||
- hasDocuments: | ||
count: 0 | ||
template: secret-message-broker.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
db: | ||
url: mysql://sandy:secret@myhost1:1111 | ||
configuration: | ||
messageBroker: | ||
url: failover:(tcp://localhost:61616) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters