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

github-runner-scaler is unable to work with custom API endpoint #5387

Closed
Eddman opened this issue Jan 16, 2024 · 0 comments · Fixed by #5384
Closed

github-runner-scaler is unable to work with custom API endpoint #5387

Eddman opened this issue Jan 16, 2024 · 0 comments · Fixed by #5384
Labels
bug Something isn't working

Comments

@Eddman
Copy link
Contributor

Eddman commented Jan 16, 2024

Report

Current github-runner-scaler implementation is unable to use GitHub App private key to authenticate against custom API endpoint, eg. GitHub Enterprise Server (GHES).

Expected Behavior

github-runner-scaler respects custom URL in githubApiURL trigger parameter when appKey is used.

Actual Behavior

github-runner-scaler and the undelying github.com/bradleyfalzon/ghinstallation/v2 tries to use https://api.github.com even if custom URL in githubApiURL trigger parameter is set to our GHES API endpoint.

Steps to Reproduce the Problem

  1. Use githubApiURL and point it to your own GH instance, eg. GHES.
  2. Set applicationID, installationID, and appKey of an GitHub App for authentication.
  3. KEDA fails to authenticate as it always contacts the default public endpoint.

Logs from KEDA operator

2024-01-16T16:49:53Z ERROR github_runner_scaler error getting workflow queue length {"type": "ScaledJob", "namespace": "<some ns>", "name": "github-runner-scaledobject", "error": "Get \"https://<our ghes DNS>/api/v3/repos/<org>/<repo>/actions/runs\": could not refresh installation id 57's token: could not get access_tokens from GitHub API for installation ID 57: read tcp 100.66.130.203:59138->140.82.121.6:443: read: connection reset by peer"}
github.com/kedacore/keda/v2/pkg/scalers.(*githubRunnerScaler).GetMetricsAndActivity
/workspace/pkg/scalers/github_runner_scaler.go:652
github.com/kedacore/keda/v2/pkg/scaling/cache.(*ScalersCache).GetMetricsAndActivityForScaler
/workspace/pkg/scaling/cache/scalers_cache.go:139
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScaledJobMetrics
/workspace/pkg/scaling/scale_handler.go:778
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).isScaledJobActive
/workspace/pkg/scaling/scale_handler.go:807
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers
/workspace/pkg/scaling/scale_handler.go:260
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop
/workspace/pkg/scaling/scale_handler.go:180

Note the target IP: 140.82.121.6:443 -> reverse lookup points to github.com

KEDA Version

2.12.1

Kubernetes Version

1.27

Platform

Google Cloud

Scaler Details

github-runner-scaler

Anything else?

No response

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
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant