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

AMQ Broker Operator #324

Merged
merged 4 commits into from
Sep 4, 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
8 changes: 8 additions & 0 deletions amq-broker-operator/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# AMQ Broker Operator EditorConfig File

[*]
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: amq-cluster-basic

resources:
- namespace.yaml
- operator-group.yaml
- ../../operator/overlays/v7.12
- ../../instance/overlays/clustered-ephemeral

components:
- ../../instance/components/addresses
- ../../instance/components/authentication/guest

patches:
- target:
group: broker.amq.io
version: v1beta1
kind: ActiveMQArtemis
name: default
patch: |-
- op: replace
path: /spec/console/expose
value: true

- op: add
path: /spec/adminUser
value: admin
- op: add
path: /spec/adminPassword
value: example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: amq-cluster-basic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: default
namespace: amq-cluster-basic
spec:
targetNamespaces:
- amq-cluster-basic
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: amq-cluster-ssl

resources:
- namespace.yaml
- operator-group.yaml
- ../../operator/overlays/v7.12
- ../../instance/overlays/clustered-ephemeral-tls-init-container

components:
- ../../instance/components/addresses
- ../../instance/components/authentication/guest
- ../../instance/components/logging/claim-template
- ../../instance/components/metrics/address-metrics
- ../../instance/components/metrics/broker-internal/jvm
- ../../instance/components/metrics/broker-external/prometheus

patches:
- target:
group: broker.amq.io
version: v1beta1
kind: ActiveMQArtemis
name: default
patch: |-
- op: replace
path: /metadata/name
value: amq-cluster-ssl

- op: replace
path: /spec/console/expose
value: true

- op: add
path: /spec/adminUser
value: admin
- op: add
path: /spec/adminPassword
value: example
- target:
group: monitoring.coreos.com
version: v1
kind: ServiceMonitor
name: default
patch: |-
- op: replace
path: /metadata/name
value: amq-cluster-ssl-prometheus-sm
- op: replace
path: /spec/selector/matchLabels/application
value: amq-cluster-ssl-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: amq-cluster-ssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: default
namespace: amq-cluster-ssl
spec:
targetNamespaces:
- amq-cluster-ssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: amq-cluster-ssl

resources:
- namespace.yaml
- operator-group.yaml
- ../../operator/overlays/v7.12
- ../../instance/overlays/clustered-ephemeral-tls-letsencrypt

components:
- ../../instance/components/addresses
- ../../instance/components/authentication/guest
- ../../instance/components/logging/claim-template
- ../../instance/components/metrics/address-metrics
- ../../instance/components/metrics/broker-internal/jvm
- ../../instance/components/metrics/broker-external/prometheus

patches:
- target:
group: broker.amq.io
version: v1beta1
kind: ActiveMQArtemis
name: default
patch: |-
- op: replace
path: /metadata/name
value: amq-cluster-ssl

- op: replace
path: /spec/console/expose
value: true

- op: add
path: /spec/adminUser
value: admin
- op: add
path: /spec/adminPassword
value: example
- target:
group: cert-manager.io
version: v1
kind: Certificate
name: console-ssl-certificate
patch: |-
- op: replace
path: /spec/dnsNames
value:
- amq-cluster-ssl-wconsj-0-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- amq-cluster-ssl-wconsj-1-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- amq-cluster-ssl-wconsj-2-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- target:
group: cert-manager.io
version: v1
kind: Certificate
name: acceptor-ssl-certificate
patch: |-
- op: replace
path: /spec/dnsNames
value:
- amq-cluster-ssl-ssl-0-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- amq-cluster-ssl-ssl-1-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- amq-cluster-ssl-ssl-2-svc-rte-amq-cluster-ssl.apps.cluster.example.com
- target:
group: monitoring.coreos.com
version: v1
kind: ServiceMonitor
name: default
patch: |-
- op: replace
path: /metadata/name
value: amq-cluster-ssl-prometheus-sm
- op: replace
path: /spec/selector/matchLabels/application
value: amq-cluster-ssl-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: amq-cluster-ssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: default
namespace: amq-cluster-ssl
spec:
targetNamespaces:
- amq-cluster-ssl
131 changes: 131 additions & 0 deletions amq-broker-operator/instance/base/activemq-artemis-cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: default
spec:
console:
expose: false
sslEnabled: false
deploymentPlan:
size: 1
resources:
requests: {}
limits: {}
clustered: false
persistenceEnabled: false
journalType: nio
requireLogin: false
managementRBACEnabled: true
enableMetricsPlugin: false
jolokiaAgentEnabled: false
messageMigration: false
extraMounts:
configMaps: []
secrets: []
extraVolumeClaimTemplates: []
extraVolumes: []
extraVolumeMounts: []
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
failureThreshold: 30
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
exec:
command:
- /bin/bash
- '-c'
- >-
/opt/amq/bin/artemis check node
--up
--url=tcp://"$HOSTNAME":61610
failureThreshold: 30
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 10
acceptors:
- # Acceptor for use with startup probe, possibly liveness probe, etc
name: probes
expose: false
port: 61610
protocols: all
sslEnabled: false
connectors: []
addressSettings:
applyRule: replace_all
addressSetting:
# Default catch-all, to be replaced or modified by overlays
- match: '#'

enableMetrics: false
messageCounterHistoryDayLimit: 0
enableIngressTimestamp: false

addressFullPolicy: BLOCK

pageMaxCacheSize: 5
pageSizeBytes: 10Mb

retroactiveMessageCount: 0
maxSizeMessages: -1
maxSizeBytes: '-1'
maxSizeBytesRejectThreshold: -1

redistributionDelay: -1

slowConsumerPolicy: NOTIFY
slowConsumerCheckPeriod: 5
slowConsumerThreshold: -1

autoCreateAddresses: true
autoCreateQueues: true
autoCreateDeadLetterResources: true
autoCreateExpiryResources: true

autoDeleteAddresses: true
# delay is in milliseconds
autoDeleteAddressesDelay: 0

autoDeleteQueues: true
# delay is in milliseconds
autoDeleteQueuesDelay: 0

deadLetterAddress: DLQ
deadLetterQueuePrefix: DLQ.
# deadLetterQueueSuffix:

sendToDlaOnNoRoute: false
maxDeliveryAttempts: 10
# delay in milliseconds
redeliveryDelay: 0
maxRedeliveryDelay: 0

expiryAddress: ExpiryQueue
expiryQueuePrefix: EXP.
# expiryQueueSuffix:
expiryDelay: -1
minExpiryDelay: -1
maxExpiryDelay: -1

env: []
brokerProperties:
# Set value that can be used to remove values from arrays in broker.properties files
- remove.value=-

# Even with persistenceEnabled set to false above, the broker.xml shows peristence-enabled true... override that
- persistenceEnabled=false
resourceTemplates:
- # Empty template to facilitate patching init containers into broker pods if needed
selector:
apiGroup: apps/v1
kind: StatefulSet
patch:
apiVersion: apps/v1
kind: StatefulSet
spec:
template:
spec:
volumes: []
initContainers: []
5 changes: 5 additions & 0 deletions amq-broker-operator/instance/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- activemq-artemis-cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- target:
group: broker.amq.io
version: v1beta1
kind: ActiveMQArtemis
name: default
patch: |-
- op: add
path: /spec/acceptors/-
value:
name: ssl
expose: true
port: 61617
protocols: all

sslEnabled: true
needClientAuth: true
verifyHost: true
sslSecret: acceptor-ssl-keystore
trustSecret: acceptor-ssl-truststore

multicastPrefix: jms.topic.
anycastPrefix: jms.queue.
supportAdvisory: true
suppressInternalManagementObjects: false
Loading