Skip to content

Commit

Permalink
Implement chart version control
Browse files Browse the repository at this point in the history
  • Loading branch information
electrocucaracha committed Dec 31, 2024
1 parent 4f0084b commit 438fed8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _chart_installers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ function _install_chart {
if [ -n "${KRD_CHART_FILE-}" ]; then
cmd+=" --values $KRD_CHART_FILE"
fi
if [ -n "${KRD_CHART_VERSION-}" ]; then
cmd+=" --version $KRD_CHART_VERSION"
fi
eval "$cmd" "$name" "$chart"
fi

Expand Down Expand Up @@ -273,25 +276,26 @@ function _install_chart_k8sgpt-operator {
}

function _install_arc_controller {
_install_chart arc oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
KRD_CHART_VERSION=$(_get_version action_runner_controller) _install_chart arc oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
}

# install_arc() - Install Actions Runner
function install_chart_arc {
action_runner_controller_version=$(_get_version action_runner_controller)
! kubectl get crds autoscalinglisteners.actions.github.com >/dev/null && _install_arc_controller

namespace="${KRD_ARC_GITHUB_URL##*/}"
KRD_CHART_VALUES="githubConfigUrl=$KRD_ARC_GITHUB_URL,githubConfigSecret=gh-runners-token"
! kubectl get namespaces "${namespace}" && kubectl create namespace "${namespace}"
! kubectl get secrets -n "${namespace}" gh-runners-token && kubectl -n "${namespace}" create secret generic gh-runners-token --from-literal=github_token="$KRD_ARC_TOKEN"
! helm get metadata arc-runner-set -n "${namespace}" >/dev/null && _install_chart self-hosted oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set "$namespace" "false"
! helm get metadata arc-runner-set -n "${namespace}" >/dev/null && KRD_CHART_VERSION="$action_runner_controller_version" _install_chart self-hosted oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set "$namespace" "false"
if kubectl get crds virtualmachines.kubevirt.io >/dev/null; then
kubectl apply -f resources/kubevirt-runner/rbac.yml -n "$namespace"
kubectl create rolebinding kubevirt-actions-runner -n "$namespace" --serviceaccount "${namespace}:kubevirt-actions-runner" --role=kubevirt-actions-runner || :
kubectl create rolebinding "${namespace}-default-cdi-cloner" --serviceaccount "${namespace}:default" --clusterrole=cdi-cloner || :
kubectl create rolebinding "${namespace}-kubevirt-actions-runner-cdi-cloner" --serviceaccount "${namespace}:kubevirt-actions-runner" --clusterrole=cdi-cloner || :
kubectl apply -f resources/kubevirt-runner/vm.yml -n "$namespace"
KRD_CHART_FILE="helm/arc/ubuntu-jammy-values.yml" _install_chart vm-self-hosted oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set "$namespace" "false"
KRD_CHART_VERSION="$action_runner_controller_version" KRD_CHART_FILE="helm/arc/ubuntu-jammy-values.yml" _install_chart vm-self-hosted oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set "$namespace" "false"
fi
}

Expand Down
1 change: 1 addition & 0 deletions playbooks/krd-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ qat_plugin_version: "0.15.0"
argocd_version: v2.13.1
tekton_version: v0.74.0
kubevirt_tekton_tasks_version: v0.22.0
action_runner_controller_version: 0.10.1

0 comments on commit 438fed8

Please sign in to comment.