mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-15 06:26:57 +00:00
helm charts for actions runner (#1375)
Fixes: #942 helm charts for actions runner, currently its having only RunnerDeployment and Autoscaler resources. Looks like deployment order is important here, facing the below issue if Autoscaler deployed first and then autoscaling not working as expected. ``` 2022-04-21T12:13:08Z DEBUG controllers.webhookbasedautoscaler RunnerDeployment not found with scale target ref name test-actions-runner for hra test-actions-runner-autoscaler ``` Helm doesn't support [ordering](https://github.com/helm/helm/issues/8439) for custom resources. So using List to overcome this issue, didn't use helm chart hooks for ordering since its not [tracked](https://helm.sh/docs/topics/charts_hooks/#hook-resources-are-not-managed-with-corresponding-releases) after creation. Co-authored-by: Josh Feierman <joshua.feierman@warnermedia.com> Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5fd6ec4bc8
commit
3ca96557a6
96
contrib/examples/actions-runner/templates/deployment.yaml
Normal file
96
contrib/examples/actions-runner/templates/deployment.yaml
Normal file
@@ -0,0 +1,96 @@
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
items:
|
||||
- apiVersion: actions.summerwind.dev/v1alpha1
|
||||
kind: RunnerDeployment
|
||||
metadata:
|
||||
name: {{ include "actions-runner.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "actions-runner.labels" . | nindent 6 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaler.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "actions-runner.selectorLabels" . | nindent 8 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
kubectl.kubernetes.io/default-logs-container: "runner"
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "actions-runner.selectorLabels" . | nindent 10 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 10 }}
|
||||
{{- with .Values.priorityClassName }}
|
||||
priorityClassName: "{{ . }}"
|
||||
{{- end }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (cat "v" .Chart.AppVersion | replace " " "") }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- if .Values.organization }}
|
||||
organization: {{ .Values.organization }}
|
||||
{{- end }}
|
||||
{{- if .Values.repository }}
|
||||
repository: {{ .Values.repository }}
|
||||
{{- end }}
|
||||
group: {{ .Values.group | default "Default" }}
|
||||
{{- with .Values.runnerLabels }}
|
||||
labels:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.env }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaler.enabled }}
|
||||
- apiVersion: actions.summerwind.dev/v1alpha1
|
||||
kind: HorizontalRunnerAutoscaler
|
||||
metadata:
|
||||
name: {{ (list (include "actions-runner.fullname" .) "autoscaler" | join "-") }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "actions-runner.labels" . | nindent 6 }}
|
||||
spec:
|
||||
{{- if .Values.autoscaler.scaleDownDelaySecondsAfterScaleOut }}
|
||||
scaleDownDelaySecondsAfterScaleOut: {{ .Values.autoscaler.scaleDownDelaySecondsAfterScaleOut }}
|
||||
{{- end }}
|
||||
scaleTargetRef:
|
||||
name: {{ include "actions-runner.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaler.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaler.maxReplicas }}
|
||||
{{- with .Values.autoscaler.scaleUpTriggers }}
|
||||
scaleUpTriggers:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.autoscaler.metrics }}
|
||||
metrics:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user