Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit fa7c3db

Browse files
author
ArtemisCloud Bot
committed
Update docs to main
1 parent 642ec68 commit fa7c3db

File tree

5 files changed

+1014
-259
lines changed

5 files changed

+1014
-259
lines changed

Diff for: content/en/docs/help/operator.md

+88-15
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ spec:
515515
deploymentPlan:
516516
livenessProbe:
517517
tcpSocket:
518-
port: 8181
518+
port: 8161
519519
initialDelaySeconds: 30,
520520
timeoutSeconds: 5,
521521
```
@@ -818,8 +818,34 @@ spec:
818818
value: -XshowSettings:system
819819
820820
```
821+
---
822+
**NOTE**
823+
824+
You are configuring an array of [envVar](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envvar-v1-core) which is a very powerfull concept. Proceed with care, taking due respect to any environment the operator may set and depend on. For full documentation see the [Kubernetes Documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
825+
826+
There are a few well-known environment variables that are used by the operator internally to configure brokers, as shown below
827+
828+
* JAVA_ARGS_APPEND
829+
* JAVA_OPTS
830+
* DEBUG_ARGS
821831

822-
Note: you are configuring an array of [envVar](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envvar-v1-core) which is a very powerfull concept. Proceed with care, taking due respect to any environment the operator may set and depend on. For full documentation see the [Kubernetes Documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
832+
If you want to add some values to any of them, make sure you define it in **spec.env** using `value` field. If you use `valueFrom` for the env var you will get validation error condition in your CR's status.
833+
834+
If you really need `valueFrom` to define the values for the above env vars you can use a different var and then reference it in the internal var's `value` field.
835+
836+
For example:
837+
838+
```yaml
839+
env:
840+
- name: ENV_FROM_X
841+
valueFrom:
842+
secretKeyRef:
843+
key: JAVA_ARGS_APPEND
844+
name: amq-broker-dev-java-args-append
845+
- name: JAVA_ARGS_APPEND
846+
value: $(ENV_FROM_X)
847+
```
848+
Reference: [define-interdependent-environment-variables](https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/)
823849

824850
## Configuring brokerProperties
825851

@@ -842,12 +868,59 @@ spec:
842868
```
843869

844870
## Providing additional brokerProperties configuration from a secret
845-
It is possible to replace the use of the activemqartemisaddresses CRD and much of the activemqartemissecurities CRD with configuration via broker properties. This can necessitate a large amount of configuration in the CR.brokerProperties field.
846871
In order to provide a way to split or orgainse these properties by file or by secret, an extra mount can be used to provide a secret that will be treated as an additional source of broker properties configuration.
847872

848873
Using an **extraMounts** secret with a suffix "-bp" will cause the operator to auto mount the secret and make the broker aware of it's location. In addition the CR.Status.Condition[BrokerPropertiesApplied] will reflect the content of this secret.
849874

850-
Broker properties are applied in order, starting with the CR.brokerProperties and then with the "-bp" auto mounts in turn. Keys (or property files) from secrets are applied in alphabetical order.
875+
Broker properties are applied in order, starting with the CR.brokerProperties and then with the "-bp" auto mounts in turn. Keys (or property files) from secrets are applied in alphabetical order and the supported formats are text and JSON.
876+
877+
To configure the global max size with text brokerProperties configuration from a "-bp" secret:
878+
879+
```yaml
880+
apiVersion: v1
881+
kind: Secret
882+
metadata:
883+
name: config-bp
884+
stringData:
885+
globalMem.properties: |
886+
globalMaxSize=512M
887+
```
888+
889+
```yaml
890+
apiVersion: broker.amq.io/v1beta1
891+
kind: ActiveMQArtemis
892+
metadata:
893+
name: ex-aao
894+
spec:
895+
deploymentPlan:
896+
extraMounts:
897+
secrets:
898+
- "config-bp"
899+
```
900+
901+
To configure the global max size with JSON brokerProperties configuration from a "-bp" secret:
902+
903+
```yaml
904+
apiVersion: v1
905+
kind: Secret
906+
metadata:
907+
name: config-bp
908+
stringData:
909+
globalMem.json: |
910+
{"globalMaxSize":"512M"}
911+
```
912+
913+
```yaml
914+
apiVersion: broker.amq.io/v1beta1
915+
kind: ActiveMQArtemis
916+
metadata:
917+
name: ex-aao
918+
spec:
919+
deploymentPlan:
920+
extraMounts:
921+
secrets:
922+
- "config-bp"
923+
```
851924

852925
To configure a specific broker instance in a "-bp" secret, use `broker-N` as the prefix for a key in the secret data. For example:
853926

@@ -894,6 +967,9 @@ spec:
894967
```
895968
When the CR is deployed the broker in pod 0 broker will get `globalMaxSize=512M` and pod 1 broker will get `globalMaxSize=12M`. While both will get properties from `journal1.properties` of secret **config-1-bp** and `journal2.properties` from secret **config-2-bp**.
896969

970+
## Replace ActiveMQArtemisAddress and ActiveMQArtemisSecurity CRDs with broker properties
971+
The ActiveMQArtemisAddress and ActiveMQArtemisSecurity CRDs are deprecated in favour of the configuration via broker properties. It is possible to replace the use of the activemqartemisaddresses CRD and much of the activemqartemissecurities CRD with configuration via broker properties.
972+
897973
## Configuring Logging for Brokers
898974

899975
By default the operator deploys a broker with a default logging configuration that comes with the [Artemis container image]
@@ -993,14 +1069,12 @@ In addition, you need to expose the console, for example
9931069
apiVersion: broker.amq.io/v1beta1
9941070
kind: ActiveMQArtemis
9951071
metadata:
996-
name: ex-aao
1072+
name: artemis-with-metrics
9971073
spec:
998-
deploymentPlan:
999-
size: 1
1000-
enableMetricsPlugin: true
1001-
image: placeholder
10021074
console:
10031075
expose: true
1076+
deploymentPlan:
1077+
enableMetricsPlugin: true
10041078
```
10051079

10061080
### Enable JVM metrics
@@ -1011,12 +1085,11 @@ JVM memory metrics are enabled by default. Use the `spec.brokerProperties` field
10111085
apiVersion: broker.amq.io/v1beta1
10121086
kind: ActiveMQArtemis
10131087
metadata:
1014-
name: artemis-jvm
1088+
name: artemis-with-metrics
10151089
spec:
10161090
console:
10171091
expose: true
10181092
deploymentPlan:
1019-
size: 1
10201093
enableMetricsPlugin: true
10211094
brokerProperties:
10221095
- "metricsConfiguration.jvmGc=true"
@@ -1026,22 +1099,22 @@ spec:
10261099

10271100
### Monitor broker metrics by using Prometheus
10281101

1029-
The operator will expose a containerPort named **wsconj** for the Prometheus to monitor. The following
1102+
The operator will expose a port named **console-jolokia** for the Prometheus to monitor. The following
10301103
is a sample Prometheus ServiceMonitor resource
10311104

10321105
```yaml
10331106
apiVersion: monitoring.coreos.com/v1
10341107
kind: ServiceMonitor
10351108
metadata:
1036-
name: example-app
1109+
name: artemis-with-metrics-monitor
10371110
labels:
10381111
team: prometheus
10391112
spec:
10401113
selector:
10411114
matchLabels:
1042-
application: ex-aao-app
1115+
application: artemis-with-metrics-app
10431116
endpoints:
1044-
- port: wconsj
1117+
- port: console-jolokia
10451118
```
10461119
For a complete example please refer to this [artemiscloud example](https://github.com/artemiscloud/artemiscloud-examples/tree/main/operator/prometheus).
10471120

0 commit comments

Comments
 (0)