Skip to content

Commit

Permalink
Prometheus fix standard port in TLS deploy (#541)
Browse files Browse the repository at this point in the history
fix standard port for Prometheus
  • Loading branch information
Gsantomaggio authored Jan 5, 2021
1 parent 5bc48e8 commit 39e1851
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/resource/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func (builder *ServerConfigMapBuilder) Update(object runtime.Object) error {
if _, err := defaultSection.NewKey("management.tcp.port", "15672"); err != nil {
return err
}

if _, err := defaultSection.NewKey("prometheus.tcp.port", "15692"); err != nil {
return err
}
}
if builder.Instance.AdditionalPluginEnabled("rabbitmq_mqtt") {
if _, err := defaultSection.NewKey("mqtt.listeners.ssl.default", "8883"); err != nil {
Expand Down Expand Up @@ -138,6 +142,11 @@ func (builder *ServerConfigMapBuilder) Update(object runtime.Object) error {
if _, err := defaultSection.NewKey("management.ssl.cacertfile", caCertPath); err != nil {
return err
}

if _, err := defaultSection.NewKey("prometheus.ssl.cacertfile", caCertPath); err != nil {
return err
}

if builder.Instance.AdditionalPluginEnabled("rabbitmq_web_mqtt") {
if _, err := defaultSection.NewKey("web_mqtt.ssl.port", "15676"); err != nil {
return err
Expand Down
10 changes: 10 additions & 0 deletions internal/resource/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ prometheus.ssl.keyfile = /etc/rabbitmq-tls/tls.key
prometheus.ssl.port = 15691
management.tcp.port = 15672
prometheus.tcp.port = 15692
`)

Expand Down Expand Up @@ -286,6 +287,7 @@ prometheus.ssl.keyfile = /etc/rabbitmq-tls/tls.key
prometheus.ssl.port = 15691
management.tcp.port = 15672
prometheus.tcp.port = 15692
mqtt.listeners.ssl.default = 8883
Expand Down Expand Up @@ -319,9 +321,13 @@ prometheus.ssl.port = 15691
management.tcp.port = 15672
prometheus.tcp.port = 15692
ssl_options.cacertfile = /etc/rabbitmq-tls/ca.crt
ssl_options.verify = verify_peer
management.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
prometheus.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
`)

Expect(configMapBuilder.Update(configMap)).To(Succeed())
Expand Down Expand Up @@ -351,10 +357,13 @@ management.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
prometheus.ssl.port = 15691
management.tcp.port = 15672
prometheus.tcp.port = 15692
ssl_options.cacertfile = /etc/rabbitmq-tls/ca.crt
ssl_options.verify = verify_peer
management.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
prometheus.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
web_mqtt.ssl.port = 15676
web_mqtt.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
Expand Down Expand Up @@ -491,6 +500,7 @@ listeners.tcp = none
ssl_options.cacertfile = /etc/rabbitmq-tls/ca.crt
ssl_options.verify = verify_peer
management.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
prometheus.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
web_mqtt.ssl.port = 15676
web_mqtt.ssl.cacertfile = /etc/rabbitmq-tls/ca.crt
Expand Down

0 comments on commit 39e1851

Please sign in to comment.