mirror of
https://gitea.com/gitea/helm-actions.git
synced 2026-12-01 08:57:48 +00:00
### Description of the change Make DinD optional and add opt-in ServiceAccount/RBAC creation for native Kubernetes jobs. Preserve Docker defaults and compatibility with reused Helm values. ### Benefits Deploy Kubernetes jobs through the existing chart, with support for mixed backend labels. ### Possible drawbacks Requires matching runner configuration. Docker container actions remain unsupported by the upstream Kubernetes backend. ### Additional information Validated with 61 Helm tests, lint, packaging, and kind: six concurrent jobs, checkout/services, artifacts/cache, cleanup, restarts and backend upgrades. Manual validation completed. ### Checklist - [x] Parameters documented in values.yaml and generated README.md - [x] Helm templating unit tests added - [x] New resources render metadata.namespace Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/194 Reviewed-by: DaanSelen <[email protected]> Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: James Tatum <[email protected]>
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
{{- if and .Values.enabled (.Values.rbac | default dict).create }}
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: {{ include "gitea.actions.fullname" . }}-runner
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
labels:
|
|
{{- include "gitea.actions.labels.runner" . | nindent 4 }}
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["pods"]
|
|
verbs: ["create", "get", "list", "delete"]
|
|
- apiGroups: [""]
|
|
resources: ["pods/exec"]
|
|
verbs: ["create", "get"]
|
|
- apiGroups: [""]
|
|
resources: ["pods/log"]
|
|
verbs: ["get"]
|
|
- apiGroups: [""]
|
|
resources: ["secrets"]
|
|
verbs: ["create", "delete"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: {{ include "gitea.actions.fullname" . }}-runner
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
labels:
|
|
{{- include "gitea.actions.labels.runner" . | nindent 4 }}
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: Role
|
|
name: {{ include "gitea.actions.fullname" . }}-runner
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: {{ include "gitea.actions.serviceAccountName" . | quote }}
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
{{- end }}
|