Skip to content

Add support for interactive web terminal

Romuald Atchadé requested to merge interactive-web into main

What does this MR do?

Add support of web interactive terminal to GitLab Runner Helm Chart

Why was this MR needed?

What's the best way to test this MR?

  1. Create a k8s cluster on GKE
  2. Update the values.yaml file as follow:
values.yaml
image: gitlab/gitlab-runner:alpine3.12-bleeding
imagePullPolicy: IfNotPresent
replicas: 1
gitlabUrl: https://gitlab.com/
runnerRegistrationToken: "YOUR_TOKEN"
terminationGracePeriodSeconds: 3600
concurrent: 1
checkInterval: 0
sessionServer:
  enabled: true
  # timeout: 1800
  # internalPort: 8093
  # externalPort: 9000

## For RBAC support:
rbac:
  create: true
  rules: []
  clusterWideAccess: false

  podSecurityPolicy:
    enabled: false
    resourceNames:
    - gitlab-runner

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

service:
  enabled: false
  type: ClusterIP

## Configuration for the Pods that the runner launches for each new job
##
runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        namespace = "{{.Release.Namespace}}"
        image = "ubuntu:16.04"

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

securityContext:
  runAsUser: 100
  fsGroup: 65533
resources: {}
affinity: {}
nodeSelector: {}
tolerations: []
hostAliases: []
podAnnotations: {}
podLabels: {}
secrets: []
configMaps: {}
  1. Install runner with the following command:
helm install gitlab-runner -f values.yaml .
  1. Start a new job using the gitlab-ci file below
gitlab-ci
variables:
  GIT_STRATEGY: clone
  DURATION: 600
  FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "false"
job:
  script:
  - 'for i in $(seq 1 $DURATION); do echo $(date); sleep 1; done'
  - echo "done :-)"
  1. The Debug console button will be available on the job logs page and once opened the web interactive console will be accessible as shown below
screenshot

Job link

Screen_Shot_2021-11-11_at_6.08.40_PM

Screen_Shot_2021-11-11_at_6.07.02_PM

Screen_Shot_2021-11-11_at_6.13.00_PM

What are the relevant issue numbers?

Closes: #79 (closed)

Edited by Romuald Atchadé

Merge request reports