Commit 70777c9
committed
Fix RabbitMQ log output with Vault configured
This commit fixes the CI failure which tests the following example:
https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/vault-default-user
RabbitMQ crashed at startup as follows:
```
failed to open log file at '/var/log/rabbitmq/rabbit@vault-default-user-server-0.vault-default-user-nodes.examples.log', reason: read-only file system
```
The problem was that with Vault configured the mount in
https://github.com/rabbitmq/cluster-operator/blob/575cfacf74775a569202d08e406e4e6b5d9d1780/internal/resource/statefulset.go#L876
seems to hide the config file in
https://github.com/docker-library/rabbitmq/blob/master/conf.d/10-defaults.conf
containing the setting
```
log.console = true
```
Without any vault, the config in the RabbitMQ pod looks as follows:
```
k exec r1-server-0 -c rabbitmq -- ls /etc/rabbitmq/conf.d
10-defaults.conf
10-operatorDefaults.conf
11-default_user.conf
90-userDefinedConfiguration.conf
```
With vault configured, the config directory in the RabbitMQ pod looks as follows:
```
k exec vault-default-user-server-0 -c rabbitmq -- ls /etc/rabbitmq/conf.d
10-operatorDefaults.conf
11-default_user.conf
90-userDefinedConfiguration.conf
```
This commit fixes the issue by adding
```
log.console = true
```
to file `10-operatorDefaults.conf`.
There is no harm if this setting is defined twice in different files in
the `/etc/rabbitmq/conf.d` directory. The last one wins.1 parent 575cfac commit 70777c9
File tree
3 files changed
+3
-1
lines changed- docs/examples/vault-default-user
- internal/resource
3 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments