Skip to content

Conversation

cobak78
Copy link

@cobak78 cobak78 commented Jun 5, 2025

Added documentation on how to configure and use a forgejo autoescaler

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)

Fixes #

@cobak78 cobak78 requested a review from a team as a code owner June 5, 2025 14:39
Copy link

netlify bot commented Jun 5, 2025

Deploy Preview for keda ready!

Name Link
🔨 Latest commit aa39585
🔍 Latest deploy log https://app.netlify.com/projects/keda/deploys/68b55241db22f80008c72e00
😎 Deploy Preview https://deploy-preview-1577--keda.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

github-actions bot commented Jun 5, 2025

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

  • Add your contribution to all applicable KEDA versions
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Learn more about:

jaime merino and others added 2 commits June 10, 2025 08:58
Copy link

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know 3 weeks passed, but my workload didn't allow to take a deeper look at your change on a repository where I am not maintainer of

I will try today to use your instruction to setup for my first time ever forgejo locally including your scaler, then I might provide some feedback how this goes.

My knowledge of Forgejo ends where it diverges from Gitea and I just realized that I need to build your branch of keda first, since my keda experiments with Gitea used the existing github_runner scaler that is part of keda for long

cobak78 and others added 2 commits July 1, 2025 16:40
Co-authored-by: ChristopherHX <[email protected]>
Signed-off-by: Jaime <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Signed-off-by: Jaime <[email protected]>
@ChristopherHX
Copy link

I got the following example scalejob working using docker labels and dind, the current example here seems to be broken on my end.

E.g. Require existing PVC with a .runner file and ignoreing the config map

apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
  labels:
    app: forgejo-runner
  name: forgejo-runner
  namespace: runners
spec:
  jobTargetRef:
    template:
      metadata:
        labels:
          app: forgejo-runner
      spec:
        restartPolicy: Never
        shareProcessNamespace: true
        volumes:
        - name: runner-config
          configMap:
            name: runner-config
        - name: runner-data
          emptyDir: {}  # ephemeral, writable storage
        - name: docker-graph-storage
          emptyDir: {}
        - name: docker-certs
          emptyDir: {}
        initContainers:
        - name: copy-config
          image: code.forgejo.org/forgejo/runner:6.3.1
          command: ["sh", "-c", "cp /config/.runner /data/"]
          volumeMounts:
          - name: runner-config
            mountPath: /config
          - name: runner-data
            mountPath: /data
        containers:
        - name: runner
          image: code.forgejo.org/forgejo/runner:6.3.1
          command:
          - "sh"
          - "-c"
          - |
            trap 'pkill -SIGINT dockerd' EXIT

            while ! nc -z localhost 2376; do
              echo "Waiting for TCP port 2376..."
              sleep 1
            done

            echo "Port 2376 is open!"
            forgejo-runner one-job
          env:
          - name: DOCKER_HOST
            value: "tcp://localhost:2376"
          - name: DOCKER_TLS_VERIFY
            value: "1"
          - name: DOCKER_CERT_PATH
            value: /certs/client
          securityContext: # for "pkill -SIGINT dockerd", docker:dind-rootless do not need this, however this fails for me during container creation
            runAsUser: 0
            runAsGroup: 0
          volumeMounts:
          - name: runner-data
            mountPath: /data
          - name: docker-certs
            mountPath: /certs/client
        - name: docker
          image: docker:dind
          securityContext:
            privileged: true
          volumeMounts:
            - name: docker-graph-storage
              mountPath: /var/lib/docker
            - name: docker-certs
              mountPath: /certs/client
  minReplicaCount: 0
  maxReplicaCount: 20
  pollingInterval: 30
  triggers:
  - type: forgejo-runner
    metadata:
      name: "forgejo-runner-ubuntu"
      token: "6866a82995c4509b77669100a8e8dba70f7f4151"
      address: "http://x.x.x.x:3000/"
      global: "true" ## optional
      owner: "" ## optional
      repo: "" ## optional
      labels: "ubuntu-latest"

One disadvantage for my internet speed is, no image cache

@cobak78
Copy link
Author

cobak78 commented Aug 26, 2025

Thanks for the review and sorry for the delay, i changed a bit how the config and registration works to avoid using PVC and just make configmap works, also add some documentation on how to make it work with docker in docker capabilities to build and push images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants