# apiVersion: actions.summerwind.dev/v1alpha1
# kind: RunnerDeployment
# metadata:
#   name: tidbcloud-org-arm-infra-runners
#   namespace: actions-runner-system
# spec:
#   template:
#     spec:
#       dockerdContainerResources: {}
#       image: ""
#       imagePullPolicy: IfNotPresent
#       repository: tidbcloud/aws-shared-provider
#       nodeSelector:
#         cloud.google.com/gke-spot: "true"
#         cicd/common-runner-resource: "true"
#         kubernetes.io/arch: "arm64"
#       resources:
#         limits:
#           cpu: 2
#           memory: 7Gi
#         requests:
#           cpu: 1
#           memory: 3Gi
#       env:
#       - name: AWS_WEB_IDENTITY_TOKEN_FILE
#         value: /identity/token
#       volumeMounts:
#       - name: identity
#         mountPath: /identity
#       volumes:
#       - emptyDir: {}
#         name: identity
#       sidecarContainers:
#       - env:
#         - name: AWS_WEB_IDENTITY_TOKEN_FILE
#           value: /identity/token
#         image: gcr.io/pingcap-gardener/jenkins/gcp-web-identity:20221019
#         imagePullPolicy: IfNotPresent
#         resources: {}
#         name: auth
#         volumeMounts:
#         - mountPath: /identity
#           name: identity

# ---

# apiVersion: actions.summerwind.dev/v1alpha1
# kind: HorizontalRunnerAutoscaler
# metadata:
#   name: tidbcloud-org-arm-infra-runners
#   namespace: actions-runner-system
# spec:
#   scaleTargetRef:
#     name: tidbcloud-org-arm-infra-runners
#   minReplicas: 2
#   maxReplicas: 3
#   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

# ---
