zl程序教程

您现在的位置是:首页 >  其他

当前栏目

Helm 搭建K8S环境gitlab-runner

2023-02-18 16:31:13 时间

Prerequisites

  • Your GitLab server’s API is reachable from the cluster.
  • Kubernetes 1.4+ with Beta APIs enabled.
  • The kubectl CLI installed locally and authenticated for the cluster.
  • The Helm client installed locally on your machine.

Install

安装Helm

Helm 的安装请自行搜索后安装

helm3 repo add gitlab https://charts.gitlab.io

helm3 search repo -l gitlab/gitlab-runner

下载gitlab-runner chart 文件

helm3 pull gitlab/gitlab-runner (默认拉取最新版本,可用 --version x.x.x 拉取指定版本)

tar -xf gitlab-runner-0.47.1.tgz

编辑values.yaml如下

准备好gitlab 的url , 与token (有三类,我用群组token,方法网上很多);镜像我用官网默认

安装runner

install: helm3 install --namespace cicd gitlab-runner -f values.yaml gitlab/gitlab-runner

uninstall: helm3 uninstall gitlab-runner -n cicd

验证

Runner pod状态 READY ,STATUS 是 Running

再查看gitlab上状态

测试流水线

运行流水线成功