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

RabbitMQ Scalers -issues in connecting with TLS enabled #967

Closed
maverickmetro opened this issue Aug 3, 2020 · 7 comments
Closed

RabbitMQ Scalers -issues in connecting with TLS enabled #967

maverickmetro opened this issue Aug 3, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@maverickmetro
Copy link

maverickmetro commented Aug 3, 2020

When we have a TLS enabled Rabbit MQ service hosted in the cloud, Rabbit MQ scaler is not able to connect to the Rabbit MQ host Receiving the below error in Keda Operator API service pod . In Rabbit MQ Scaler i used the apiHost parameter with https protocol.

E0803 23:09:48.173311       1 provider.go:94] keda_metrics_adapter/provider "msg"="error getting metric for scaler" "error"="error inspecting rabbitMQ: Get \"https://ibm_cloud_26d26b44_4a05_4a02_a7fd_3423c5f6a4f7:***@a5adefe4-8087-450a-83c9-113f3de3b9b0.8117147f814b4b2ea643610826cd2046.databases.appdomain.cloud:30347/api/queues/%2F/KedaTestQueue\": x509: certificate signed by unknown authority"  "ScaledObject.Name"="keda-sample" "ScaledObject.Namespace"="default" "Scaler"={}
E0803 23:09:48.173371       1 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"No matching metrics found for queuelength"}

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

  1. Install Rabbit MQ with TLS enabled
  2. Install Keda
  3. Configure Rabbit MQ scaler scaled object to use apiHost Parameter with https protocol.

Sample Scaled Object Yaml:

apiVersion: v1
kind: Secret
metadata:
  name: rabbitmq-consumer-secret
data:
  RabbitHttpHost: xxxxxxxxxxx #https://XXXXXXXXXXXXX
---
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
  name: keda-sample
  namespace: default
  labels:
    deploymentName: keda-sample
spec:
  scaleTargetRef:
    deploymentName: keda-sample
  pollingInterval: 5 # Optional. Default: 30 seconds
  cooldownPeriod: 30 # Optional. Default: 300 seconds
  minReplicaCount: 1
  maxReplicaCount: 5 # Optional. Default: 100
  triggers:
    - type: rabbitmq
      metadata:
        includeUnacked: "true"
        queueName: KedaTestQueue
        queueLength: "5"
        
      authenticationRef:
        name: rabbitmq-consumer-trigger
---
apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
  name: rabbitmq-consumer-trigger
  namespace: default
spec:
  secretTargetRef:
    - parameter: apiHost
      name: rabbitmq-consumer-secret
      key: RabbitHttpHost

---

Specifications

  • KEDA Version: 1.5.0
  • Platform & Version: IBM public Cloud
  • Kubernetes Version: 1.15.12
  • Scaler(s): RabbitMQ Scaler

// EDIT: fixed formating (Zbynek)

@maverickmetro maverickmetro added the bug Something isn't working label Aug 3, 2020
@zroubalik
Copy link
Member

zroubalik commented Aug 4, 2020

I have done a quick check and RabbitMQ Scaler TLS support is not implemented yet. https://github.com/kedacore/keda/blob/v2/pkg/scalers/rabbitmq_scaler.go#L138 this would need to use amq.DialTLS(). And consume the ceritficate the similar way it has been done for example in Kafka Scaler.

@maverickmetro is this something you are willing to contribute?

@ansonauhk
Copy link

Please review, I submitted a fix
code - #1051
doc - kedacore/keda-docs#240

@zroubalik zroubalik added this to the v2.0 milestone Sep 2, 2020
ansonauhk added a commit to ansonauhk/keda that referenced this issue Sep 3, 2020
Signed-off-by: Anson Au <ansonau@gmail.com>
@tomkerkhove tomkerkhove removed this from the v2.0 milestone Jan 6, 2021
@stale
Copy link

stale bot commented Oct 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Oct 13, 2021
@stale
Copy link

stale bot commented Oct 20, 2021

This issue has been automatically closed due to inactivity.

@debu99
Copy link

debu99 commented Oct 29, 2022

Why this is solved? i didn't see the code merge

@mohite-abhi
Copy link
Contributor

I have added tls support for RabbitMQ getting inspiration from above MR, it's working for me. I would like to add it with Keda code. Can we reopen this issue, or should I create a new issue regarding it?

@tomkerkhove tomkerkhove reopened this Jan 6, 2023
@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Jan 6, 2023
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 10, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 10, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 12, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 16, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 16, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
mohite-abhi added a commit to mohite-abhi/keda that referenced this issue Jan 17, 2023
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
JorTurFer pushed a commit that referenced this issue Jan 17, 2023
* Add support for tls in rabbitmq scaler (#967)

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Add tests

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Add suggested changes

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: linting errors

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Fix: failing test

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
@mohite-abhi
Copy link
Contributor

this issue is tracking some other closed pr when it should have been closed by #4086 merge.

SpiritZhou pushed a commit to SpiritZhou/keda that referenced this issue Jul 18, 2023
* added couchdb docs

Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com>

* added connection string

Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com>

* fixed host name

Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com>

Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com>
SpiritZhou pushed a commit to SpiritZhou/keda that referenced this issue Jul 18, 2023
* Add tls auth doc for rabbitmq scaler (kedacore#967)

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>

* Update content/docs/2.10/scalers/rabbitmq-queue.md

Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Abhishek Mohite <abhishekmohite421@gmail.com>

Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
Signed-off-by: Abhishek Mohite <abhishekmohite421@gmail.com>
Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants