mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
cicd practice part 1
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Запуск раннера в Kubernetes
|
||||
|
||||
## 1. Добавляем helm repo
|
||||
|
||||
```bash
|
||||
helm repo add gitlab https://charts.gitlab.io
|
||||
```
|
||||
|
||||
## 2. Установка gitlab-runner в кластер
|
||||
|
||||
Перед установкой нужно поправить файл с настройками: ```values.yaml```
|
||||
|
||||
Для того, чтобы раннер зарегистрировался, нужно будет вписать уникальный токен, взятый из вашего форка xpaste вот тут: ``Settings - CI/CD - Runners - Specific runners - registration token``. Скопируйте его из Gitlab и вставьте в файл values.yaml, в переменную `runnerRegistrationToken`.
|
||||
|
||||
Как вы уже поняли, для установки мы пойдем знакомым путём Helm, выполнив команды:
|
||||
|
||||
```bash
|
||||
helm upgrade -i gitlab-runner gitlab/gitlab-runner -f values.yaml
|
||||
```
|
||||
|
||||
## 3. Проверка регистрации раннера
|
||||
|
||||
Там же, где вы брали токен для регистрации раннера, можно будет посмотреть на него (если всё сделано правильно) в списке "Available specific runners".
|
||||
@@ -0,0 +1,51 @@
|
||||
## The GitLab Server URL (with protocol) that want to register the runner against
|
||||
## ref: https://docs.gitlab.com/runner/commands/README.html#gitlab-runner-register
|
||||
##
|
||||
gitlabUrl: http://gitlab.com/
|
||||
|
||||
## The Registration Token for adding new Runners to the GitLab Server. This must
|
||||
## be retrieved from your GitLab Instance.
|
||||
## ref: https://docs.gitlab.com/ce/ci/runners/README.html
|
||||
##
|
||||
runnerRegistrationToken: <Токен для раннера>
|
||||
|
||||
runners:
|
||||
config: |
|
||||
[[runners]]
|
||||
[runners.kubernetes]
|
||||
image = "alpine:3.14"
|
||||
cpu_request = "1000m"
|
||||
cpu_limit = "1000m"
|
||||
memory_limit = "2048Mi"
|
||||
memory_request = "1024Mi"
|
||||
tags: slurm-k8s
|
||||
|
||||
## For RBAC support:
|
||||
rbac:
|
||||
create: true
|
||||
|
||||
## Run the gitlab-bastion container with the ability to deploy/manage containers of jobs
|
||||
## cluster-wide or only within namespace
|
||||
clusterWideAccess: false
|
||||
|
||||
## Use the following Kubernetes Service Account name if RBAC is disabled in this Helm chart (see rbac.create)
|
||||
##
|
||||
serviceAccountName: s<номер_студента>
|
||||
|
||||
## Use podSecurity Policy
|
||||
## ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
|
||||
podSecurityPolicy:
|
||||
enabled: false
|
||||
resourceNames:
|
||||
- gitlab-runner
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
limits:
|
||||
memory: 256Mi
|
||||
cpu: 200m
|
||||
requests:
|
||||
memory: 128Mi
|
||||
cpu: 50m
|
||||
Reference in New Issue
Block a user