How to manage the runner cache in a Kubernetes Cluster managed by gitlab
I am running the runners of my CI thanks to a managed kubernetes.
I installed the gitlab runners through the gitlab panel.
I want to put cache and so I understand I need to externalized it to some blobStorage.
I have read this tocket (Kubernetes cache support (#1906) · Issues · GitLab.org / gitlab-runner · GitLab) but how to configure my runner since it has been installed through the gitlab client ?
$ kubectl describe pod xxx --namespace=gitlab-managed-apps
Namespace: gitlab-managed-apps
Priority: 0
Node: xxx
Start Time: Thu, 24 Sep 2020 10:15:35 +0200
Labels: app=runner-gitlab-runner
chart=gitlab-runner-0.21.0
heritage=Tiller
pod-template-hash=xx
release=runner
Annotations: checksum/configmap: xxx
checksum/secrets: xxx
prometheus.io/port: 9252
prometheus.io/scrape: true
Status: Running
IP: xxx
IPs:
IP: xxx
Controlled By: ReplicaSet/runner-gitlab-runner-67b599d94
Init Containers:
configure:
Container ID: docker://xxx
Image: gitlab/gitlab-runner:alpine-v13.4.0
Image ID: docker-pullable://gitlab/gitlab-runner@sha256:xxx
Port: <none>
Host Port: <none>
Command:
sh
/config/configure
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 24 Sep 2020 10:15:46 +0200
Finished: Thu, 24 Sep 2020 10:15:46 +0200
Ready: True
Restart Count: 0
Environment:
CI_SERVER_URL: https://gitlab.com/
CLONE_URL:
RUNNER_REQUEST_CONCURRENCY: 1
RUNNER_EXECUTOR: kubernetes
REGISTER_LOCKED: true
RUNNER_TAG_LIST:
RUNNER_OUTPUT_LIMIT: 4096
KUBERNETES_IMAGE: ubuntu:16.04
KUBERNETES_PRIVILEGED: true
KUBERNETES_NAMESPACE: gitlab-managed-apps
KUBERNETES_POLL_TIMEOUT: 180
KUBERNETES_CPU_LIMIT:
KUBERNETES_CPU_LIMIT_OVERWRITE_MAX_ALLOWED:
KUBERNETES_MEMORY_LIMIT:
KUBERNETES_MEMORY_LIMIT_OVERWRITE_MAX_ALLOWED:
KUBERNETES_CPU_REQUEST:
KUBERNETES_CPU_REQUEST_OVERWRITE_MAX_ALLOWED:
KUBERNETES_MEMORY_REQUEST:
KUBERNETES_MEMORY_REQUEST_OVERWRITE_MAX_ALLOWED:
KUBERNETES_SERVICE_ACCOUNT:
KUBERNETES_SERVICE_CPU_LIMIT:
KUBERNETES_SERVICE_MEMORY_LIMIT:
KUBERNETES_SERVICE_CPU_REQUEST:
KUBERNETES_SERVICE_MEMORY_REQUEST:
KUBERNETES_HELPER_CPU_LIMIT:
KUBERNETES_HELPER_MEMORY_LIMIT:
KUBERNETES_HELPER_CPU_REQUEST:
KUBERNETES_HELPER_MEMORY_REQUEST:
KUBERNETES_HELPER_IMAGE:
KUBERNETES_PULL_POLICY:
Mounts:
/config from scripts (ro)
/init-secrets from init-runner-secrets (ro)
/secrets from runner-secrets (rw)
/var/run/secrets/kubernetes.io/serviceaccount from runner-gitlab-runner-token-t8ft2 (ro)
Containers:
runner-gitlab-runner:
Container ID: docker://xxx
Image: gitlab/gitlab-runner:alpine-v13.4.0
Image ID: docker-pullable://gitlab/gitlab-runner@sha256:xxx
Port: 9252/TCP
Host Port: 0/TCP
Command:
/bin/bash
/scripts/entrypoint
State: Running
Started: Thu, 24 Sep 2020 10:15:46 +0200
Ready: True
Restart Count: 0
Liveness: exec [/bin/bash /scripts/check-live] delay=60s timeout=1s period=10s #success=1 #failure=3
Readiness: exec [/usr/bin/pgrep gitlab.*runner] delay=10s timeout=1s period=10s #success=1 #failure=3
Environment:
CI_SERVER_URL: https://gitlab.com/
CLONE_URL:
RUNNER_REQUEST_CONCURRENCY: 1
RUNNER_EXECUTOR: kubernetes
REGISTER_LOCKED: true
RUNNER_TAG_LIST:
RUNNER_OUTPUT_LIMIT: 4096
KUBERNETES_IMAGE: ubuntu:16.04
KUBERNETES_PRIVILEGED: true
KUBERNETES_NAMESPACE: gitlab-managed-apps
KUBERNETES_POLL_TIMEOUT: 180
KUBERNETES_CPU_LIMIT:
KUBERNETES_CPU_LIMIT_OVERWRITE_MAX_ALLOWED:
KUBERNETES_MEMORY_LIMIT:
KUBERNETES_MEMORY_LIMIT_OVERWRITE_MAX_ALLOWED:
KUBERNETES_CPU_REQUEST:
KUBERNETES_CPU_REQUEST_OVERWRITE_MAX_ALLOWED:
KUBERNETES_MEMORY_REQUEST:
KUBERNETES_MEMORY_REQUEST_OVERWRITE_MAX_ALLOWED:
KUBERNETES_SERVICE_ACCOUNT:
KUBERNETES_SERVICE_CPU_LIMIT:
KUBERNETES_SERVICE_MEMORY_LIMIT:
KUBERNETES_SERVICE_CPU_REQUEST:
KUBERNETES_SERVICE_MEMORY_REQUEST:
KUBERNETES_HELPER_CPU_LIMIT:
KUBERNETES_HELPER_MEMORY_LIMIT:
KUBERNETES_HELPER_CPU_REQUEST:
KUBERNETES_HELPER_MEMORY_REQUEST:
KUBERNETES_HELPER_IMAGE:
KUBERNETES_PULL_POLICY:
Mounts:
/home/gitlab-runner/.gitlab-runner from etc-gitlab-runner (rw)
/scripts from scripts (rw)
/secrets from runner-secrets (rw)
/var/run/secrets/kubernetes.io/serviceaccount from runner-gitlab-runner-token-t8ft2 (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
runner-secrets:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
etc-gitlab-runner:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
init-runner-secrets:
Type: Projected (a volume that contains injected data from multiple sources)
SecretName: runner-gitlab-runner
SecretOptionalName: <nil>
scripts:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: runner-gitlab-runner
Optional: false
runner-gitlab-runner-token-t8ft2:
Type: Secret (a volume populated by a Secret)
SecretName: runner-gitlab-runner-token-t8ft2
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events: <none>