Kubernetes volumes from config.toml are not mounted on to pod or deployment
I am trying to mount volumes in the form of secret and configmap onto a runner pod / deployment. The Configmap “custom-config-toml” is as follows:
apiVersion: v1
data:
config.toml: |
[[runners]]
[runners.kubernetes]
pull_policy = ["if-not-present"]
image_pull_secrets = ["regpw"]
allowed_pull_policies = ["always", "if-not-present"]
[[runners.kubernetes.volumes.secret]]
name = "company-tls-ca"
mount_path = "/etc/gitlab-runner/certs/"
[[runners.kubernetes.volumes.config_map]]
name = "k8sCluster-CABundles"
mount_path = "/et/ssl/certs"
kind: ConfigMap
metadata:
name: custom-config-toml
namespace: glrunner
The GitLab Runner Operator configuration looks like following.
apiVersion: apps.gitlab.com/v1beta2
kind: Runner
metadata:
name: gl-runner
namespace: glrunner
spec:
gitlabUrl: https://gitlab.company.com
buildImage: alpine
ca: company-tls-ca
token: register-token-secret
config: custom-config-toml
tags: s3cache
cacheType: s3
s3:
bucket: job-cache
credentials: s3credentials
location: dc1
server: s3cache.company.com:9000
After creating the runner from the operator, the runner deployment and its pod are able to attach the above mentioned Configmap: custom-config-toml . The /home/gitlab-runner/.gitlab-runner/config.toml of the runner pod is also showing the above customization of config.toml in it. Is my understanding correct, in assuming the above mentioned volumes secret: company-tls-ca and configmap: k8sCluster-CABundles should also be attached to the runner pod/deployment? If yes, they are not attached at all. I expect to see the files at /etc/gitlab-runner/certs/ and at /etc/ssl/certs respectively from inside runner pod. In principal, I am trying to mount a custom CA certificate using the secret inside the runner pod, so that a job can install it in the helper container. Additionally I would like to install a CA-Bundle inside the runner pod. Can you suggest the best possible way to achieve this otherwise? Thanks in advance.
We are using Gitlab runner operator to roll out a Gitlab runner in Kubernetes executor. It is a self-managed gitlab instace version 16.2.4. Gitlab runner Version: 16.0.1 Git revision: 79704081 Git branch: 16-0-stable GO version: go1.19.9 Built: 2023-05-23T22:23:03+0000 OS/Arch: linux/amd64.