bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.93k stars 9.18k forks source link

Cannot connect to amqp/manager port when using non-default ports #17556

Closed sagimann closed 1 year ago

sagimann commented 1 year ago

Name and Version

12.0.4

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Create values.yaml with custom ports (see below)
  2. Install: helm install mq oci://registry-1.docker.io/bitnamicharts/rabbitmq -f values.yaml
  3. Observe the log shows the server is listening on the original ports - not the custom ones (see below)
  4. Observe the k8s service correctly uses the custom ports:
    
    $ kubectl get svc
    NAME                   TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                                 AGE
    mq-rabbitmq            ClusterIP   x.x.x.x        <none>        5673/TCP,4369/TCP,25672/TCP,15673/TCP   7m15s

$ kubectl get svc mq-rabbitmq -o yaml

showing only ports section:

ports:

Are you using any custom parameters or values?

values.yaml:

auth:
  username: "user"
  password: "user"
service:
  ports:
    amqp: 5673
    manager: 15673
containerPorts:
  amqp: 5673
  manager: 15673

What is the expected behavior?

Rabbit MQ service should be accessible through the custom ports

What do you see instead?

Custom ports are not accessible and startup log shows the server is using the fefault ports (5672, 15672) - not the custom ones:

``` rabbitmq 10:43:22.12 rabbitmq 10:43:22.12 Welcome to the Bitnami rabbitmq container rabbitmq 10:43:22.12 Subscribe to project updates by watching https://github.com/bitnami/containers rabbitmq 10:43:22.12 Submit issues and feature requests at https://github.com/bitnami/containers/issues rabbitmq 10:43:22.12 rabbitmq 10:43:22.13 INFO ==> ** Starting RabbitMQ setup ** rabbitmq 10:43:22.14 INFO ==> Validating settings in RABBITMQ_* env vars.. rabbitmq 10:43:22.16 INFO ==> Initializing RabbitMQ... rabbitmq 10:43:22.19 INFO ==> Starting RabbitMQ in background... rabbitmq 10:43:33.34 INFO ==> No custom scripts in /docker-entrypoint-initdb.d rabbitmq 10:43:33.35 INFO ==> Stopping RabbitMQ... rabbitmq 10:43:41.40 INFO ==> ** RabbitMQ setup finished! ** rabbitmq 10:43:41.41 INFO ==> ** Starting RabbitMQ ** 2023-07-11 10:43:45.584550+00:00 [notice] <0.44.0> Application syslog exited with reason: stopped 2023-07-11 10:43:45.592201+00:00 [notice] <0.235.0> Logging: switching to configured handler(s); following messages may not be visible in this log output 2023-07-11 10:43:45.593063+00:00 [notice] <0.235.0> Logging: configured log handlers are now ACTIVE 2023-07-11 10:43:45.983263+00:00 [info] <0.235.0> ra: starting system quorum_queues 2023-07-11 10:43:45.983429+00:00 [info] <0.235.0> starting Ra system: quorum_queues in directory: /bitnami/rabbitmq/mnesia/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local/quorum/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local 2023-07-11 10:43:46.016223+00:00 [info] <0.352.0> ra system 'quorum_queues' running pre init for 0 registered servers 2023-07-11 10:43:46.031513+00:00 [info] <0.353.0> ra: meta data store initialised for system quorum_queues. 0 record(s) recovered 2023-07-11 10:43:46.052120+00:00 [notice] <0.358.0> WAL: ra_log_wal init, open tbls: ra_log_open_mem_tables, closed tbls: ra_log_closed_mem_tables 2023-07-11 10:43:46.063489+00:00 [info] <0.235.0> ra: starting system coordination 2023-07-11 10:43:46.063570+00:00 [info] <0.235.0> starting Ra system: coordination in directory: /bitnami/rabbitmq/mnesia/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local/coordination/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local 2023-07-11 10:43:46.065085+00:00 [info] <0.365.0> ra system 'coordination' running pre init for 0 registered servers 2023-07-11 10:43:46.066428+00:00 [info] <0.366.0> ra: meta data store initialised for system coordination. 0 record(s) recovered 2023-07-11 10:43:46.066653+00:00 [notice] <0.371.0> WAL: ra_coordination_log_wal init, open tbls: ra_coordination_log_open_mem_tables, closed tbls: ra_coordination_log_closed_mem_tables 2023-07-11 10:43:46.072665+00:00 [info] <0.235.0> 2023-07-11 10:43:46.072665+00:00 [info] <0.235.0> Starting RabbitMQ 3.12.1 on Erlang 26.0.1 [jit] 2023-07-11 10:43:46.072665+00:00 [info] <0.235.0> Copyright (c) 2007-2023 VMware, Inc. or its affiliates. 2023-07-11 10:43:46.072665+00:00 [info] <0.235.0> Licensed under the MPL 2.0. Website: https://rabbitmq.com ## ## RabbitMQ 3.12.1 ## ## ########## Copyright (c) 2007-2023 VMware, Inc. or its affiliates. ###### ## ########## Licensed under the MPL 2.0. Website: https://rabbitmq.com Erlang: 26.0.1 [jit] TLS Library: OpenSSL - OpenSSL 1.1.1n 15 Mar 2022 Release series support status: supported Doc guides: https://rabbitmq.com/documentation.html Support: https://rabbitmq.com/contact.html Tutorials: https://rabbitmq.com/getstarted.html Monitoring: https://rabbitmq.com/monitoring.html Logs: Config file(s): /opt/bitnami/rabbitmq/etc/rabbitmq/rabbitmq.conf Starting broker...2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> node : rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> home dir : /opt/bitnami/rabbitmq/.rabbitmq 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> config file(s) : /opt/bitnami/rabbitmq/etc/rabbitmq/rabbitmq.conf 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> cookie hash : DE5rCKv/TRnW+4/HB/IE9g== 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> log(s) : 2023-07-11 10:43:46.074230+00:00 [info] <0.235.0> data dir : /bitnami/rabbitmq/mnesia/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local 2023-07-11 10:43:50.847746+00:00 [info] <0.235.0> Running boot step pre_boot defined by app rabbit 2023-07-11 10:43:50.847856+00:00 [info] <0.235.0> Running boot step rabbit_global_counters defined by app rabbit 2023-07-11 10:43:50.848112+00:00 [info] <0.235.0> Running boot step rabbit_osiris_metrics defined by app rabbit 2023-07-11 10:43:50.848273+00:00 [info] <0.235.0> Running boot step rabbit_core_metrics defined by app rabbit 2023-07-11 10:43:50.849034+00:00 [info] <0.235.0> Running boot step rabbit_alarm defined by app rabbit 2023-07-11 10:43:50.854403+00:00 [info] <0.390.0> Memory high watermark set to 3117 MiB (3269014323 bytes) of 7793 MiB (8172535808 bytes) total 2023-07-11 10:43:50.860065+00:00 [info] <0.392.0> Enabling free disk space monitoring (disk free space: 997719150592, total memory: 8172535808) 2023-07-11 10:43:50.860165+00:00 [info] <0.392.0> Disk free limit set to 50MB 2023-07-11 10:43:50.863142+00:00 [info] <0.235.0> Running boot step code_server_cache defined by app rabbit 2023-07-11 10:43:50.863262+00:00 [info] <0.235.0> Running boot step file_handle_cache defined by app rabbit 2023-07-11 10:43:50.863514+00:00 [info] <0.395.0> Limiting to approx 1048479 file handles (943629 sockets) 2023-07-11 10:43:50.863719+00:00 [info] <0.396.0> FHC read buffering: OFF 2023-07-11 10:43:50.863774+00:00 [info] <0.396.0> FHC write buffering: ON 2023-07-11 10:43:50.864393+00:00 [info] <0.235.0> Running boot step worker_pool defined by app rabbit 2023-07-11 10:43:50.864525+00:00 [info] <0.373.0> Will use 8 processes for default worker pool 2023-07-11 10:43:50.864563+00:00 [info] <0.373.0> Starting worker pool 'worker_pool' with 8 processes in it 2023-07-11 10:43:50.865232+00:00 [info] <0.235.0> Running boot step database defined by app rabbit 2023-07-11 10:43:50.867844+00:00 [info] <0.235.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2023-07-11 10:43:50.871195+00:00 [info] <0.235.0> Successfully synced tables from a peer 2023-07-11 10:43:50.881111+00:00 [info] <0.235.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2023-07-11 10:43:50.881345+00:00 [info] <0.235.0> Successfully synced tables from a peer 2023-07-11 10:43:50.881536+00:00 [info] <0.235.0> Will register with peer discovery backend rabbit_peer_discovery_k8s 2023-07-11 10:43:50.897115+00:00 [info] <0.235.0> Running boot step tracking_metadata_store defined by app rabbit 2023-07-11 10:43:50.897310+00:00 [info] <0.419.0> Setting up a table for connection tracking on this node: tracked_connection 2023-07-11 10:43:50.897422+00:00 [info] <0.419.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost 2023-07-11 10:43:50.897502+00:00 [info] <0.419.0> Setting up a table for per-user connection counting on this node: tracked_connection_per_user 2023-07-11 10:43:50.897567+00:00 [info] <0.419.0> Setting up a table for channel tracking on this node: tracked_channel 2023-07-11 10:43:50.897642+00:00 [info] <0.419.0> Setting up a table for channel tracking on this node: tracked_channel_per_user 2023-07-11 10:43:50.897728+00:00 [info] <0.235.0> Running boot step networking_metadata_store defined by app rabbit 2023-07-11 10:43:50.897907+00:00 [info] <0.235.0> Running boot step feature_flags defined by app rabbit 2023-07-11 10:43:50.898145+00:00 [info] <0.235.0> Running boot step codec_correctness_check defined by app rabbit 2023-07-11 10:43:50.898188+00:00 [info] <0.235.0> Running boot step external_infrastructure defined by app rabbit 2023-07-11 10:43:50.898214+00:00 [info] <0.235.0> Running boot step rabbit_event defined by app rabbit 2023-07-11 10:43:50.898351+00:00 [info] <0.235.0> Running boot step rabbit_registry defined by app rabbit 2023-07-11 10:43:50.898571+00:00 [info] <0.235.0> Running boot step rabbit_auth_mechanism_amqplain defined by app rabbit 2023-07-11 10:43:50.898785+00:00 [info] <0.235.0> Running boot step rabbit_auth_mechanism_cr_demo defined by app rabbit 2023-07-11 10:43:50.898917+00:00 [info] <0.235.0> Running boot step rabbit_auth_mechanism_plain defined by app rabbit 2023-07-11 10:43:50.899046+00:00 [info] <0.235.0> Running boot step rabbit_exchange_type_direct defined by app rabbit 2023-07-11 10:43:50.899163+00:00 [info] <0.235.0> Running boot step rabbit_exchange_type_fanout defined by app rabbit 2023-07-11 10:43:50.899244+00:00 [info] <0.235.0> Running boot step rabbit_exchange_type_headers defined by app rabbit 2023-07-11 10:43:50.899340+00:00 [info] <0.235.0> Running boot step rabbit_exchange_type_topic defined by app rabbit 2023-07-11 10:43:50.899429+00:00 [info] <0.235.0> Running boot step rabbit_mirror_queue_mode_all defined by app rabbit 2023-07-11 10:43:50.899515+00:00 [info] <0.235.0> Running boot step rabbit_mirror_queue_mode_exactly defined by app rabbit 2023-07-11 10:43:50.899660+00:00 [info] <0.235.0> Running boot step rabbit_mirror_queue_mode_nodes defined by app rabbit 2023-07-11 10:43:50.899755+00:00 [info] <0.235.0> Running boot step rabbit_priority_queue defined by app rabbit 2023-07-11 10:43:50.899803+00:00 [info] <0.235.0> Priority queues enabled, real BQ is rabbit_variable_queue 2023-07-11 10:43:50.899863+00:00 [info] <0.235.0> Running boot step rabbit_queue_location_client_local defined by app rabbit 2023-07-11 10:43:50.899968+00:00 [info] <0.235.0> Running boot step rabbit_queue_location_min_masters defined by app rabbit 2023-07-11 10:43:50.900082+00:00 [info] <0.235.0> Running boot step rabbit_queue_location_random defined by app rabbit 2023-07-11 10:43:50.900184+00:00 [info] <0.235.0> Running boot step kernel_ready defined by app rabbit 2023-07-11 10:43:50.900242+00:00 [info] <0.235.0> Running boot step ldap_pool defined by app rabbitmq_auth_backend_ldap 2023-07-11 10:43:50.900296+00:00 [info] <0.373.0> Starting worker pool 'ldap_pool' with 64 processes in it 2023-07-11 10:43:50.903510+00:00 [info] <0.235.0> Running boot step rabbit_sysmon_minder defined by app rabbit 2023-07-11 10:43:50.903858+00:00 [info] <0.235.0> Running boot step rabbit_epmd_monitor defined by app rabbit 2023-07-11 10:43:50.905076+00:00 [info] <0.493.0> epmd monitor knows us, inter-node communication (distribution) port: 25672 2023-07-11 10:43:50.905252+00:00 [info] <0.235.0> Running boot step guid_generator defined by app rabbit 2023-07-11 10:43:50.909529+00:00 [info] <0.235.0> Running boot step rabbit_node_monitor defined by app rabbit 2023-07-11 10:43:50.909886+00:00 [info] <0.497.0> Starting rabbit_node_monitor 2023-07-11 10:43:50.910125+00:00 [info] <0.235.0> Running boot step delegate_sup defined by app rabbit 2023-07-11 10:43:50.910734+00:00 [info] <0.235.0> Running boot step rabbit_memory_monitor defined by app rabbit 2023-07-11 10:43:50.911110+00:00 [info] <0.235.0> Running boot step rabbit_fifo_dlx_sup defined by app rabbit 2023-07-11 10:43:50.911271+00:00 [info] <0.235.0> Running boot step core_initialized defined by app rabbit 2023-07-11 10:43:50.911322+00:00 [info] <0.235.0> Running boot step rabbit_channel_tracking_handler defined by app rabbit 2023-07-11 10:43:50.911475+00:00 [info] <0.235.0> Running boot step rabbit_connection_tracking_handler defined by app rabbit 2023-07-11 10:43:50.911573+00:00 [info] <0.235.0> Running boot step rabbit_definitions_hashing defined by app rabbit 2023-07-11 10:43:50.911710+00:00 [info] <0.235.0> Running boot step rabbit_exchange_parameters defined by app rabbit 2023-07-11 10:43:50.911986+00:00 [info] <0.235.0> Running boot step rabbit_mirror_queue_misc defined by app rabbit 2023-07-11 10:43:50.912299+00:00 [info] <0.235.0> Running boot step rabbit_policies defined by app rabbit 2023-07-11 10:43:50.912598+00:00 [info] <0.235.0> Running boot step rabbit_policy defined by app rabbit 2023-07-11 10:43:50.912702+00:00 [info] <0.235.0> Running boot step rabbit_queue_location_validator defined by app rabbit 2023-07-11 10:43:50.912796+00:00 [info] <0.235.0> Running boot step rabbit_quorum_memory_manager defined by app rabbit 2023-07-11 10:43:50.912838+00:00 [info] <0.235.0> Running boot step rabbit_stream_coordinator defined by app rabbit 2023-07-11 10:43:50.913023+00:00 [info] <0.235.0> Running boot step rabbit_vhost_limit defined by app rabbit 2023-07-11 10:43:50.913096+00:00 [info] <0.235.0> Running boot step rabbit_mgmt_reset_handler defined by app rabbitmq_management 2023-07-11 10:43:50.913146+00:00 [info] <0.235.0> Running boot step rabbit_mgmt_db_handler defined by app rabbitmq_management_agent 2023-07-11 10:43:50.913185+00:00 [info] <0.235.0> Management plugin: using rates mode 'basic' 2023-07-11 10:43:50.913372+00:00 [info] <0.235.0> Running boot step recovery defined by app rabbit 2023-07-11 10:43:50.914261+00:00 [info] <0.534.0> Making sure data directory '/bitnami/rabbitmq/mnesia/rabbit@mq-rabbitmq-0.mq-rabbitmq-headless.default.svc.cluster.local/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists 2023-07-11 10:43:50.921378+00:00 [info] <0.534.0> Starting message stores for vhost '/' 2023-07-11 10:43:50.921789+00:00 [info] <0.544.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index 2023-07-11 10:43:50.925131+00:00 [info] <0.534.0> Started message store of type transient for vhost '/' 2023-07-11 10:43:50.925441+00:00 [info] <0.548.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index 2023-07-11 10:43:50.929441+00:00 [info] <0.534.0> Started message store of type persistent for vhost '/' 2023-07-11 10:43:50.929616+00:00 [info] <0.534.0> Recovering 0 queues of type rabbit_classic_queue took 14ms 2023-07-11 10:43:50.929656+00:00 [info] <0.534.0> Recovering 0 queues of type rabbit_quorum_queue took 0ms 2023-07-11 10:43:50.929680+00:00 [info] <0.534.0> Recovering 0 queues of type rabbit_stream_queue took 0ms 2023-07-11 10:43:50.931654+00:00 [info] <0.235.0> Running boot step empty_db_check defined by app rabbit 2023-07-11 10:43:50.931750+00:00 [info] <0.235.0> Will not seed default virtual host and user: have definitions to load... 2023-07-11 10:43:50.931788+00:00 [info] <0.235.0> Running boot step rabbit_observer_cli defined by app rabbit 2023-07-11 10:43:50.931848+00:00 [info] <0.235.0> Running boot step rabbit_looking_glass defined by app rabbit 2023-07-11 10:43:50.931884+00:00 [info] <0.235.0> Running boot step rabbit_core_metrics_gc defined by app rabbit 2023-07-11 10:43:50.932026+00:00 [info] <0.235.0> Running boot step background_gc defined by app rabbit 2023-07-11 10:43:50.932157+00:00 [info] <0.235.0> Running boot step routing_ready defined by app rabbit 2023-07-11 10:43:50.932195+00:00 [info] <0.235.0> Running boot step pre_flight defined by app rabbit 2023-07-11 10:43:50.932226+00:00 [info] <0.235.0> Running boot step notify_cluster defined by app rabbit 2023-07-11 10:43:50.932287+00:00 [info] <0.235.0> Running boot step networking defined by app rabbit 2023-07-11 10:43:50.932331+00:00 [info] <0.235.0> Running boot step definition_import_worker_pool defined by app rabbit 2023-07-11 10:43:50.932374+00:00 [info] <0.373.0> Starting worker pool 'definition_import_pool' with 8 processes in it 2023-07-11 10:43:50.933137+00:00 [info] <0.235.0> Running boot step cluster_name defined by app rabbit 2023-07-11 10:43:50.933219+00:00 [info] <0.235.0> Running boot step direct_client defined by app rabbit 2023-07-11 10:43:50.933318+00:00 [info] <0.235.0> Running boot step rabbit_maintenance_mode_state defined by app rabbit 2023-07-11 10:43:50.933350+00:00 [info] <0.235.0> Creating table rabbit_node_maintenance_states for maintenance mode status 2023-07-11 10:43:50.933656+00:00 [info] <0.235.0> Running boot step rabbit_management_load_definitions defined by app rabbitmq_management 2023-07-11 10:43:50.933807+00:00 [info] <0.589.0> Resetting node maintenance status 2023-07-11 10:43:50.951050+00:00 [info] <0.648.0> Management plugin: HTTP (non-TLS) listener started on port 15672 2023-07-11 10:43:50.951277+00:00 [info] <0.676.0> Statistics database started. 2023-07-11 10:43:50.951380+00:00 [info] <0.675.0> Starting worker pool 'management_worker_pool' with 3 processes in it 2023-07-11 10:43:50.960381+00:00 [info] <0.691.0> Peer discovery: enabling node cleanup (will only log warnings). Check interval: 10 seconds. 2023-07-11 10:43:50.961381+00:00 [warning] <0.702.0> LDAP plugin loaded, but rabbit_auth_backend_ldap is not in the list of auth_backends. LDAP auth will not work. 2023-07-11 10:43:50.963967+00:00 [info] <0.706.0> Prometheus metrics: HTTP (non-TLS) listener started on port 15692 2023-07-11 10:43:50.964182+00:00 [info] <0.589.0> Ready to start client connection listeners 2023-07-11 10:43:50.966467+00:00 [info] <0.750.0> started TCP listener on [::]:5672 completed with 7 plugins. 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> Server startup complete; 7 plugins started. 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_prometheus 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_auth_backend_ldap 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_peer_discovery_k8s 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_peer_discovery_common 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_management 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_web_dispatch 2023-07-11 10:43:51.077396+00:00 [info] <0.589.0> * rabbitmq_management_agent ```
andresbono commented 1 year ago

