From 4c9a30c157935abb0e0d6c676344c6f90a77f846 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Sun, 3 May 2020 14:34:08 -0400 Subject: [PATCH] init --- .gitignore | 1 + README.md | 22 +++++++++++++++ k8s/rolebinding.yaml | 12 +++++++++ k8s/serviceaccount.yaml | 4 +++ runnerconfig.yaml.example | 57 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 k8s/rolebinding.yaml create mode 100644 k8s/serviceaccount.yaml create mode 100644 runnerconfig.yaml.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31c4d3e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +runnerconfig.yaml \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e26d82a --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Create a gitlab runner in your namespace with Helm + +Install: + +Edit runnerconfig.yaml and add your token + +```bash +helm install --namespace ducoterra services-runner -f runnerconfig.yaml gitlab/gitlab-runner +helm install --namespace ducoterra reese-runner -f runnerconfig.yaml gitlab/gitlab-runner +``` + +Uninstall: + +```bash +helm delete --namespace ducoterra services-runner +``` + +## Giving the runner access to your namespace + +```bash +kubectl apply -f k8s +``` diff --git a/k8s/rolebinding.yaml b/k8s/rolebinding.yaml new file mode 100644 index 0000000..f80bd0d --- /dev/null +++ b/k8s/rolebinding.yaml @@ -0,0 +1,12 @@ +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: gitlab-runner +subjects: +- kind: ServiceAccount + name: gitlab-runner + apiGroup: "" +roleRef: + kind: ClusterRole + name: gitlab-runner + apiGroup: "" \ No newline at end of file diff --git a/k8s/serviceaccount.yaml b/k8s/serviceaccount.yaml new file mode 100644 index 0000000..93c95aa --- /dev/null +++ b/k8s/serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: gitlab-runner \ No newline at end of file diff --git a/runnerconfig.yaml.example b/runnerconfig.yaml.example new file mode 100644 index 0000000..46ba626 --- /dev/null +++ b/runnerconfig.yaml.example @@ -0,0 +1,57 @@ +# CONFIGURE ME +runnerRegistrationToken: +gitlabUrl: https://gitlab.ducoterra.net/ + +# PRE-CONFIGURED +imagePullPolicy: IfNotPresent +unregisterRunners: true +terminationGracePeriodSeconds: 3600 +concurrent: 10 +checkInterval: 30 +rbac: + clusterWideAccess: false + serviceAccountName: gitlab-runner +metrics: + enabled: true +runners: + image: debian:10 + locked: false + privileged: false + pollTimeout: 180 + outputLimit: 4096 + cache: {} + builds: + cpuLimit: 1000m + cpuLimitOverwriteMaxAllowed: 2000m + memoryLimit: 1Gi + memoryLimitOverwriteMaxAllowed: 2Gi + cpuRequests: 1m + cpuRequestsOverwriteMaxAllowed: 200m + memoryRequests: 1Mi + memoryRequestsOverwriteMaxAllowed: 256Mi + services: + cpuLimit: 1000m + memoryLimit: 1Gi + cpuRequests: 1m + memoryRequests: 1Mi + helpers: + cpuLimit: 1000m + memoryLimit: 1Gi + cpuRequests: 1m + memoryRequests: 1Mi +securityContext: + fsGroup: 65533 + runAsUser: 100 +resources: {} + # limits: + # memory: "1Gi" + # cpu: "1" + # requests: + # memory: "1Mi" + # cpu: "1m" +affinity: {} +nodeSelector: {} +tolerations: [] +hostAliases: [] +podAnnotations: {} +podLabels: {} \ No newline at end of file