-
Notifications
You must be signed in to change notification settings - Fork 497
add documentation for forgejo autoscaler #1577
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for keda ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Thank you for your contribution! 🙏 We will review your PR as soon as possible.
Learn more about:
|
Signed-off-by: jaime merino <[email protected]>
Co-authored-by: ChristopherHX <[email protected]> Signed-off-by: Jaime <[email protected]>
There was a problem hiding this 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
Co-authored-by: ChristopherHX <[email protected]> Signed-off-by: Jaime <[email protected]>
Co-authored-by: ChristopherHX <[email protected]> Signed-off-by: Jaime <[email protected]>
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 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 |
Signed-off-by: jaime merino <[email protected]>
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 |
Added documentation on how to configure and use a forgejo autoescaler
Checklist
Fixes #