To achieve what you want, when installing the chart, you could pass inputs like:

auth:
  username: "user"
  password: "user"
service:
  ports:
    amqp: 5673
    manager: 15673
containerPorts:
  amqp: 5673
  manager: 15673

extraEnvVars:
  - name: RABBITMQ_NODE_PORT_NUMBER
    value: "5673"
  - name: RABBITMQ_MANAGEMENT_PORT_NUMBER
    value: "15673"

extraConfiguration: |-
  management.tcp.port = {{ .Values.containerPorts.manager }}

Then to test it:

$ kubectl logs mq-rabbitmq-0 | grep listener
2023-07-20 16:08:16.339104+00:00 [info] <0.648.0> Management plugin: HTTP (non-TLS) listener started on port 15673
2023-07-20 16:08:16.351180+00:00 [info] <0.750.0> started TCP listener on [::]:5673

$ k exec -it mq-rabbitmq-0 -- curl -I http://mq-rabbitmq-0:5673
$ k exec -it mq-rabbitmq-0 -- curl -I http://mq-rabbitmq-0:15673
HTTP/1.1 200 OK

However, I wonder if it wouldn't be simpler for you to just update the service configuration so the services get exposed in the desired ports and let the container ones untouched so you don't have to worry about the internal configuration. Is there any reason to not simply do this?

auth:
  username: "user"
  password: "user"
service:
  ports:
    amqp: 5673
    manager: 15673
github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.