/
[Kubernetes] Gitlab Runner 설치

[Kubernetes] Gitlab Runner 설치

  • Kubernetes cluster의 Applications tab > Gitlab Runner 설치

설치 전 환경 설정

  • values.yaml 수정

$ vi /opt/gitlab/embedded/service/gitlab-rails/vendor/runner/values.yaml image: gitlab/gitlab-runner securityContext: fsGroup: 999 runAsUser: 999 ## Configure the maximum number of concurrent jobs ## - Documentation: https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section ## - Default value: 10 ## - Currently don't support auto-scaling. concurrent: 4 ## Defines in seconds how often to check GitLab for a new builds ## - Documentation: https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section ## - Default value: 3 checkInterval: 3 certsSecretName: runner-secret ## For RBAC support rbac: clusterWideAccess: false ## Configuration for the Pods that that the runner launches for each new job runners: image: ubuntu:18.04 privileged: true imagePullSecrets: - [local-harbor] builds: {} services: {} helpers: {} resources: {} hostAliases: - ip: "14.36.48.220" hostnames: - "gitlab.twoseed.co.kr" - ip: "175.197.124.236" hostnames: - "local.registry.co.kr"

gitlab runner 등록을 위한 이미지 및 권한 부여

# values.yaml 내용 image: gitlab/gitlab-runner securityContext: fsGroup: 999 runAsUser: 999

인증을 위한 secret 생성

$ kubectl --namespace gitlab-managed-apps create secret generic runner-secret --from-file=/etc/docker/certs.d/gitlab.twoseed.co.kr/gitlab.twoseed.co.kr.crt # values.yaml 내용 certsSecretName: runner-secret

hosts 도메인 등록을 위한 설정

Runner 설정

 

Gitlab runner 설치 확인

  • Kubernetes cluster의 Applications tab 확인

  • Admin > Overview > Runners 에서 생성된 Runner 확인

  • 마스터 노드 터미널에서 Pod 로그 확인