mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-01-06 09:57:22 +08:00
* Adding a default docker registry mirror This change allows the controller to start with a specified default docker registry mirror and avoid having to specify it in all the runner* objects. The change is backward compatible, if a runner has a docker registry mirror specified, it will supersede the default one.
156 lines
5.5 KiB
YAML
156 lines
5.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "actions-runner-controller.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "actions-runner-controller.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "actions-runner-controller.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "actions-runner-controller.selectorLabels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "actions-runner-controller.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- with .Values.priorityClassName }}
|
|
priorityClassName: "{{ . }}"
|
|
{{- end }}
|
|
containers:
|
|
- args:
|
|
{{- $metricsHost := .Values.metrics.proxy.enabled | ternary "127.0.0.1" "0.0.0.0" }}
|
|
{{- $metricsPort := .Values.metrics.proxy.enabled | ternary "8080" .Values.metrics.port }}
|
|
- "--metrics-addr={{ $metricsHost }}:{{ $metricsPort }}"
|
|
- "--enable-leader-election"
|
|
- "--sync-period={{ .Values.syncPeriod }}"
|
|
- "--docker-image={{ .Values.image.dindSidecarRepositoryAndTag }}"
|
|
- "--runner-image={{ .Values.image.actionsRunnerRepositoryAndTag }}"
|
|
{{- if .Values.dockerRegistryMirror }}
|
|
- "--docker-registry-mirror={{ .Values.dockerRegistryMirror }}"
|
|
{{- end }}
|
|
{{- if .Values.scope.singleNamespace }}
|
|
- "--watch-namespace={{ default .Release.Namespace .Values.scope.watchNamespace }}"
|
|
{{- end }}
|
|
{{- if .Values.githubAPICacheDuration }}
|
|
- "--github-api-cache-duration={{ .Values.githubAPICacheDuration }}"
|
|
{{- end }}
|
|
{{- if .Values.logLevel }}
|
|
- "--log-level={{ .Values.logLevel }}"
|
|
{{- end }}
|
|
command:
|
|
- "/manager"
|
|
env:
|
|
{{- if .Values.githubEnterpriseServerURL }}
|
|
- name: GITHUB_ENTERPRISE_URL
|
|
value: {{ .Values.githubEnterpriseServerURL }}
|
|
{{- end }}
|
|
- name: GITHUB_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: github_token
|
|
name: {{ include "actions-runner-controller.secretName" . }}
|
|
optional: true
|
|
- name: GITHUB_APP_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: github_app_id
|
|
name: {{ include "actions-runner-controller.secretName" . }}
|
|
optional: true
|
|
- name: GITHUB_APP_INSTALLATION_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: github_app_installation_id
|
|
name: {{ include "actions-runner-controller.secretName" . }}
|
|
optional: true
|
|
- name: GITHUB_APP_PRIVATE_KEY
|
|
value: /etc/actions-runner-controller/github_app_private_key
|
|
{{- range $key, $val := .Values.env }}
|
|
- name: {{ $key }}
|
|
value: {{ $val | quote }}
|
|
{{- end }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (cat "v" .Chart.AppVersion | replace " " "") }}"
|
|
name: manager
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: 9443
|
|
name: webhook-server
|
|
protocol: TCP
|
|
{{- if not .Values.metrics.proxy.enabled }}
|
|
- containerPort: {{ .Values.metrics.port }}
|
|
name: metrics-port
|
|
protocol: TCP
|
|
{{- end }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: "/etc/actions-runner-controller"
|
|
name: secret
|
|
readOnly: true
|
|
- mountPath: /tmp
|
|
name: tmp
|
|
- mountPath: /tmp/k8s-webhook-server/serving-certs
|
|
name: cert
|
|
readOnly: true
|
|
{{- if .Values.metrics.proxy.enabled }}
|
|
- args:
|
|
- "--secure-listen-address=0.0.0.0:{{ .Values.metrics.port }}"
|
|
- "--upstream=http://127.0.0.1:8080/"
|
|
- "--logtostderr=true"
|
|
- "--v=10"
|
|
image: "{{ .Values.metrics.proxy.image.repository }}:{{ .Values.metrics.proxy.image.tag }}"
|
|
name: kube-rbac-proxy
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: {{ .Values.metrics.port }}
|
|
name: metrics-port
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
{{- end }}
|
|
terminationGracePeriodSeconds: 10
|
|
volumes:
|
|
- name: secret
|
|
secret:
|
|
secretName: {{ include "actions-runner-controller.secretName" . }}
|
|
- name: cert
|
|
secret:
|
|
defaultMode: 420
|
|
secretName: webhook-server-cert
|
|
- name: tmp
|
|
emptyDir: {}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|