Skip to content

Enable ability to use tini instead of dumb-init

Romuald Atchadé requested to merge fix_ubi_init into main

What does this MR do?

This work finishes a Community contribution started here !374 (closed)

Installation of GitLab Runner using the gitlab-runner-ubi-image fails as dumb-init is not available in the image. The image makes instead use of tini.

With this MR a new property is added to allow user to explicitly use tini instead of dumb-init when installing GitLab Runner. The property defaults to false

Why was this MR needed?

Allow installation of GitLab Runner when gitlab-runner-ubi-image

What's the best way to test this MR?

values.yaml
image:
  registry: registry.gitlab.com
  image: gitlab-org/ci-cd/gitlab-runner-ubi-images/gitlab-runner-ocp
  tag: amd64-main
useTini: true
imagePullPolicy: IfNotPresent
replicas: 1
gitlabUrl: https://gitlab.com/
runnerRegistrationToken: "__TOKEN__"
unregisterRunners: true
useJobNamespace: true
terminationGracePeriodSeconds: 0
concurrent: 1
checkInterval: 1
logLevel: "debug"
sessionServer:
  enabled: false
  annotations: {}
  timeout: 1800
  internalPort: 8093
  externalPort: 9000
rbac:
  create: true
  rules:
  - apiGroups: [""]
    resources: ["configmaps", "pods", "pods/attach", "secrets", "services",  "serviceAccounts"]
    verbs: ["get", "list", "watch", "create", "patch", "update", "delete"]
  - apiGroups: [""]
    resources: ["pods/exec"]
    verbs: ["create", "patch", "delete"]
  clusterWideAccess: false

  serviceAccountName: ""
  serviceAccountAnnotations: {}
  podSecurityPolicy:
    enabled: false
    resourceNames:
    - gitlab-runner

metrics:
  enabled: true
  portName: metrics
  port: 9252
  serviceMonitor:
    enabled: false

service:
  enabled: false
  type: ClusterIP

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "alpine"

  cache: {}
  builds: {}
  services: {}
  helpers: {}

securityContext:
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: false
  runAsNonRoot: false

podSecurityContext:
  runAsUser: 999
  fsGroup: 999

resources: {}
affinity: {}
nodeSelector: {}
tolerations: []
hostAliases: []
podAnnotations: {}
podLabels: {}
hpa: {}
secrets: []
configMaps: {}
volumeMounts: []
volumes: []
❯ helm install gitlab-runner . -f values.yaml
NAME: gitlab-runner
LAST DEPLOYED: Thu Mar 23 21:34:29 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Your GitLab Runner should now be registered against the GitLab instance reachable at: "https://gitlab.com/"

GitLab Runner is well installed

ScreenShot

Screenshot_2023-03-23_at_9.42.42_PM

Uninstall GitLab Runner

❯ helm delete gitlab-runner
release "gitlab-runner" uninstalled

What are the relevant issue numbers?

close gitlab-org/ci-cd/gitlab-runner-ubi-images#14 (closed)

Edited by Romuald Atchadé

Merge request reports