# apiVersion: actions.summerwind.dev/v1alpha1
# kind: RunnerDeployment
# metadata:
#   name: tidbcloud-runners
#   namespace: actions-runner-system
# spec:
#   template:
#     spec:
#       # image: summerwind/actions-runner:latest
#       image: 385595570414.dkr.ecr.us-west-2.amazonaws.com/dbaas/cicd/actions-runner:v0.1.0
#       imagePullPolicy: IfNotPresent
#       organization: tidbcloud
#       resources:
#         limits:
#           cpu: "1"
#         requests:
#           cpu: "1"
#       serviceAccountName: action-runner-cicd-role
#       securityContext:
#         fsGroup: 1000
#       # labels:
#       #   - dev-hosted

# ---

# apiVersion: actions.summerwind.dev/v1alpha1
# kind: HorizontalRunnerAutoscaler
# metadata:
#   name: tidbcloud-runners
#   namespace: actions-runner-system
# spec:
#   scaleTargetRef:
#     name: tidbcloud-runners
#   minReplicas: 0
#   maxReplicas: 0
#   scaleDownDelaySecondsAfterScaleOut: 60  # Runners in the targeted RunnerDeployment won't be scaled down for 1 minutes instead of the default 10 minutes now
#   metrics:
#   - type: PercentageRunnersBusy
#     scaleUpThreshold: '0.75'              # The percentage of busy runners at which the number of desired runners are re-evaluated to scale up
#     scaleDownThreshold: '0.25'            # The percentage of busy runners at which the number of desired runners are re-evaluated to scale down
#     scaleUpAdjustment: 2                  # The scale up runner count added to desired count
#     scaleDownAdjustment: 2                # The scale down runner count subtracted from the desired count
#   scaleUpTriggers:
#   - githubEvent:                          # scales by [amount] replica for [duration] minutes on each check_run event with the type of [type] and the status of [status] received.
#       checkRun:
#         types: ["created"]
#         status: "queued"
#     amount: 2
#     duration: "5m"                        # calculate if the replica number added via the trigger is expired or not

# ---

# Above Reference: https://github.com/actions-runner-controller/actions-runner-controller
