Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Gitlab+gitlab-runner+k8s

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, install gitlab-runner

Docker run-d-- name gitlab-runner-- restart always-v / srv/gitlab-runner/config:/etc/gitlab-runner-v / var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest

Registration:

Docker run-- rm-v / srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register-- non-interactive-- executor "docker"-- docker-image "docker:19.03.1"-- url "http://gitlab.com/"-- registration-token" xZLaGbMzcSaGy-gjPvAv "- description" hyh gitlab-runner "- docker-privileged-- docker-volumes" / certs/client "

Add k8s cluster to gitlab

Get the api address

# API address:

Kubectl cluster-info | grep 'Kubernetes master' | awk' / http/ {print $NF}'

Get the ca certificate

# CA certificate:

Kubectl get secrets

# copy the token name with name similar to default-token-xxxxx in the result to the following command:

Kubectl get secret-o jsonpath= "{['data'] [' ca.crt']}" | base64-- decode

Get service token

Kubectl-n kube-system describe secret $(kubectl-n kube-system get secret | grep gitlab-admin | awk'{print $1}')

Advanced settings, otherwise there is no permission to execute the k8s command

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report