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

Custom cluster domain support for other values than cluster.local #4861

Closed
Tracked by #4994
wrdls opened this issue Aug 4, 2023 · 3 comments · Fixed by #5012
Closed
Tracked by #4994

Custom cluster domain support for other values than cluster.local #4861

wrdls opened this issue Aug 4, 2023 · 3 comments · Fixed by #5012
Assignees
Labels
bug Something isn't working feature All issues for new features that have been committed to

Comments

@wrdls
Copy link
Contributor

wrdls commented Aug 4, 2023

Report

Keda doesn't seem to properly support custom cluster domains other than cluster.local (e.g. mycompany.local`).

The chart has a configuration setting for this, but a Github search learns me that this is hardcoded in the code base in a few places, e.g.:

Using CertManager for certs seems to be a workaround for this, but hardcoding cluster.local is simply not valid.

Additionally, validate if the cluster domain is actually needed in every place.
Kubernetes does not depend on FQDNs to resolve services and pods to IP addresses as it will inject custom search domains in /etc/resolv.conf : https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#namespaces-of-services

Expected Behavior

Setting the clusterDomain in the chart leads to correctly auto generated certs.

Actual Behavior

Certificate which is only valid for cluster.local.

Steps to Reproduce the Problem

  1. Deploy a Kubernetes cluster with a custom cluster domain.
  2. Deploy Keda through the Helm chart with default settings except the clusterDomain.
  3. Observe misconfigured certificates being generated.

Logs from KEDA operator

keda-operator-metrics-apiserver-5c57dfdbc4-qhj6w keda-operator-metrics-apiserver 2023-08-03T17:02:34.665892547+02:00 W0803 15:02:34.665790       1 logging.go:59] [core] [Channel #1 SubChannel #2] grpc: addrConn.createTransport failed to connect to {Addr: "keda-operator.keda.svc.mycompany.local:9666", ServerName: "keda-operator.keda.svc.mycompany.local:9666", }. Err: connection error: desc = "transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate is valid for keda-operator, keda-operator, keda-operator.keda, keda-operator.keda.svc, keda-operator.keda.svc.local, keda-operator.keda.svc.cluster.local, keda-admission-webhooks, keda-admission-webhooks.keda, keda-admission-webhooks.keda.svc, keda-admission-webhooks.keda.svc.local, keda-admission-webhooks.keda.svc.cluster.local, keda-operator-metrics-apiserver, keda-operator-metrics-apiserver.keda, keda-operator-metrics-apiserver.keda.svc, keda-operator-metrics-apiserver.keda.svc.local, keda-operator-metrics-apiserver.keda.svc.cluster.local, not keda-operator.keda.svc.mycompany.local"

KEDA Version

2.11.2

Kubernetes Version

1.25

Platform

Google Cloud

Scaler Details

N/A

Anything else?

No response

@wrdls wrdls added the bug Something isn't working label Aug 4, 2023
@tomkerkhove tomkerkhove added the feature All issues for new features that have been committed to label Aug 10, 2023
@tomkerkhove tomkerkhove moved this from To Triage to To Do in Roadmap - KEDA Core Aug 10, 2023
@tomkerkhove
Copy link
Member

Yeah, let's fix this - Are you willing to contribute this?

@vitordeap
Copy link

vitordeap commented Sep 27, 2023

Up! With the same issue.. It seems an overkill to deploy the certificate manager only to allow this.. It seems that there is a script inside the operator that creates a certificate (when the certificate manager is disabled) that is simply not considering the clusterDomain value. I think this is the file, it seems that the function getDNSNames is hardcoding the domains, but I'm no expert in go :(

@Shrooblord
Copy link

Beautiful! I ran into this problem when operating KEDA in a cluster with a custom domain. I had to reinstall the Helm chart using the clusterDomain value, and delete the keda/kedaorg-certs secret to force a regeneration of the certs. (I'd get "cert invalid for this domain" type of errors in keda-operator-metrics-apiserver otherwise, even after a fresh uninstall and reinstall -- secret was left behind from prior installation).

All works now! Thanks for pointing me in the right direction :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature All issues for new features that have been committed to
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants