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

chore: DENA-658 - new bases for github-arc #347

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
28 changes: 28 additions & 0 deletions github-arc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.DEFAULT_GOAL := get-upstream

VERSION=0.9.3

.PHONY: get-upstream
get-upstream:
curl -Ls -O --output-dir cluster/upstream https://raw.githubusercontent.com/actions/actions-runner-controller/gha-runner-scale-set-$(VERSION)/charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalinglisteners.yaml
curl -Ls -O --output-dir cluster/upstream https://raw.githubusercontent.com/actions/actions-runner-controller/gha-runner-scale-set-$(VERSION)/charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalingrunnersets.yaml
curl -Ls -O --output-dir cluster/upstream https://raw.githubusercontent.com/actions/actions-runner-controller/gha-runner-scale-set-$(VERSION)/charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunners.yaml
curl -Ls -O --output-dir cluster/upstream https://raw.githubusercontent.com/actions/actions-runner-controller/gha-runner-scale-set-$(VERSION)/charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunnersets.yaml

helm template arc --namespace sys-actions -f controller/values.yaml oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller --version $(VERSION) > /tmp/ark-controller.yaml

yq 'select(.kind=="ClusterRole")' /tmp/ark-controller.yaml > cluster/upstream/clusterrole.yaml
yq 'select(.kind=="ClusterRoleBinding")' /tmp/ark-controller.yaml > cluster/upstream/clusterrolebinding.yaml

yq 'select(.kind=="Deployment")' /tmp/ark-controller.yaml > controller/upstream/deployment.yaml
yq 'select(.kind=="Role")' /tmp/ark-controller.yaml > controller/upstream/role.yaml
yq 'select(.kind=="RoleBinding")' /tmp/ark-controller.yaml > controller/upstream/rolebinding.yaml
yq 'select(.kind=="ServiceAccount")' /tmp/ark-controller.yaml > controller/upstream/serviceaccount.yaml

# Remove the "namespace" attribute so we can easily re-use the base in other namespaces
helm template arc-runners -f runner/values-kubernetes.yaml oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set --version $(VERSION) | sd "^\s*namespace: default\n" "" > /tmp/ark-runner.yaml

yq 'select(.kind=="ServiceAccount")' /tmp/ark-runner.yaml > runner/upstream/serviceaccount.yaml
yq 'select(.kind=="Role")' /tmp/ark-runner.yaml > runner/upstream/role.yaml
yq 'select(.kind=="RoleBinding")' /tmp/ark-runner.yaml > runner/upstream/rolebinding.yaml
yq 'select(.kind=="AutoscalingRunnerSet")' /tmp/ark-runner.yaml > runner/upstream/autoscalingrunnerset.yaml
9 changes: 9 additions & 0 deletions github-arc/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- upstream/actions.github.com_autoscalinglisteners.yaml
- upstream/actions.github.com_autoscalingrunnersets.yaml
- upstream/actions.github.com_ephemeralrunners.yaml
- upstream/actions.github.com_ephemeralrunnersets.yaml
- upstream/clusterrole.yaml
- upstream/clusterrolebinding.yaml
7,009 changes: 7,009 additions & 0 deletions github-arc/cluster/upstream/actions.github.com_autoscalinglisteners.yaml

Large diffs are not rendered by default.

13,848 changes: 13,848 additions & 0 deletions github-arc/cluster/upstream/actions.github.com_autoscalingrunnersets.yaml

Large diffs are not rendered by default.

7,018 changes: 7,018 additions & 0 deletions github-arc/cluster/upstream/actions.github.com_ephemeralrunners.yaml

Large diffs are not rendered by default.

6,989 changes: 6,989 additions & 0 deletions github-arc/cluster/upstream/actions.github.com_ephemeralrunnersets.yaml

Large diffs are not rendered by default.

143 changes: 143 additions & 0 deletions github-arc/cluster/upstream/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Source: gha-runner-scale-set-controller/templates/manager_cluster_role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: arc-gha-rs-controller
rules:
- apiGroups:
- actions.github.com
resources:
- autoscalingrunnersets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- actions.github.com
resources:
- autoscalingrunnersets/finalizers
verbs:
- patch
- update
- apiGroups:
- actions.github.com
resources:
- autoscalingrunnersets/status
verbs:
- get
- patch
- update
- apiGroups:
- actions.github.com
resources:
- autoscalinglisteners
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- actions.github.com
resources:
- autoscalinglisteners/status
verbs:
- get
- patch
- update
- apiGroups:
- actions.github.com
resources:
- autoscalinglisteners/finalizers
verbs:
- patch
- update
- apiGroups:
- actions.github.com
resources:
- ephemeralrunnersets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- actions.github.com
resources:
- ephemeralrunnersets/status
verbs:
- get
- patch
- update
- apiGroups:
- actions.github.com
resources:
- ephemeralrunnersets/finalizers
verbs:
- patch
- update
- apiGroups:
- actions.github.com
resources:
- ephemeralrunners
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- actions.github.com
resources:
- ephemeralrunners/finalizers
verbs:
- patch
- update
- apiGroups:
- actions.github.com
resources:
- ephemeralrunners/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
verbs:
- list
- watch
- patch
13 changes: 13 additions & 0 deletions github-arc/cluster/upstream/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Source: gha-runner-scale-set-controller/templates/manager_cluster_role_binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: arc-gha-rs-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arc-gha-rs-controller
subjects:
- kind: ServiceAccount
name: arc-gha-rs-controller
namespace: sys-actions
7 changes: 7 additions & 0 deletions github-arc/controller/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- upstream/deployment.yaml
- upstream/rolebinding.yaml
- upstream/role.yaml
- upstream/serviceaccount.yaml
67 changes: 67 additions & 0 deletions github-arc/controller/upstream/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Source: gha-runner-scale-set-controller/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: arc-gha-rs-controller
namespace: sys-actions
labels:
helm.sh/chart: gha-rs-controller-0.9.3
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/namespace: sys-actions
app.kubernetes.io/instance: arc
app.kubernetes.io/version: "0.9.3"
app.kubernetes.io/part-of: gha-rs-controller
app.kubernetes.io/managed-by: Helm
actions.github.com/controller-service-account-namespace: sys-actions
actions.github.com/controller-service-account-name: arc-gha-rs-controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/namespace: sys-actions
app.kubernetes.io/instance: arc
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: "manager"
labels:
app.kubernetes.io/part-of: gha-rs-controller
app.kubernetes.io/component: controller-manager
app.kubernetes.io/version: 0.9.3
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/namespace: sys-actions
app.kubernetes.io/instance: arc
spec:
serviceAccountName: arc-gha-rs-controller
containers:
- name: manager
image: "ghcr.io/actions/gha-runner-scale-set-controller:0.9.3"
imagePullPolicy: IfNotPresent
args:
- "--auto-scaling-runner-set-only"
- "--log-level=debug"
- "--log-format=text"
- "--update-strategy=immediate"
- "--listener-metrics-addr=0"
- "--listener-metrics-endpoint="
- "--metrics-addr=0"
command:
- "/manager"
env:
- name: CONTROLLER_MANAGER_CONTAINER_IMAGE
value: "ghcr.io/actions/gha-runner-scale-set-controller:0.9.3"
- name: CONTROLLER_MANAGER_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
limits:
memory: 512Mi
volumeMounts:
- mountPath: /tmp
name: tmp
terminationGracePeriodSeconds: 10
volumes:
- name: tmp
emptyDir: {}
41 changes: 41 additions & 0 deletions github-arc/controller/upstream/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Source: gha-runner-scale-set-controller/templates/manager_listener_role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: arc-gha-rs-controller-listener
namespace: sys-actions
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- apiGroups:
- ""
resources:
- pods/status
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- patch
- update
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- delete
- get
- patch
- update
14 changes: 14 additions & 0 deletions github-arc/controller/upstream/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Source: gha-runner-scale-set-controller/templates/manager_listener_role_binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: arc-gha-rs-controller-listener
namespace: sys-actions
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: arc-gha-rs-controller-listener
subjects:
- kind: ServiceAccount
name: arc-gha-rs-controller
namespace: sys-actions
15 changes: 15 additions & 0 deletions github-arc/controller/upstream/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Source: gha-runner-scale-set-controller/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: arc-gha-rs-controller
namespace: sys-actions
labels:
helm.sh/chart: gha-rs-controller-0.9.3
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/namespace: sys-actions
app.kubernetes.io/instance: arc
app.kubernetes.io/version: "0.9.3"
app.kubernetes.io/part-of: gha-rs-controller
app.kubernetes.io/managed-by: Helm
23 changes: 23 additions & 0 deletions github-arc/controller/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
replicaCount: 1

image:
repository: "ghcr.io/actions/gha-runner-scale-set-controller"
tag: ""

nameOverride: ""
fullnameOverride: ""

env:

resources:
limits:
memory: 512Mi

serviceAccount:
create: true
name: ""

flags:
logLevel: "debug"
logFormat: "text"
updateStrategy: "immediate"
7 changes: 7 additions & 0 deletions github-arc/runner/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- upstream/autoscalingrunnerset.yaml
- upstream/role.yaml
- upstream/rolebinding.yaml
- upstream/serviceaccount.yaml
Loading
Loading